cs-djutils 20241110__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ include README.md
@@ -0,0 +1,70 @@
1
+ Metadata-Version: 2.1
2
+ Name: cs.djutils
3
+ Version: 20241110
4
+ Summary: My collection of things for working with Django.
5
+ Author-email: Cameron Simpson <cs@cskk.id.au>
6
+ License: GNU General Public License v3 or later (GPLv3+)
7
+ Project-URL: Monorepo Hg/Mercurial Mirror, https://hg.sr.ht/~cameron-simpson/css
8
+ Project-URL: Monorepo Git Mirror, https://github.com/cameron-simpson/css
9
+ Project-URL: MonoRepo Commits, https://bitbucket.org/cameron_simpson/css/commits/branch/main
10
+ Project-URL: Source, https://github.com/cameron-simpson/css/blob/main/lib/python/cs/djutils.py
11
+ Keywords: python3
12
+ Classifier: Programming Language :: Python
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Development Status :: 4 - Beta
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
18
+ Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
19
+ Description-Content-Type: text/markdown
20
+ Requires-Dist: cs.cmdutils>=20241110
21
+ Requires-Dist: django
22
+
23
+ My collection of things for working with Django.
24
+
25
+ *Latest release 20241110*:
26
+ Initial PyPI release with DjangoBaseCommand, cs.cmdutils.BaseCommand subclass suppplanting django.core.management.base.BaseCommand.
27
+
28
+ ## <a name="DjangoBaseCommand"></a>Class `DjangoBaseCommand(cs.cmdutils.BaseCommand, django.core.management.base.BaseCommand)`
29
+
30
+ A drop in class for `django.core.management.base.BaseCommand`
31
+ which subclasses `cs.cmdutils.BaseCommand`.
32
+
33
+ This lets me write management commands more easily, particularly
34
+ if there are subcommands.
35
+
36
+ Usage summary:
37
+
38
+ Usage: djangobase [common-options...] [options...]
39
+ A drop in class for `django.core.management.base.BaseCommand`
40
+ which subclasses `cs.cmdutils.BaseCommand`.
41
+ Subcommands:
42
+ help [common-options...] [-l] [subcommand-names...]
43
+ Print help for subcommands.
44
+ This outputs the full help for the named subcommands,
45
+ or the short help for all subcommands if no names are specified.
46
+ -l Long help even if no subcommand-names provided.
47
+ info [common-options...] [field-names...]
48
+ Recite general information.
49
+ Explicit field names may be provided to override the default listing.
50
+ shell [common-options...]
51
+ Run a command prompt via cmd.Cmd using this command's subcommands.
52
+
53
+ *`DjangoBaseCommand.add_arguments(self, parser)`*:
54
+ Add the `Options.COMMON_OPT_SPECS` to the `argparse` parser.
55
+ This is basicly to support the Django `call_command` function.
56
+
57
+ *`DjangoBaseCommand.handle(*, argv, **options)`*:
58
+ The Django `BaseComand.handle` method.
59
+ This creates another instance for `argv` and runs it.
60
+
61
+ *`DjangoBaseCommand.run_from_argv(argv)`*:
62
+ Intercept `django.core.management.base.BaseCommand.run_from_argv`.
63
+ Construct an instance of cs.djutils.DjangoBaseCommand` and run it.
64
+
65
+ # Release Log
66
+
67
+
68
+
69
+ *Release 20241110*:
70
+ Initial PyPI release with DjangoBaseCommand, cs.cmdutils.BaseCommand subclass suppplanting django.core.management.base.BaseCommand.
@@ -0,0 +1,48 @@
1
+ My collection of things for working with Django.
2
+
3
+ *Latest release 20241110*:
4
+ Initial PyPI release with DjangoBaseCommand, cs.cmdutils.BaseCommand subclass suppplanting django.core.management.base.BaseCommand.
5
+
6
+ ## <a name="DjangoBaseCommand"></a>Class `DjangoBaseCommand(cs.cmdutils.BaseCommand, django.core.management.base.BaseCommand)`
7
+
8
+ A drop in class for `django.core.management.base.BaseCommand`
9
+ which subclasses `cs.cmdutils.BaseCommand`.
10
+
11
+ This lets me write management commands more easily, particularly
12
+ if there are subcommands.
13
+
14
+ Usage summary:
15
+
16
+ Usage: djangobase [common-options...] [options...]
17
+ A drop in class for `django.core.management.base.BaseCommand`
18
+ which subclasses `cs.cmdutils.BaseCommand`.
19
+ Subcommands:
20
+ help [common-options...] [-l] [subcommand-names...]
21
+ Print help for subcommands.
22
+ This outputs the full help for the named subcommands,
23
+ or the short help for all subcommands if no names are specified.
24
+ -l Long help even if no subcommand-names provided.
25
+ info [common-options...] [field-names...]
26
+ Recite general information.
27
+ Explicit field names may be provided to override the default listing.
28
+ shell [common-options...]
29
+ Run a command prompt via cmd.Cmd using this command's subcommands.
30
+
31
+ *`DjangoBaseCommand.add_arguments(self, parser)`*:
32
+ Add the `Options.COMMON_OPT_SPECS` to the `argparse` parser.
33
+ This is basicly to support the Django `call_command` function.
34
+
35
+ *`DjangoBaseCommand.handle(*, argv, **options)`*:
36
+ The Django `BaseComand.handle` method.
37
+ This creates another instance for `argv` and runs it.
38
+
39
+ *`DjangoBaseCommand.run_from_argv(argv)`*:
40
+ Intercept `django.core.management.base.BaseCommand.run_from_argv`.
41
+ Construct an instance of cs.djutils.DjangoBaseCommand` and run it.
42
+
43
+ # Release Log
44
+
45
+
46
+
47
+ *Release 20241110*:
48
+ Initial PyPI release with DjangoBaseCommand, cs.cmdutils.BaseCommand subclass suppplanting django.core.management.base.BaseCommand.
@@ -0,0 +1,75 @@
1
+ #!/usr/bin/env python3
2
+
3
+ ''' My collection of things for working with Django.
4
+ '''
5
+
6
+ import sys
7
+
8
+ from django.core.management.base import (
9
+ BaseCommand as BaseDjangoBaseCommand,
10
+ CommandError as DjangoCommandError,
11
+ )
12
+
13
+ from cs.cmdutils import BaseCommand
14
+
15
+ __version__ = '20241110'
16
+
17
+ DISTINFO = {
18
+ 'keywords': ["python3"],
19
+ 'classifiers': [
20
+ "Programming Language :: Python",
21
+ "Programming Language :: Python :: 3",
22
+ ],
23
+ 'install_requires': [
24
+ 'cs.cmdutils',
25
+ 'django',
26
+ ],
27
+ }
28
+
29
+ class DjangoBaseCommand(BaseCommand, BaseDjangoBaseCommand):
30
+ ''' A drop in class for `django.core.management.base.BaseCommand`
31
+ which subclasses `cs.cmdutils.BaseCommand`.
32
+
33
+ This lets me write management commands more easily, particularly
34
+ if there are subcommands.
35
+ '''
36
+
37
+ @classmethod
38
+ def run_from_argv(cls, argv):
39
+ ''' Intercept `django.core.management.base.BaseCommand.run_from_argv`.
40
+ Construct an instance of cs.djutils.DjangoBaseCommand` and run it.
41
+ '''
42
+ _, djcmdname, *argv = argv
43
+ command = cls(argv, cmd=djcmdname)
44
+ return command.run()
45
+
46
+ @classmethod
47
+ def handle(cls, *, argv, **options):
48
+ ''' The Django `BaseComand.handle` method.
49
+ This creates another instance for `argv` and runs it.
50
+ '''
51
+ if cls.has_subcommands():
52
+ subcmd = options.pop('subcmd', None)
53
+ if subcmd is not None:
54
+ argv.insert(0, subcmd)
55
+ argv.insert(0, sys.argv[0])
56
+ command = cls(argv, **options)
57
+ xit = command.run()
58
+ if xit:
59
+ raise DjangoCommandError(xit)
60
+
61
+ def add_arguments(self, parser):
62
+ ''' Add the `Options.COMMON_OPT_SPECS` to the `argparse` parser.
63
+ This is basicly to support the Django `call_command` function.
64
+ '''
65
+ if self.has_subcommands():
66
+ parser.add_argument('subcmd', nargs='?')
67
+ options = self.options
68
+ _, _, getopt_spec_map = options.getopt_spec_map({})
69
+ for opt, opt_spec in getopt_spec_map.items():
70
+ # known django argument conflicts
71
+ # TODO: can I inspect the parser to detect these?
72
+ if opt in ('-v',):
73
+ continue
74
+ opt_spec.add_argument(parser, options=options)
75
+ parser.add_argument('argv', nargs='*')
@@ -0,0 +1,70 @@
1
+ Metadata-Version: 2.1
2
+ Name: cs.djutils
3
+ Version: 20241110
4
+ Summary: My collection of things for working with Django.
5
+ Author-email: Cameron Simpson <cs@cskk.id.au>
6
+ License: GNU General Public License v3 or later (GPLv3+)
7
+ Project-URL: Monorepo Hg/Mercurial Mirror, https://hg.sr.ht/~cameron-simpson/css
8
+ Project-URL: Monorepo Git Mirror, https://github.com/cameron-simpson/css
9
+ Project-URL: MonoRepo Commits, https://bitbucket.org/cameron_simpson/css/commits/branch/main
10
+ Project-URL: Source, https://github.com/cameron-simpson/css/blob/main/lib/python/cs/djutils.py
11
+ Keywords: python3
12
+ Classifier: Programming Language :: Python
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Development Status :: 4 - Beta
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
18
+ Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
19
+ Description-Content-Type: text/markdown
20
+ Requires-Dist: cs.cmdutils>=20241110
21
+ Requires-Dist: django
22
+
23
+ My collection of things for working with Django.
24
+
25
+ *Latest release 20241110*:
26
+ Initial PyPI release with DjangoBaseCommand, cs.cmdutils.BaseCommand subclass suppplanting django.core.management.base.BaseCommand.
27
+
28
+ ## <a name="DjangoBaseCommand"></a>Class `DjangoBaseCommand(cs.cmdutils.BaseCommand, django.core.management.base.BaseCommand)`
29
+
30
+ A drop in class for `django.core.management.base.BaseCommand`
31
+ which subclasses `cs.cmdutils.BaseCommand`.
32
+
33
+ This lets me write management commands more easily, particularly
34
+ if there are subcommands.
35
+
36
+ Usage summary:
37
+
38
+ Usage: djangobase [common-options...] [options...]
39
+ A drop in class for `django.core.management.base.BaseCommand`
40
+ which subclasses `cs.cmdutils.BaseCommand`.
41
+ Subcommands:
42
+ help [common-options...] [-l] [subcommand-names...]
43
+ Print help for subcommands.
44
+ This outputs the full help for the named subcommands,
45
+ or the short help for all subcommands if no names are specified.
46
+ -l Long help even if no subcommand-names provided.
47
+ info [common-options...] [field-names...]
48
+ Recite general information.
49
+ Explicit field names may be provided to override the default listing.
50
+ shell [common-options...]
51
+ Run a command prompt via cmd.Cmd using this command's subcommands.
52
+
53
+ *`DjangoBaseCommand.add_arguments(self, parser)`*:
54
+ Add the `Options.COMMON_OPT_SPECS` to the `argparse` parser.
55
+ This is basicly to support the Django `call_command` function.
56
+
57
+ *`DjangoBaseCommand.handle(*, argv, **options)`*:
58
+ The Django `BaseComand.handle` method.
59
+ This creates another instance for `argv` and runs it.
60
+
61
+ *`DjangoBaseCommand.run_from_argv(argv)`*:
62
+ Intercept `django.core.management.base.BaseCommand.run_from_argv`.
63
+ Construct an instance of cs.djutils.DjangoBaseCommand` and run it.
64
+
65
+ # Release Log
66
+
67
+
68
+
69
+ *Release 20241110*:
70
+ Initial PyPI release with DjangoBaseCommand, cs.cmdutils.BaseCommand subclass suppplanting django.core.management.base.BaseCommand.
@@ -0,0 +1,9 @@
1
+ MANIFEST.in
2
+ README.md
3
+ pyproject.toml
4
+ lib/python/cs/djutils.py
5
+ lib/python/cs.djutils.egg-info/PKG-INFO
6
+ lib/python/cs.djutils.egg-info/SOURCES.txt
7
+ lib/python/cs.djutils.egg-info/dependency_links.txt
8
+ lib/python/cs.djutils.egg-info/requires.txt
9
+ lib/python/cs.djutils.egg-info/top_level.txt
@@ -0,0 +1,2 @@
1
+ cs.cmdutils>=20241110
2
+ django
@@ -0,0 +1,100 @@
1
+ [project]
2
+ name = "cs.djutils"
3
+ description = "My collection of things for working with Django."
4
+ authors = [
5
+ { name = "Cameron Simpson", email = "cs@cskk.id.au" },
6
+ ]
7
+ keywords = [
8
+ "python3",
9
+ ]
10
+ dependencies = [
11
+ "cs.cmdutils>=20241110",
12
+ "django",
13
+ ]
14
+ classifiers = [
15
+ "Programming Language :: Python",
16
+ "Programming Language :: Python :: 3",
17
+ "Development Status :: 4 - Beta",
18
+ "Intended Audience :: Developers",
19
+ "Operating System :: OS Independent",
20
+ "Topic :: Software Development :: Libraries :: Python Modules",
21
+ "License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
22
+ ]
23
+ version = "20241110"
24
+
25
+ [project.license]
26
+ text = "GNU General Public License v3 or later (GPLv3+)"
27
+
28
+ [project.urls]
29
+ "Monorepo Hg/Mercurial Mirror" = "https://hg.sr.ht/~cameron-simpson/css"
30
+ "Monorepo Git Mirror" = "https://github.com/cameron-simpson/css"
31
+ "MonoRepo Commits" = "https://bitbucket.org/cameron_simpson/css/commits/branch/main"
32
+ Source = "https://github.com/cameron-simpson/css/blob/main/lib/python/cs/djutils.py"
33
+
34
+ [project.readme]
35
+ text = """
36
+ My collection of things for working with Django.
37
+
38
+ *Latest release 20241110*:
39
+ Initial PyPI release with DjangoBaseCommand, cs.cmdutils.BaseCommand subclass suppplanting django.core.management.base.BaseCommand.
40
+
41
+ ## <a name=\"DjangoBaseCommand\"></a>Class `DjangoBaseCommand(cs.cmdutils.BaseCommand, django.core.management.base.BaseCommand)`
42
+
43
+ A drop in class for `django.core.management.base.BaseCommand`
44
+ which subclasses `cs.cmdutils.BaseCommand`.
45
+
46
+ This lets me write management commands more easily, particularly
47
+ if there are subcommands.
48
+
49
+ Usage summary:
50
+
51
+ Usage: djangobase [common-options...] [options...]
52
+ A drop in class for `django.core.management.base.BaseCommand`
53
+ which subclasses `cs.cmdutils.BaseCommand`.
54
+ Subcommands:
55
+ help [common-options...] [-l] [subcommand-names...]
56
+ Print help for subcommands.
57
+ This outputs the full help for the named subcommands,
58
+ or the short help for all subcommands if no names are specified.
59
+ -l Long help even if no subcommand-names provided.
60
+ info [common-options...] [field-names...]
61
+ Recite general information.
62
+ Explicit field names may be provided to override the default listing.
63
+ shell [common-options...]
64
+ Run a command prompt via cmd.Cmd using this command's subcommands.
65
+
66
+ *`DjangoBaseCommand.add_arguments(self, parser)`*:
67
+ Add the `Options.COMMON_OPT_SPECS` to the `argparse` parser.
68
+ This is basicly to support the Django `call_command` function.
69
+
70
+ *`DjangoBaseCommand.handle(*, argv, **options)`*:
71
+ The Django `BaseComand.handle` method.
72
+ This creates another instance for `argv` and runs it.
73
+
74
+ *`DjangoBaseCommand.run_from_argv(argv)`*:
75
+ Intercept `django.core.management.base.BaseCommand.run_from_argv`.
76
+ Construct an instance of cs.djutils.DjangoBaseCommand` and run it.
77
+
78
+ # Release Log
79
+
80
+
81
+
82
+ *Release 20241110*:
83
+ Initial PyPI release with DjangoBaseCommand, cs.cmdutils.BaseCommand subclass suppplanting django.core.management.base.BaseCommand."""
84
+ content-type = "text/markdown"
85
+
86
+ [build-system]
87
+ build-backend = "setuptools.build_meta"
88
+ requires = [
89
+ "setuptools >= 61.2",
90
+ "trove-classifiers",
91
+ "wheel",
92
+ ]
93
+
94
+ [tool.setuptools]
95
+ py-modules = [
96
+ "cs.djutils",
97
+ ]
98
+
99
+ [tool.setuptools.package-dir]
100
+ "" = "lib/python"
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+