aboutsummaryrefslogtreecommitdiffstats
path: root/hiveinit.py
diff options
context:
space:
mode:
authorterminaldweller <thabogre@gmail.com>2021-05-14 18:14:50 +0000
committerterminaldweller <thabogre@gmail.com>2021-05-14 18:14:50 +0000
commit6e528248414e330c9e25e81596ab47b8b8a5b701 (patch)
treee1aa41a7f3198eeac187e6177ec7d4a33db229d3 /hiveinit.py
downloadscripts-6e528248414e330c9e25e81596ab47b8b8a5b701.tar.gz
scripts-6e528248414e330c9e25e81596ab47b8b8a5b701.zip
first commitmaster
Diffstat (limited to 'hiveinit.py')
-rwxr-xr-xhiveinit.py60
1 files changed, 60 insertions, 0 deletions
diff --git a/hiveinit.py b/hiveinit.py
new file mode 100755
index 0000000..63b4772
--- /dev/null
+++ b/hiveinit.py
@@ -0,0 +1,60 @@
+#!/usr/bin/python3
+
+import argparse
+import code
+import readline
+import signal
+import sys
+import imp
+hived = imp.load_source("hived", "./hived")
+from hived import Demon
+
+def SigHandler_SIGINT(signum, frame):
+ print()
+ sys.exit(0)
+
+class Argparser(object):
+ def __init__(self):
+ self.parser = argparse.ArgumentParser()
+ self.parser.add_argument("--name", type=str, help="price of the chose crypto")
+ self.parser.add_argument("--worth", type=str, help="single asset worth")
+ self.parser.add_argument("--xx", type=str, nargs=2, help="convert")
+ self.parser.add_argument("--xxv", type=float, help="xx multiplier")
+ self.parser.add_argument("--gen", type=str, nargs=2, help="general option")
+ self.parser.add_argument("--cap", type=str, help="market cap")
+ self.parser.add_argument("--rank", type=str, help="market cap rank")
+ self.parser.add_argument("--total", action="store_true", help="total", default=False)
+ self.parser.add_argument("--ava", type=str, help="is currency available on changelly")
+ self.parser.add_argument("--avass", type=str, help="is currency available on shapeshift")
+ self.parser.add_argument("--cglistall", action="store_true", help="list all currencies available on changelly", default=False)
+ self.parser.add_argument("--test", action="store_true", help="test switch", default=False)
+ self.parser.add_argument("--watchlist", type=str, nargs="+", help="watch list")
+ self.parser.add_argument("--ss", type=str, nargs="+", help="watchlist on shapeshift")
+ self.parser.add_argument("--dy", type=int, help="lazy")
+ self.parser.add_argument("--demon", action="store_true", help="daemon mode", default=False)
+ self.parser.add_argument("--al1", action="store_true", help="alert1", default=False)
+ self.parser.add_argument("--dbg", action="store_true", help="debug", default=False)
+ self.parser.add_argument("--alive", action="store_true", help="is hived up", default=False)
+ self.parser.add_argument("--tg", action="store_true", help="tg", default=False)
+
+ def parse(self, argv):
+ self.args, self.rest = self.parser.parse_known_args(argv)
+
+def main():
+ argparser = Argparser()
+ sys.argv.pop(0)
+ argparser.parse(sys.argv)
+ if argparser.args.dbg:
+ try:
+ premain(argparser)
+ except:
+ variables = globals().copy()
+ variables.update(locals())
+ shell = code.InteractiveConsole(variables)
+ shell.interact(banner="DEBUG REPL")
+ else:
+ demon = Demon()
+ demon.run(argparser)
+
+if __name__ == "__main__":
+ main()