main.py 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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 main(progname):
  33. try: import termios
  34. except: eval("launch_"+progname+"()") # Windows
  35. else:
  36. import sys
  37. fd = sys.stdin.fileno()
  38. old = termios.tcgetattr(fd)
  39. try: eval("launch_"+progname+"()")
  40. except KeyboardInterrupt:
  41. sys.stderr.write("\nUser interrupt\n")
  42. termios.tcsetattr(fd, termios.TCSADRAIN, old)
  43. sys.exit(1)
  44. except EOFError:
  45. sys.stderr.write("\nEnd of file\n")
  46. termios.tcsetattr(fd, termios.TCSADRAIN, old)
  47. sys.exit(1)