working with test case data

This commit is contained in:
2022-08-11 21:06:37 -05:00
parent f54702ceb6
commit 06b5016b90
3 changed files with 26 additions and 10 deletions

View File

@@ -47,12 +47,15 @@ def getunixtimestamp(self):
self.uts = self.t.time()
self.tl.info(self.uts)
def writetor(self, filepath='./torrentinfo.txt'):
def writetor(self, filepath='./torrentinfo.json'):
"""Write all torrent data to a file.
Useful for development of new features.
"""
with open(filepath, 'w') as fp:
fp.write(str(self.torrentlist))
json_init = self.l(self.torrentlist)
print(json_init)
# json_object = self.d(self.torrentlist, indent=4)
# with open(filepath, 'w') as fp:
# fp.write(json_object)
def listfirsttor(self, index=0):
"""Only lists the first torrent"""
@@ -86,4 +89,7 @@ def getscriptruntime(self):
if self.use_log:
self.tl.info(f'Execution time: [{elapsed_time}]')
if self.use_pushover:
self.extm = f"Execution time: [{elapsed_time}]"
self.extm = f"Execution time: [{elapsed_time}]"
def getobjecttype(object):
print(type(object))