Rename functions and files

This commit is contained in:
MisterDaneel committed 2019-02-16 18:07:31 +01:00
1 parent 8316712c75
commit 39467076e4
2 files changed
+4 -4

No files matched your search

+2 -2
View File
@@ -14,11 +14,11 @@ from struct import unpack
logging.basicConfig(level=logging.DEBUG) logging.basicConfig(level=logging.DEBUG)
class torrent(): class process_torrent():
def __init__(self, configuration): def __init__(self, configuration):
self.configuration = configuration self.configuration = configuration
torrent_file = self.configuration['torrent:'] torrent_file = self.configuration['torrent']
with open(torrent_file, 'rb') as tf: with open(torrent_file, 'rb') as tf:
data = tf.read() data = tf.read()
self.b_enc = bencoding() self.b_enc = bencoding()
+2 -2
View File
@@ -1,4 +1,4 @@
from code.torrent import torrent from code.process_torrent import process_torrent
import argparse import argparse
import json import json
import sys import sys
@@ -29,7 +29,7 @@ if __name__ == "__main__":
if not configuration: if not configuration:
sys.exit() sys.exit()
to = torrent('test.torrent') to = process_torrent(configuration)
rep = to.tracker_start_request() rep = to.tracker_start_request()
to.tracker_process() to.tracker_process()