Standardize variables #20
6
qlist.py
6
qlist.py
@ -4,9 +4,9 @@ def build_tor_list(self):
|
|||||||
V2 will certainly be more performant. The reason two lists were used was so that torrents
|
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.
|
that are in public trackers woudln't be around as long as torrents from a private tracker.
|
||||||
"""
|
"""
|
||||||
self.total_torrents = len(self.torrentlist)
|
self.total_torrents = len(self.torrent_list)
|
||||||
while self.torrentlist:
|
while self.torrent_list:
|
||||||
torrent = self.torrentlist.pop()
|
torrent = self.torrent_list.pop()
|
||||||
if self.use_log:
|
if self.use_log:
|
||||||
self.tl.debug(f'["{torrent["name"][0:20]}..."] {torrent["infohash_v1"]}')
|
self.tl.debug(f'["{torrent["name"][0:20]}..."] {torrent["infohash_v1"]}')
|
||||||
if is_ignored_tag(self.ignored_tags.values(),torrent['tags']):
|
if is_ignored_tag(self.ignored_tags.values(),torrent['tags']):
|
||||||
|
12
qlogging.py
12
qlogging.py
@ -1,10 +1,10 @@
|
|||||||
def tor_log(self):
|
def tor_log(self):
|
||||||
"""Setting up the log file, if self.use_log is set to true and self.loglevel is DEBUG OR INFO"""
|
"""Setting up the log file, if self.use_log is set to true and self.loglevel is DEBUG OR INFO"""
|
||||||
if self.use_log:
|
if self.use_log:
|
||||||
if self.loglevel == 'DEBUG':
|
if self.log_level == 'DEBUG':
|
||||||
self.tl.basicConfig(filename=self.logpath, format='%(asctime)s:%(levelname)s:%(message)s', encoding='utf-8', datefmt='%m/%d/%Y %I:%M:%S %p',level=self.tl.DEBUG)
|
self.tl.basicConfig(filename=self.log_path, format='%(asctime)s:%(levelname)s:%(message)s', encoding='utf-8', datefmt='%m/%d/%Y %I:%M:%S %p',level=self.tl.DEBUG)
|
||||||
elif self.loglevel == 'INFO':
|
elif self.log_level == 'INFO':
|
||||||
self.tl.basicConfig(filename=self.logpath, format='%(asctime)s:%(levelname)s:%(message)s', encoding='utf-8', datefmt='%m/%d/%Y %I:%M:%S %p',level=self.tl.INFO)
|
self.tl.basicConfig(filename=self.log_path, format='%(asctime)s:%(levelname)s:%(message)s', encoding='utf-8', datefmt='%m/%d/%Y %I:%M:%S %p',level=self.tl.INFO)
|
||||||
|
|
||||||
def tor_notify(self):
|
def tor_notify(self):
|
||||||
"""Seting up to use pushover, if self.use_pushover is set to true and
|
"""Seting up to use pushover, if self.use_pushover is set to true and
|
||||||
@ -56,7 +56,7 @@ def writetor(self, filepath='./torrentinfo.json'):
|
|||||||
def list_first_tor(self, index=0):
|
def list_first_tor(self, index=0):
|
||||||
"""Only lists the first torrent"""
|
"""Only lists the first torrent"""
|
||||||
self.tl.debug('First torrent in the list:')
|
self.tl.debug('First torrent in the list:')
|
||||||
torrent = self.torrentlist[index]
|
torrent = self.torrent_list[index]
|
||||||
for k,v in torrent.items():
|
for k,v in torrent.items():
|
||||||
self.tl.debug(f'{k}: {v}')
|
self.tl.debug(f'{k}: {v}')
|
||||||
self.tl.debug('\n')
|
self.tl.debug('\n')
|
||||||
@ -75,7 +75,7 @@ def torlisttags(self):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
def debugpremecal(self):
|
def debugpremecal(self):
|
||||||
for torrent in self.torrentlist:
|
for torrent in self.torrent_list:
|
||||||
if torrent['infohash_v1'] == 'a89b484ea375094af53ce89ecbea14bf086d6284':
|
if torrent['infohash_v1'] == 'a89b484ea375094af53ce89ecbea14bf086d6284':
|
||||||
print(torrent["name"][0:20])
|
print(torrent["name"][0:20])
|
||||||
print(torrent['added_on'] + self.minimum_age >= self.t.time())
|
print(torrent['added_on'] + self.minimum_age >= self.t.time())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user