MCPcopy
hub / github.com/pyload/pyload / __init__

Method __init__

pyLoadCore.py:81–154  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

79 """pyLoad Core, one tool to rule them all... (the filehosters) :D"""
80
81 def __init__(self):
82 self.doDebug = False
83 self.startedInGui = False
84 self.running = False
85 self.daemon = False
86 self.remote = True
87 self.arg_links = []
88 self.pidfile = "pyload.pid"
89 self.deleteLinks = False # will delete links on startup
90
91 if len(argv) > 1:
92 try:
93 options, args = getopt(argv[1:], 'vchdusqp:',
94 ["version", "clear", "clean", "help", "debug", "user",
95 "setup", "configdir=", "changedir", "daemon",
96 "quit", "status", "no-remote","pidfile="])
97
98 for option, argument in options:
99 if option in ("-v", "--version"):
100 print "pyLoad", CURRENT_VERSION
101 exit()
102 elif option in ("-p", "--pidfile"):
103 self.pidfile = argument
104 elif option == "--daemon":
105 self.daemon = True
106 elif option in ("-c", "--clear"):
107 self.deleteLinks = True
108 elif option in ("-h", "--help"):
109 self.print_help()
110 exit()
111 elif option in ("-d", "--debug"):
112 self.doDebug = True
113 elif option in ("-u", "--user"):
114 from module.setup import Setup
115
116 self.config = ConfigParser()
117 s = Setup(pypath, self.config)
118 s.set_user()
119 exit()
120 elif option in ("-s", "--setup"):
121 from module.setup import Setup
122
123 self.config = ConfigParser()
124 s = Setup(pypath, self.config)
125 s.start()
126 exit()
127 elif option == "--changedir":
128 from module.setup import Setup
129
130 self.config = ConfigParser()
131 s = Setup(pypath, self.config)
132 s.conf_path(True)
133 exit()
134 elif option in ("-q", "--quit"):
135 self.quitInstance()
136 exit()
137 elif option == "--status":
138 pid = self.isAlreadyRunning()

Callers

nothing calls this directly

Calls 10

print_helpMethod · 0.95
set_userMethod · 0.95
startMethod · 0.95
conf_pathMethod · 0.95
quitInstanceMethod · 0.95
isAlreadyRunningMethod · 0.95
cleanTreeMethod · 0.95
ConfigParserClass · 0.90
SetupClass · 0.90
joinMethod · 0.80

Tested by

no test coverage detected