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

Method renderHeader

pyLoadCli.py:154–199  ·  view source on GitHub ↗

prints download status

(self, line)

Source from the content-addressed store, hash-verified

152 self.input = ""
153
154 def renderHeader(self, line):
155 """ prints download status """
156 #print updated information
157 # print "\033[J" #clear screen
158 # self.println(1, blue("py") + yellow("Load") + white(_(" Command Line Interface")))
159 # self.println(2, "")
160 # self.println(3, white(_("%s Downloads:") % (len(data))))
161
162 data = self.client.statusDownloads()
163 speed = 0
164
165 println(line, white(_("%s Downloads:") % (len(data))))
166 line += 1
167
168 for download in data:
169 if download.status == 12: # downloading
170 percent = download.percent
171 z = percent / 4
172 speed += download.speed
173 println(line, cyan(download.name))
174 line += 1
175 println(line,
176 blue("[") + yellow(z * "#" + (25 - z) * " ") + blue("] ") + green(str(percent) + "%") + _(
177 " Speed: ") + green(formatSize(download.speed) + "/s") + _(" Size: ") + green(
178 download.format_size) + _(" Finished in: ") + green(download.format_eta) + _(
179 " ID: ") + green(download.fid))
180 line += 1
181 if download.status == 5:
182 println(line, cyan(download.name))
183 line += 1
184 println(line, _("waiting: ") + green(download.format_wait))
185 line += 1
186
187 println(line, "")
188 line += 1
189 status = self.client.statusServer()
190 if status.pause:
191 paused = _("Status:") + " " + red(_("paused"))
192 else:
193 paused = _("Status:") + " " + red(_("running"))
194
195 println(line,"%s %s: %s %s: %s %s: %s" % (
196 paused, _("total Speed"), red(formatSize(speed) + "/s"), _("Files in queue"), red(
197 status.queue), _("Total"), red(status.total)))
198
199 return line + 1
200
201 def renderBody(self, line):
202 """ prints initial menu """

Callers 1

refreshMethod · 0.80

Calls 11

formatSizeFunction · 0.90
printlnFunction · 0.85
whiteFunction · 0.85
cyanFunction · 0.85
blueFunction · 0.85
yellowFunction · 0.85
greenFunction · 0.85
redFunction · 0.85
_Function · 0.50
statusDownloadsMethod · 0.45
statusServerMethod · 0.45

Tested by

no test coverage detected