forked from djib/PDMameUpdate
Code refactoring
Rename mame_directory to mame-directory to be more consistent
This commit is contained in:
@ -63,7 +63,7 @@ def fetch_local_torrents():
|
||||
"""Fetches local torrents versions"""
|
||||
|
||||
logging.info('Fetching current MAME versions')
|
||||
directories = os.listdir(config['mame_directory'])
|
||||
directories = os.listdir(config['mame-directory'])
|
||||
for directory in directories:
|
||||
match = re_mame_version.match(directory)
|
||||
if match:
|
||||
@ -173,14 +173,14 @@ def update_torrents():
|
||||
"""
|
||||
logging.info('Updating torrents')
|
||||
for torrent in torrents.values():
|
||||
old_name = os.path.join(config['mame_directory'], torrent['local-name'])
|
||||
new_name = os.path.join(config['mame_directory'], torrent['remote-name'])
|
||||
old_name = os.path.join(config['mame-directory'], torrent['local-name'])
|
||||
new_name = os.path.join(config['mame-directory'], torrent['remote-name'])
|
||||
|
||||
client.torrent.remove(torrent['transmission-id']);
|
||||
os.rename(old_name, new_name)
|
||||
client.torrent.add(
|
||||
filename=torrent['remote-link'],
|
||||
download_dir=config['mame_directory'],
|
||||
download_dir=config['mame-directory'],
|
||||
cookies=cookies,
|
||||
paused=False
|
||||
)
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"mame_directory":"/path/to/your/locol/mame/torrent/target/folders",
|
||||
"mame-directory":"/path/to/your/locol/mame/torrent/target/folders",
|
||||
"transmission-user":"user",
|
||||
"transmission-password":"pass",
|
||||
"pleasuredome-user":"user",
|
||||
|
Reference in New Issue
Block a user