multitool 0.7.0__tar.gz → 0.7.2__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.
Files changed (24) hide show
  1. {multitool-0.7.0 → multitool-0.7.2}/PKG-INFO +18 -40
  2. {multitool-0.7.0 → multitool-0.7.2}/README.rst +17 -39
  3. {multitool-0.7.0 → multitool-0.7.2}/multitool/__init__.py +6 -3
  4. {multitool-0.7.0 → multitool-0.7.2}/multitool/__main__.py +2 -2
  5. {multitool-0.7.0 → multitool-0.7.2}/multitool/plugins/commands.py +6 -6
  6. {multitool-0.7.0 → multitool-0.7.2}/multitool/utils.py +6 -4
  7. {multitool-0.7.0 → multitool-0.7.2}/multitool.egg-info/PKG-INFO +18 -40
  8. {multitool-0.7.0 → multitool-0.7.2}/pyproject.toml +1 -1
  9. {multitool-0.7.0 → multitool-0.7.2}/LICENSE +0 -0
  10. {multitool-0.7.0 → multitool-0.7.2}/multitool/cls.py +0 -0
  11. {multitool-0.7.0 → multitool-0.7.2}/multitool/console.py +0 -0
  12. {multitool-0.7.0 → multitool-0.7.2}/multitool/exceptions.py +0 -0
  13. {multitool-0.7.0 → multitool-0.7.2}/multitool/plugins/__init__.py +0 -0
  14. {multitool-0.7.0 → multitool-0.7.2}/multitool/silent.py +0 -0
  15. {multitool-0.7.0 → multitool-0.7.2}/multitool/utils_init.py +0 -0
  16. {multitool-0.7.0 → multitool-0.7.2}/multitool/verbose.py +0 -0
  17. {multitool-0.7.0 → multitool-0.7.2}/multitool.egg-info/SOURCES.txt +0 -0
  18. {multitool-0.7.0 → multitool-0.7.2}/multitool.egg-info/dependency_links.txt +0 -0
  19. {multitool-0.7.0 → multitool-0.7.2}/multitool.egg-info/entry_points.txt +0 -0
  20. {multitool-0.7.0 → multitool-0.7.2}/multitool.egg-info/requires.txt +0 -0
  21. {multitool-0.7.0 → multitool-0.7.2}/multitool.egg-info/top_level.txt +0 -0
  22. {multitool-0.7.0 → multitool-0.7.2}/setup.cfg +0 -0
  23. {multitool-0.7.0 → multitool-0.7.2}/tests/__init__.py +0 -0
  24. {multitool-0.7.0 → multitool-0.7.2}/tests/test_utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: multitool
3
- Version: 0.7.0
3
+ Version: 0.7.2
4
4
  Summary: Create and run plugin-based command-line tools.
5
5
  Author-email: Matthew Delotavo <matthew.t.delotavo@gmail.com>
6
6
  License-Expression: MIT
@@ -26,9 +26,9 @@ multitool
26
26
 
27
27
  Create and run plugin-based command-line tools.
28
28
 
29
- -----
30
- TL;DR
31
- -----
29
+ ----------
30
+ Quickstart
31
+ ----------
32
32
 
33
33
  This section shows how to start prototyping plugins on your local machine.
34
34
  See the sections below to learn how to distribute your commands as remote
@@ -155,7 +155,7 @@ don't want changes applied automatically.
155
155
  Example configuration::
156
156
 
157
157
  [sources]
158
- public = https://github.com/mdelotavo/multitool-plugins.git
158
+ mdelotavo-multitool-plugins = https://github.com/mdelotavo/multitool-plugins.git
159
159
 
160
160
  After saving, Multitool clones each configured repository into::
161
161
 
@@ -164,19 +164,19 @@ After saving, Multitool clones each configured repository into::
164
164
  You can configure multiple repositories as long as each key is unique.
165
165
 
166
166
  ^^^^^^^^^^
167
- Quickstart
167
+ Installing
168
168
  ^^^^^^^^^^
169
169
 
170
170
  Install the example plugins::
171
171
 
172
- echo -e '[sources]\npublic = https://github.com/mdelotavo/multitool-plugins.git' >> ~/.multitool/plugins/config
172
+ echo -e '[sources]\nmdelotavo-multitool-plugins = https://github.com/mdelotavo/multitool-plugins.git' >> ~/.multitool/plugins/config
173
173
 
174
174
  multitool plugins update
175
175
  multitool plugins show
176
- multitool plugins show -n public
177
- multitool plugins show -n public --show-commit-only
178
- multitool plugins show -n public --show-dependencies-only
179
- pip3 install $(multitool plugins show -n public --show-dependencies-only)
176
+ multitool plugins show -n mdelotavo-multitool-plugins
177
+ multitool plugins show -n mdelotavo-multitool-plugins --show-commit-only
178
+ multitool plugins show -n mdelotavo-multitool-plugins --show-dependencies-only
179
+ pip3 install $(multitool plugins show -n mdelotavo-multitool-plugins --show-dependencies-only)
180
180
 
181
181
  multitool run examples -h
182
182
 
@@ -236,41 +236,19 @@ including the repository owner and repository name in the command name.
236
236
  For example, a repository configured as::
237
237
 
238
238
  [sources]
239
- public = https://github.com/mdelotavo/multitool-plugins.git
239
+ mdelotavo-multitool-plugins = https://github.com/mdelotavo/multitool-plugins.git
240
240
 
241
241
  should expose commands using a unique name such as::
242
242
 
243
243
  mdelotavo-multitool-plugins
244
244
 
245
- This prevents duplicate command names when multiple repositories provide
246
- plugins with the same module name. If two plugins expose commands with the
247
- same name, only one can be loaded and the duplicate plugin will be skipped.
248
-
249
- If two repositories expose the same command name, Multitool will fail to load
250
- the duplicate plugin and raise an error similar to::
251
-
252
- Duplicate plugin command "examples" found in
253
- /home/user/.multitool/plugins/PLUGIN_NAME/__init__.py.
254
- Already loaded from plugins_modules.examples
255
-
256
- To resolve the issue, remove the conflicting plugin repository from your local
257
- plugins directory::
258
-
259
- ~/.multitool/plugins/PLUGIN_NAME/
260
-
261
- and remove the repository from the configured sources.
262
-
263
- You can edit the configuration file manually::
264
-
265
- ~/.multitool/plugins/config
245
+ This reduces the likelihood of collisions when multiple repositories expose
246
+ plugins with the same command name.
266
247
 
267
- or open it using::
268
-
269
- multitool plugins configure
270
-
271
- After removing the conflicting repository, update the installed plugins::
272
-
273
- multitool plugins update
248
+ If duplicate command names are detected, Multitool will display an error
249
+ prompting you to delete the detected conflicting plugin repositories and, if
250
+ applicable, remove the corresponding remote sources from your plugin
251
+ configuration.
274
252
 
275
253
 
276
254
  .. _`click`: https://click.palletsprojects.com/
@@ -3,9 +3,9 @@ multitool
3
3
 
4
4
  Create and run plugin-based command-line tools.
5
5
 
6
- -----
7
- TL;DR
8
- -----
6
+ ----------
7
+ Quickstart
8
+ ----------
9
9
 
10
10
  This section shows how to start prototyping plugins on your local machine.
11
11
  See the sections below to learn how to distribute your commands as remote
@@ -132,7 +132,7 @@ don't want changes applied automatically.
132
132
  Example configuration::
133
133
 
134
134
  [sources]
135
- public = https://github.com/mdelotavo/multitool-plugins.git
135
+ mdelotavo-multitool-plugins = https://github.com/mdelotavo/multitool-plugins.git
136
136
 
137
137
  After saving, Multitool clones each configured repository into::
138
138
 
@@ -141,19 +141,19 @@ After saving, Multitool clones each configured repository into::
141
141
  You can configure multiple repositories as long as each key is unique.
142
142
 
143
143
  ^^^^^^^^^^
144
- Quickstart
144
+ Installing
145
145
  ^^^^^^^^^^
146
146
 
147
147
  Install the example plugins::
148
148
 
149
- echo -e '[sources]\npublic = https://github.com/mdelotavo/multitool-plugins.git' >> ~/.multitool/plugins/config
149
+ echo -e '[sources]\nmdelotavo-multitool-plugins = https://github.com/mdelotavo/multitool-plugins.git' >> ~/.multitool/plugins/config
150
150
 
151
151
  multitool plugins update
152
152
  multitool plugins show
153
- multitool plugins show -n public
154
- multitool plugins show -n public --show-commit-only
155
- multitool plugins show -n public --show-dependencies-only
156
- pip3 install $(multitool plugins show -n public --show-dependencies-only)
153
+ multitool plugins show -n mdelotavo-multitool-plugins
154
+ multitool plugins show -n mdelotavo-multitool-plugins --show-commit-only
155
+ multitool plugins show -n mdelotavo-multitool-plugins --show-dependencies-only
156
+ pip3 install $(multitool plugins show -n mdelotavo-multitool-plugins --show-dependencies-only)
157
157
 
158
158
  multitool run examples -h
159
159
 
@@ -213,41 +213,19 @@ including the repository owner and repository name in the command name.
213
213
  For example, a repository configured as::
214
214
 
215
215
  [sources]
216
- public = https://github.com/mdelotavo/multitool-plugins.git
216
+ mdelotavo-multitool-plugins = https://github.com/mdelotavo/multitool-plugins.git
217
217
 
218
218
  should expose commands using a unique name such as::
219
219
 
220
220
  mdelotavo-multitool-plugins
221
221
 
222
- This prevents duplicate command names when multiple repositories provide
223
- plugins with the same module name. If two plugins expose commands with the
224
- same name, only one can be loaded and the duplicate plugin will be skipped.
225
-
226
- If two repositories expose the same command name, Multitool will fail to load
227
- the duplicate plugin and raise an error similar to::
228
-
229
- Duplicate plugin command "examples" found in
230
- /home/user/.multitool/plugins/PLUGIN_NAME/__init__.py.
231
- Already loaded from plugins_modules.examples
232
-
233
- To resolve the issue, remove the conflicting plugin repository from your local
234
- plugins directory::
235
-
236
- ~/.multitool/plugins/PLUGIN_NAME/
237
-
238
- and remove the repository from the configured sources.
239
-
240
- You can edit the configuration file manually::
241
-
242
- ~/.multitool/plugins/config
222
+ This reduces the likelihood of collisions when multiple repositories expose
223
+ plugins with the same command name.
243
224
 
244
- or open it using::
245
-
246
- multitool plugins configure
247
-
248
- After removing the conflicting repository, update the installed plugins::
249
-
250
- multitool plugins update
225
+ If duplicate command names are detected, Multitool will display an error
226
+ prompting you to delete the detected conflicting plugin repositories and, if
227
+ applicable, remove the corresponding remote sources from your plugin
228
+ configuration.
251
229
 
252
230
 
253
231
  .. _`click`: https://click.palletsprojects.com/
@@ -1,5 +1,5 @@
1
1
  APP = "multitool"
2
- __version__ = "0.7.0"
2
+ __version__ = "0.7.2"
3
3
  description = "Create and run plugin-based command-line tools."
4
4
  long_description = ("Create and run plugin-based command-line tools by dynamically loading Click commands from local or Git-managed plugin repositories.")
5
5
 
@@ -8,16 +8,19 @@ from pathlib import Path
8
8
 
9
9
  from multitool.utils_init import join_path
10
10
 
11
+ # Runtime configuration
11
12
  MULTITOOL_TOGGLE_SILENT = False
12
13
  MULTITOOL_TOGGLE_VERBOSE = 0
13
14
 
15
+ # Application directories and files
14
16
  MULTITOOL_DIRECTORY = join_path(Path.home(), ".multitool")
15
-
16
17
  MULTITOOL_LOG_FILE = join_path(MULTITOOL_DIRECTORY, f"{APP}.log")
17
18
 
19
+ # Plugin directories and files
18
20
  MULTITOOL_PLUGINS_DIRECTORY = join_path(MULTITOOL_DIRECTORY, "plugins")
19
21
  MULTITOOL_PLUGINS_CONFIG_FILE = join_path(MULTITOOL_PLUGINS_DIRECTORY, "config")
20
- MULTITOOL_PLUGINS_PATH = join_path(MULTITOOL_PLUGINS_DIRECTORY, "__init__.py")
22
+ MULTITOOL_PLUGINS_INIT_FILE = join_path(MULTITOOL_PLUGINS_DIRECTORY, "__init__.py")
21
23
 
24
+ # Expose runtime configuration globally
22
25
  builtins.MULTITOOL_TOGGLE_SILENT = MULTITOOL_TOGGLE_SILENT
23
26
  builtins.MULTITOOL_TOGGLE_VERBOSE = MULTITOOL_TOGGLE_VERBOSE
@@ -8,7 +8,7 @@ from multitool import __version__ as version
8
8
  from multitool.cls import AliasedGroup
9
9
  from multitool.exceptions import wrap_with_exception_handling
10
10
  from multitool.plugins.commands import plugins
11
- from multitool.utils import (configure_logger, for_each_file, load_plugins)
11
+ from multitool.utils import (configure_root_logger, for_each_file, load_plugins)
12
12
 
13
13
  CONTEXT_SETTINGS = dict(help_option_names=["-h", "--help"])
14
14
 
@@ -29,7 +29,7 @@ def run():
29
29
 
30
30
  @wrap_with_exception_handling
31
31
  def main():
32
- configure_logger(MULTITOOL_LOG_FILE)
32
+ configure_root_logger(MULTITOOL_LOG_FILE)
33
33
 
34
34
  cli_commands = {plugins, run}
35
35
 
@@ -13,7 +13,7 @@ from multitool import (
13
13
  APP,
14
14
  MULTITOOL_PLUGINS_CONFIG_FILE,
15
15
  MULTITOOL_PLUGINS_DIRECTORY,
16
- MULTITOOL_PLUGINS_PATH,
16
+ MULTITOOL_PLUGINS_INIT_FILE,
17
17
  console,
18
18
  )
19
19
  from multitool.silent import common_silent_options
@@ -44,7 +44,7 @@ def require_git():
44
44
 
45
45
  def init():
46
46
  mkdir(MULTITOOL_PLUGINS_DIRECTORY)
47
- touch(MULTITOOL_PLUGINS_PATH)
47
+ touch(MULTITOOL_PLUGINS_INIT_FILE)
48
48
  touch(MULTITOOL_PLUGINS_CONFIG_FILE)
49
49
 
50
50
 
@@ -381,9 +381,9 @@ def hello(
381
381
  '''
382
382
  )
383
383
 
384
- (root / "multitool-info.json").write_text("""{
384
+ (root / f"{APP}-info.json").write_text("""{
385
385
  "Homepage": "",
386
- "Requires": "",
386
+ "Requires": "click",
387
387
  "Maintainer": "",
388
388
  "Description-en": ""
389
389
  }
@@ -403,9 +403,9 @@ def hello(
403
403
  console.echo(f" {module}.py")
404
404
  console.echo()
405
405
  console.echo(" • To use this plugin locally:")
406
- console.echo(" Copy the plugin directory into another Multitool")
406
+ console.echo(f" Copy the plugin directory into another {APP}")
407
407
  console.echo(" plugins directory:")
408
- console.echo(" ~/.multitool/plugins/")
408
+ console.echo(f" ~/.{APP}/plugins/")
409
409
  console.echo()
410
410
  console.echo(" • To distribute this plugin:")
411
411
  console.echo(" 1. Initialize a Git repository.")
@@ -8,8 +8,10 @@ from pathlib import Path
8
8
 
9
9
  import click
10
10
 
11
+ from multitool import APP
11
12
 
12
- def configure_logger(log_file):
13
+
14
+ def configure_root_logger(log_file):
13
15
  touch(log_file)
14
16
  remove_if_large(log_file, size_kb=1000)
15
17
  logging.basicConfig(
@@ -98,9 +100,9 @@ Plugin command names must be unique across all installed repositories.
98
100
  To resolve this:
99
101
  1. Delete one of the conflicting plugin repositories.
100
102
  2. If the repository was installed from a remote source, remove or comment
101
- out its entry in ~/.multitool/plugins/config (or run
102
- `multitool plugins configure`) before running
103
- `multitool plugins update` again, otherwise it will be reinstalled.
103
+ out its entry in ~/.{APP}/plugins/config (or run
104
+ `{APP} plugins configure`) before running
105
+ `{APP} plugins update` again, otherwise it will be reinstalled.
104
106
  3. Run the command again.
105
107
  4. If another duplicate plugin error appears, repeat these steps until no
106
108
  duplicate plugin command errors remain.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: multitool
3
- Version: 0.7.0
3
+ Version: 0.7.2
4
4
  Summary: Create and run plugin-based command-line tools.
5
5
  Author-email: Matthew Delotavo <matthew.t.delotavo@gmail.com>
6
6
  License-Expression: MIT
@@ -26,9 +26,9 @@ multitool
26
26
 
27
27
  Create and run plugin-based command-line tools.
28
28
 
29
- -----
30
- TL;DR
31
- -----
29
+ ----------
30
+ Quickstart
31
+ ----------
32
32
 
33
33
  This section shows how to start prototyping plugins on your local machine.
34
34
  See the sections below to learn how to distribute your commands as remote
@@ -155,7 +155,7 @@ don't want changes applied automatically.
155
155
  Example configuration::
156
156
 
157
157
  [sources]
158
- public = https://github.com/mdelotavo/multitool-plugins.git
158
+ mdelotavo-multitool-plugins = https://github.com/mdelotavo/multitool-plugins.git
159
159
 
160
160
  After saving, Multitool clones each configured repository into::
161
161
 
@@ -164,19 +164,19 @@ After saving, Multitool clones each configured repository into::
164
164
  You can configure multiple repositories as long as each key is unique.
165
165
 
166
166
  ^^^^^^^^^^
167
- Quickstart
167
+ Installing
168
168
  ^^^^^^^^^^
169
169
 
170
170
  Install the example plugins::
171
171
 
172
- echo -e '[sources]\npublic = https://github.com/mdelotavo/multitool-plugins.git' >> ~/.multitool/plugins/config
172
+ echo -e '[sources]\nmdelotavo-multitool-plugins = https://github.com/mdelotavo/multitool-plugins.git' >> ~/.multitool/plugins/config
173
173
 
174
174
  multitool plugins update
175
175
  multitool plugins show
176
- multitool plugins show -n public
177
- multitool plugins show -n public --show-commit-only
178
- multitool plugins show -n public --show-dependencies-only
179
- pip3 install $(multitool plugins show -n public --show-dependencies-only)
176
+ multitool plugins show -n mdelotavo-multitool-plugins
177
+ multitool plugins show -n mdelotavo-multitool-plugins --show-commit-only
178
+ multitool plugins show -n mdelotavo-multitool-plugins --show-dependencies-only
179
+ pip3 install $(multitool plugins show -n mdelotavo-multitool-plugins --show-dependencies-only)
180
180
 
181
181
  multitool run examples -h
182
182
 
@@ -236,41 +236,19 @@ including the repository owner and repository name in the command name.
236
236
  For example, a repository configured as::
237
237
 
238
238
  [sources]
239
- public = https://github.com/mdelotavo/multitool-plugins.git
239
+ mdelotavo-multitool-plugins = https://github.com/mdelotavo/multitool-plugins.git
240
240
 
241
241
  should expose commands using a unique name such as::
242
242
 
243
243
  mdelotavo-multitool-plugins
244
244
 
245
- This prevents duplicate command names when multiple repositories provide
246
- plugins with the same module name. If two plugins expose commands with the
247
- same name, only one can be loaded and the duplicate plugin will be skipped.
248
-
249
- If two repositories expose the same command name, Multitool will fail to load
250
- the duplicate plugin and raise an error similar to::
251
-
252
- Duplicate plugin command "examples" found in
253
- /home/user/.multitool/plugins/PLUGIN_NAME/__init__.py.
254
- Already loaded from plugins_modules.examples
255
-
256
- To resolve the issue, remove the conflicting plugin repository from your local
257
- plugins directory::
258
-
259
- ~/.multitool/plugins/PLUGIN_NAME/
260
-
261
- and remove the repository from the configured sources.
262
-
263
- You can edit the configuration file manually::
264
-
265
- ~/.multitool/plugins/config
245
+ This reduces the likelihood of collisions when multiple repositories expose
246
+ plugins with the same command name.
266
247
 
267
- or open it using::
268
-
269
- multitool plugins configure
270
-
271
- After removing the conflicting repository, update the installed plugins::
272
-
273
- multitool plugins update
248
+ If duplicate command names are detected, Multitool will display an error
249
+ prompting you to delete the detected conflicting plugin repositories and, if
250
+ applicable, remove the corresponding remote sources from your plugin
251
+ configuration.
274
252
 
275
253
 
276
254
  .. _`click`: https://click.palletsprojects.com/
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "multitool"
7
- version = "0.7.0"
7
+ version = "0.7.2"
8
8
  description = "Create and run plugin-based command-line tools."
9
9
  readme = { file = "README.rst", content-type = "text/x-rst" }
10
10
  requires-python = ">=3.7"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes