main.py 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #!/usr/bin/env python
  2. #
  3. # mmgen = Multi-Mode GENerator, command-line Bitcoin cold storage solution
  4. # Copyright (C)2013-2014 Philemon <mmgen-py@yandex.com>
  5. #
  6. # This program is free software: you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation, either version 3 of the License, or
  9. # (at your option) any later version.
  10. #
  11. # This program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. # GNU General Public License for more details.
  15. #
  16. # You should have received a copy of the GNU General Public License
  17. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  18. """
  19. main.py - Script launcher for the MMGen suite
  20. """
  21. def launch_addrgen(): import mmgen.main_addrgen
  22. def launch_addrimport(): import mmgen.main_addrimport
  23. def launch_keygen(): import mmgen.main_addrgen
  24. def launch_passchg(): import mmgen.main_passchg
  25. def launch_pywallet(): import mmgen.main_pywallet
  26. def launch_tool(): import mmgen.main_tool
  27. def launch_txcreate(): import mmgen.main_txcreate
  28. def launch_txsend(): import mmgen.main_txsend
  29. def launch_txsign(): import mmgen.main_txsign
  30. def launch_walletchk(): import mmgen.main_walletchk
  31. def launch_walletgen(): import mmgen.main_walletgen
  32. def launch(what):
  33. try: import termios
  34. except: globals()["launch_"+what]() # Windows
  35. else:
  36. import sys,atexit
  37. fd = sys.stdin.fileno()
  38. old = termios.tcgetattr(fd)
  39. def at_exit():
  40. termios.tcsetattr(fd, termios.TCSADRAIN, old)
  41. atexit.register(at_exit)
  42. try: globals()["launch_"+what]()
  43. except KeyboardInterrupt:
  44. sys.stderr.write("\nUser interrupt\n")
  45. except EOFError:
  46. sys.stderr.write("\nEnd of file\n")