Added comments for the functions
This commit is contained in:
10
qlist.py
10
qlist.py
@@ -1,6 +1,10 @@
|
||||
#The second file shall contain functions to build out a list of torrents.
|
||||
def buildtorlist(self):
|
||||
"""builds multiple lists of torrents to be sorted."""
|
||||
"""Builds multiple lists of torrents to be sorted. Also adds tags to the torents.
|
||||
There are more effecient ways of doing things but I did this rather quickly.
|
||||
V2 will certainly be more performant. The reason two lists were used was so that torrents
|
||||
that are in public trackers woudln't be around as long as torrents from a private tracker.
|
||||
"""
|
||||
self.protected_count = 0
|
||||
self.nonprotected_count = 0
|
||||
while self.torrentlist:
|
||||
@@ -37,6 +41,9 @@ def buildtorlist(self):
|
||||
self.tracker_nonprotected_list.append(torrent)
|
||||
|
||||
def writetor(self, filepath='./torrentinfo.txt'):
|
||||
"""Write all torrent data to a file.
|
||||
Useful for development of new features.
|
||||
"""
|
||||
with open(filepath, 'w') as fp:
|
||||
fp.write(str(self.torrentlist))
|
||||
|
||||
@@ -54,5 +61,6 @@ def listqbitapiinfo(self):
|
||||
self.tl.debug(f'qBittorrent Web API: {self.qbt_client.app.web_api_version}')
|
||||
|
||||
def torrentcount(self):
|
||||
"""write torrent counts to log file"""
|
||||
self.tl.debug(f'torrents that are protected {self.protected_count}')
|
||||
self.tl.debug(f"torrents that aren't protected {self.nonprotected_count}")
|
||||
Reference in New Issue
Block a user