update readme add support for params

This commit is contained in:
*****DEAD ACCOUNT 2020-12-06 06:41:32 -05:00
parent acbb8a0ff2
commit a3af423550
No known key found for this signature in database
GPG Key ID: 7AF3499CBA8E6251
2 changed files with 12 additions and 6 deletions

View File

@ -49,10 +49,18 @@ config:
### Creating a new circuit
```
python -m torctl.torctl new-circuit
python -m torctl new-circuit
result: 33
```
### Creating a new identity
```
python -m torctl signal newnym
result: None
```
# Installing
- For `python3` `python setup.py install --user` installs to `~/.local/`

View File

@ -25,15 +25,15 @@ class tor_controller():
self.conf = Y.load(open("{}/.torctlrc".format(O.path.expanduser("~") ) ), Loader = Y.FullLoader).get('config')
self.controller = C.from_port(port = self.conf.get("port") )
self.controller = C.from_port(address = self.conf.get("host"), port = self.conf.get("port") )
self.controller.authenticate(self.conf.get("password") )
try:
meth_or_prop = getattr(self.controller, [ x for x in dir(self.controller)
if not x.startswith("_") and x == args[1].replace("-", "_") ][0] )
if not x.startswith("_") and x == args[1].replace("-", "_") ][ 0 ] )
if self.is_func_or_meth(meth_or_prop):
print("result: {}".format(meth_or_prop() ) )
print("result: {}".format(meth_or_prop(*args[ 2: ]) ) )
else:
print("{}".format(meth_or_prop))
@ -57,7 +57,5 @@ class tor_controller():
for x in dir(self.controller)
if not x.startswith("_")] ) ) )
#if __name__ == "__main__":
# print("hi")
tor_controller(S.argv)