MCPcopy Index your code
hub / github.com/pyload/pyload / _setup

Method _setup

module/plugins/internal/Base.py:136–168  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

134 pass
135
136 def _setup(self):
137 #@TODO: Remove in 0.4.10
138 self.pyfile.error = ""
139 self.data = ""
140 self.last_html = ""
141 self.last_header = {}
142
143 if self.config.get('use_premium', True):
144 self.load_account() # @TODO: Move to PluginThread in 0.4.10
145 else:
146 self.account = False
147 self.user = None # @TODO: Remove in 0.4.10
148
149 try:
150 self.req.close()
151 except Exception:
152 pass
153
154 if self.account:
155 self.req = self.pyload.requestFactory.getRequest(
156 self.classname, self.account.user)
157 # @NOTE: Avoid one unnecessary get_info call by `self.account.premium` here
158 self.premium = self.account.info['data']['premium']
159 else:
160 self.req = self.pyload.requestFactory.getRequest(self.classname)
161 self.premium = False
162
163 self.req.setOption("timeout", 60) # @TODO: Remove in 0.4.10
164
165 self.setup_base()
166 self.grab_info()
167 self.setup()
168 self.check_status()
169
170 def load_account(self):
171 if not self.account:

Callers 2

_processMethod · 0.95
_processMethod · 0.45

Calls 9

load_accountMethod · 0.95
setup_baseMethod · 0.95
grab_infoMethod · 0.95
setupMethod · 0.95
check_statusMethod · 0.95
getRequestMethod · 0.80
setOptionMethod · 0.80
getMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected