Changeset f1e708
- Timestamp:
- 11/03/2015 07:43:29 PM (10 years ago)
- Branches:
- 2.0.x, develop, master
- Children:
- 05ab06
- Parents:
- f500d7
- git-author:
- Calum Lind <calumlind+deluge@gmail.com> (11/03/2015 07:29:50 PM)
- git-committer:
- Calum Lind <calumlind+deluge@gmail.com> (11/03/2015 07:43:29 PM)
- Location:
- deluge/ui
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
deluge/ui/console/commands/info.py
rf500d7 rf1e708 169 169 170 170 prevpath = [] 171 for i ,_file in enumerate(status["files"]):172 filename = _file["path"].split(dirsep)[-1]173 filepath = _file["path"].split(dirsep)[:-1]171 for index, torrent_file in enumerate(status["files"]): 172 filename = torrent_file["path"].split(dirsep)[-1] 173 filepath = torrent_file["path"].split(dirsep)[:-1] 174 174 175 175 for depth, subdir in enumerate(filepath): … … 185 185 186 186 col_filename = indent + filename 187 col_size = " ({!cyan!}%s{!input!})" % common.fsize( file["size"])188 col_progress = " {!input!}%.2f%%" % (status["file_progress"][i ] * 100)187 col_size = " ({!cyan!}%s{!input!})" % common.fsize(torrent_file["size"]) 188 col_progress = " {!input!}%.2f%%" % (status["file_progress"][index] * 100) 189 189 190 190 col_priority = " {!info!}Priority: " 191 191 192 f p = common.FILE_PRIORITY[status["file_priorities"][i]].replace("Priority", "")193 if status["file_progress"][i ] != 1.0:194 if f p== "Do Not Download":192 file_priority = common.FILE_PRIORITY[status["file_priorities"][index]].replace("Priority", "") 193 if status["file_progress"][index] != 1.0: 194 if file_priority == "Do Not Download": 195 195 col_priority += "{!error!}" 196 196 else: … … 198 198 else: 199 199 col_priority += "{!input!}" 200 col_priority += f p200 col_priority += file_priority 201 201 202 202 def tlen(string): -
deluge/ui/gtkui/files_tab.py
rf500d7 rf1e708 344 344 345 345 # The following 3 methods create the folder/file view in the treeview 346 def prepare_file_store(self, files):346 def prepare_file_store(self, torrent_files): 347 347 split_files = {} 348 i = 0 349 for _file in files: 350 self.prepare_file(_file, _file["path"], i, split_files) 351 i += 1 348 for index, torrent_file in enumerate(torrent_files): 349 self.prepare_file(torrent_file, torrent_file["path"], index, split_files) 352 350 self.add_files(None, split_files) 353 351 354 def prepare_file(self, _file, file_name, file_num, files_storage):352 def prepare_file(self, torrent_file, file_name, file_num, files_storage): 355 353 first_slash_index = file_name.find("/") 356 354 if first_slash_index == -1: 357 files_storage[file_name] = (file_num, _file)355 files_storage[file_name] = (file_num, torrent_file) 358 356 else: 359 357 file_name_chunk = file_name[:first_slash_index + 1] 360 358 if file_name_chunk not in files_storage: 361 359 files_storage[file_name_chunk] = {} 362 self.prepare_file( file, file_name[first_slash_index + 1:],360 self.prepare_file(torrent_file, file_name[first_slash_index + 1:], 363 361 file_num, files_storage[file_name_chunk]) 364 362 365 363 def add_files(self, parent_iter, split_files): 366 ret= 0364 chunk_size_total = 0 367 365 for key, value in split_files.iteritems(): 368 366 if key.endswith("/"): … … 371 369 chunk_size = self.add_files(chunk_iter, value) 372 370 self.treestore.set(chunk_iter, 1, chunk_size) 373 ret+= chunk_size371 chunk_size_total += chunk_size 374 372 else: 375 self.treestore.append(parent_iter, [key,376 377 ret+= value[1]["size"]378 return ret373 self.treestore.append(parent_iter, 374 [key, value[1]["size"], "", 0, 0, value[0], gtk.STOCK_FILE]) 375 chunk_size_total += value[1]["size"] 376 return chunk_size_total 379 377 380 378 def update_files(self):
Note:
See TracChangeset
for help on using the changeset viewer.