update readme add support for params
This commit is contained in:
parent
acbb8a0ff2
commit
a3af423550
10
README.md
10
README.md
|
@ -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/`
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in New Issue