1
0

fluazu.py 3.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. #!/usr/bin/env python
  2. ################################################################################
  3. # $Id: fluazu.py 2548 2007-02-08 14:18:17Z b4rt $
  4. # $Date: 2007-02-08 08:18:17 -0600 (Thu, 08 Feb 2007) $
  5. # $Revision: 2548 $
  6. ################################################################################
  7. # #
  8. # LICENSE #
  9. # #
  10. # This program is free software; you can redistribute it and/or #
  11. # modify it under the terms of the GNU General Public License (GPL) #
  12. # as published by the Free Software Foundation; either version 2 #
  13. # of the License, or (at your option) any later version. #
  14. # #
  15. # This program is distributed in the hope that it will be useful, #
  16. # but WITHOUT ANY WARRANTY; without even the implied warranty of #
  17. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
  18. # GNU General Public License for more details. #
  19. # #
  20. # To read the license please visit http://www.gnu.org/copyleft/gpl.html #
  21. # #
  22. # #
  23. ################################################################################
  24. # #
  25. # Requirements : #
  26. # * DOPAL #
  27. # http://dopal.sourceforge.net #
  28. # * Azureus with XML/HTTP Plugin #
  29. # http://azureus.sourceforge.net #
  30. # http://azureus.sourceforge.net/plugin_details.php?plugin=xml_http_if) #
  31. # #
  32. ################################################################################
  33. # standard-imports
  34. import sys
  35. # fluazu
  36. from fluazu.FluAzuD import FluAzuD
  37. ################################################################################
  38. """ ------------------------------------------------------------------------ """
  39. """ main """
  40. """ ------------------------------------------------------------------------ """
  41. if __name__ == '__main__':
  42. # version
  43. if sys.argv[1:] == ['--version']:
  44. from fluazu import __version_str__
  45. print __version_str__
  46. sys.exit(0)
  47. # check argv-length
  48. if len(sys.argv) < 7:
  49. from fluazu import __version_str__
  50. print "fluazu %s" % __version_str__
  51. print "\nError: missing arguments.\n"
  52. print "Usage:"
  53. print "fluazu.py path host port secure username password\n"
  54. print " path : flux-path"
  55. print " host : host of azureus-server"
  56. print " port : port of azureus-server (xml/http, default: 6884)"
  57. print " secure : use secure connection to azureus (0/1)"
  58. print " username : username to use when connecting to azureus-server"
  59. print " password : password to use when connecting to azureus-server\n"
  60. sys.exit(0)
  61. # run daemon
  62. daemon = FluAzuD()
  63. exitVal = 0
  64. try:
  65. exitVal = daemon.run(sys.argv[1], sys.argv[2], sys.argv[3], sys.argv[4], sys.argv[5], sys.argv[6])
  66. except KeyboardInterrupt:
  67. daemon.shutdown()
  68. exitVal = 0
  69. except Exception, e:
  70. print e
  71. # exit
  72. sys.exit(exitVal)