Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit50c23c1

Browse files
committed
chore: annotate scripts bind_main_func
Signed-off-by: Brian Harring <ferringb@gmail.com>
1 parent73b5608 commit50c23c1

File tree

4 files changed

+43
-13
lines changed

4 files changed

+43
-13
lines changed

‎src/pkgcore/scripts/pclean.py‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
fromfunctoolsimportpartial
1313
fromitertoolsimportchain
1414

15+
importsnakeoil.formatters
1516
fromsnakeoil.mappingsimportDictMixin
1617
fromsnakeoil.osutilsimportlistdir_dirs,listdir_files,pjoin
1718
fromsnakeoil.sequencesimportiflatten_instance,split_negations
@@ -301,7 +302,7 @@ def items(self):
301302

302303

303304
@config.bind_main_func
304-
defconfig_main(options,out,err):
305+
defconfig_main(options,out:snakeoil.formatters.PlainTextFormatter,_err):
305306
domain=options.domain
306307
installed_repos=domain.all_installed_repos
307308
all_repos_raw=domain.all_repos_raw
@@ -685,7 +686,11 @@ def _remove_dir_and_empty_parent(d):
685686
@dist.bind_main_func
686687
@pkg.bind_main_func
687688
@tmp.bind_main_func
688-
def_remove(options,out,err):
689+
def_remove(
690+
options,
691+
out:snakeoil.formatters.PlainTextFormatter,
692+
err:snakeoil.formatters.PlainTextFormatter,
693+
):
689694
"""Generic removal runner."""
690695
ret=0
691696
ifsys.stdout.isatty():

‎src/pkgcore/scripts/pconfig.py‎

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
importtraceback
55
fromfunctoolsimportpartial
66

7+
importsnakeoil.formatters
78
fromsnakeoil.errorsimportdump_error
89
fromsnakeoil.python_namespacesimportPythonNamespaceWalker
910

@@ -128,7 +129,11 @@ def get_classes(configs):
128129

129130

130131
@classes.bind_main_func
131-
defclasses_main(options,out,err):
132+
defclasses_main(
133+
options,
134+
out:snakeoil.formatters.PlainTextFormatter,
135+
_err:snakeoil.formatters.PlainTextFormatter,
136+
):
132137
"""List all classes referenced by the config."""
133138
configmanager=options.config
134139
sections= []
@@ -157,7 +162,11 @@ def classes_main(options, out, err):
157162

158163

159164
@describe_class.bind_main_func
160-
defdescribe_class_main(options,out,err):
165+
defdescribe_class_main(
166+
options,
167+
out:snakeoil.formatters.PlainTextFormatter,
168+
err:snakeoil.formatters.PlainTextFormatter,
169+
):
161170
"""Describe the arguments a class needs."""
162171
try:
163172
type_obj=basics.ConfigType(options.target_class)
@@ -194,7 +203,7 @@ def write_type(out, type_obj):
194203

195204

196205
@uncollapsable.bind_main_func
197-
defuncollapsable_main(options,out,err):
206+
defuncollapsable_main(options,out:snakeoil.formatters.PlainTextFormatter,_err):
198207
"""Show things that could not be collapsed."""
199208
config=options.config
200209
fornameinsorted(config.sections()):
@@ -233,7 +242,7 @@ def uncollapsable_main(options, out, err):
233242

234243

235244
@dump.bind_main_func
236-
defdump_main(options,out,err):
245+
defdump_main(options,out:snakeoil.formatters.PlainTextFormatter,_err):
237246
"""Dump the entire configuration."""
238247
config=options.config
239248
ifoptions.typenameisNone:
@@ -293,7 +302,7 @@ def _default_module_blacklister(self, target):
293302

294303

295304
@configurables.bind_main_func
296-
defconfigurables_main(options,out,err):
305+
defconfigurables_main(options,out:snakeoil.formatters.PlainTextFormatter,_err):
297306
"""List registered configurables."""
298307

299308
# try and sort this beast.
@@ -366,7 +375,11 @@ def _dump_uncollapsed_section(config, out, err, section):
366375

367376

368377
@dump_uncollapsed.bind_main_func
369-
defdump_uncollapsed_main(options,out,err):
378+
defdump_uncollapsed_main(
379+
options,
380+
out:snakeoil.formatters.PlainTextFormatter,
381+
err:snakeoil.formatters.PlainTextFormatter,
382+
):
370383
"""dump the configuration in a raw, uncollapsed form.
371384
Not directly usable as a configuration file, mainly used for inspection
372385
"""
@@ -410,7 +423,11 @@ def dump_uncollapsed_main(options, out, err):
410423

411424

412425
@package.bind_main_func
413-
defpackage_func(options,out,err):
426+
defpackage_func(
427+
options,
428+
out:snakeoil.formatters.PlainTextFormatter,
429+
_err:snakeoil.formatters.PlainTextFormatter,
430+
):
414431
matched=True
415432
domain=options.domain
416433
forpkgindomain.installed_repos.combined.itermatch(options.query):
@@ -468,7 +485,11 @@ def package_func(options, out, err):
468485

469486

470487
@world.bind_main_func
471-
defworld_func(options,out,err):
488+
defworld_func(
489+
options,
490+
out:snakeoil.formatters.PlainTextFormatter,
491+
_err:snakeoil.formatters.PlainTextFormatter,
492+
):
472493
world_file=options.world
473494

474495
ifoptions.remove:

‎src/pkgcore/scripts/pinspect.py‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
fromitertoolsimportgroupby,islice
2020
fromoperatorimportattrgetter,itemgetter
2121

22+
importsnakeoil.formatters
2223
fromsnakeoil.cliimportarghparse
2324
fromsnakeoil.sequencesimportiflatten_instance,unstable_unique
2425

@@ -54,7 +55,7 @@
5455

5556

5657
@pkgsets.bind_main_func
57-
defpkgsets_run(opts,out,err):
58+
defpkgsets_run(opts,out:snakeoil.formatters.PlainTextFormatter,_err):
5859
ifnotopts.pkgsets:
5960
ifnotopts.all:
6061
out.write(
@@ -427,7 +428,7 @@ def _bad_digest(pkg):
427428

428429

429430
@digests.bind_main_func
430-
defdigest_manifest(options,out,err):
431+
defdigest_manifest(options,out:snakeoil.formatters.PlainTextFormatter,_err):
431432
forname,repoinoptions.repos:
432433
count=0
433434
broken= []

‎src/pkgcore/scripts/pquery.py‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
importtyping
2020
fromfunctoolsimportpartial
2121

22+
importsnakeoil.formatters
2223
fromsnakeoil.cliimportarghparse
2324
fromsnakeoil.formattersimportdecorate_forced_wrapping
2425
fromsnakeoil.osutilsimportsizeof_fmt
@@ -1230,7 +1231,9 @@ def process_attrs(sequence):
12301231

12311232

12321233
@argparser.bind_main_func
1233-
defmain(options,out,err):
1234+
defmain(
1235+
options,out:snakeoil.formatters.Formatter,err:snakeoil.formatters.Formatter
1236+
):
12341237
"""Run a query."""
12351238
ifoptions.debug:
12361239
forrepoinoptions.repos:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp