kwattr 2.0
decorator: make keywords arguments of bool values from function attributes
script:
from kwattr import kwattr
@kwattr.wait.chdir.min.max.hide
def run(*args, **kwargs):
return args, kwargs
@kwattr.all.dirs
def scan(arg, idir=False, ifile=True, all=False, dirs=False):
return arg, idir, ifile, all, dirs
print run.wait('sample.exe')
print run('sample.exe')
print run.wait.chdir('sample.exe')
out:
(('sample.exe',), {'max': False, 'chdir': False, 'hide': False, 'min': False, 'wait': True})
(('sample.exe',), {'max': False, 'chdir': False, 'hide': False, 'wait': False, 'min': False})
(('sample.exe',), {'max': False, 'chdir': True, 'hide': False, 'min': False, 'wait': True})
| File | Type | Py Version | Uploaded on | Size | # downloads |
|---|---|---|---|---|---|
| kwattr-2.0.zip (md5) | Source | 2011-08-01 | 2KB | 228 | |
- Author: Ivan Bykov
- License: Python license
- Platform: python 2.7
- Categories
- Package Index Owner: ivb
- DOAP record: kwattr-2.0.xml
