GithubHelp home page GithubHelp logo

igrek51 / nuclear Goto Github PK

View Code? Open in Web Editor NEW
12.0 3.0 1.0 2.54 MB

Binding glue for CLI Python applications

Home Page: https://igrek51.github.io/nuclear/

License: MIT License

Python 99.35% Makefile 0.65%
cli parser python command-line arguments argparse

nuclear's People

Contributors

dependabot[bot] avatar igrek51 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

anarcypher

nuclear's Issues

support bound methods

when a bound method is given for run argument, the following traceback appears

[2021-09-19 20:51:57] [WARN ] can't inject argument 'self' to function 'cd': name not found
Traceback (most recent call last):
  File "/src/shell/xsh/xonsh/procs/proxies.py", line 523, in run
    r = self.f(self.args, sp_stdin, sp_stdout, sp_stderr, spec, spec.stack)
        │      │          │         │          │          │     └ SubprocSpec(['commands'], ProcProxyThread, stdin=None, stdout=<_io.TextIOWrapper name=7 mode='w' encoding='UTF-8'>, stderr=<_io....
        │      │          │         │          │          └ SubprocSpec(['commands'], ProcProxyThread, stdin=None, stdout=<_io.TextIOWrapper name=7 mode='w' encoding='UTF-8'>, stderr=<_io....
        │      │          │         │          └ <_io.TextIOWrapper name=9 encoding='utf-8'>
        │      │          │         └ <_io.TextIOWrapper name=7 encoding='utf-8'>
        │      │          └ None
        │      └ <ProcProxyThread(Thread-27, started 140108367373888)>
        └ <ProcProxyThread(Thread-27, started 140108367373888)>
  File "/src/shell/xontribs/commands/xontrib/commands/dev_cmd.py", line 212, in __call__
    self.build.run_with_args(args)
    │                        └ ['commands']
    └ <xontrib.commands.dev_cmd.Alias object at 0x7f6d954af1c0>
  File "/home/noor/.virtualenvs/user-xsh-rVZlQJi1-py3.9/lib/python3.9/site-packages/nuclear/builder/builder.py", line 84, in run_with_args
    parser.parse_args(args)
    │                 └ ['commands']
    └ <nuclear.parser.parser.Parser object at 0x7f6d846ea1f0>
  File "/home/noor/.virtualenvs/user-xsh-rVZlQJi1-py3.9/lib/python3.9/site-packages/nuclear/parser/parser.py", line 88, in parse_args
    run_action(run_context.action, run_context.internal_vars)
    │          │                   └ RunContext(args_container=<nuclear.args.container.ArgsContainer object at 0x7f6d846ea2b0>, action=<bound method Alias.cd of <xon...
    │          └ RunContext(args_container=<nuclear.args.container.ArgsContainer object at 0x7f6d846ea2b0>, action=<bound method Alias.cd of <xon...
    └ <function run_action at 0x7f6d84595280>
  File "/home/noor/.virtualenvs/user-xsh-rVZlQJi1-py3.9/lib/python3.9/site-packages/nuclear/parser/inject.py", line 17, in run_action
    action(**kwargs)
    │        └ {'self': None, 'name': 'commands'}
    └ <bound method Alias.cd of <xontrib.commands.dev_cmd.Alias object at 0x7f6d954af1c0>>
TypeError: cd() got multiple values for argument 'self'

As of now, I am using static_method decorator. Is it possible to pass instance methods?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.