Skip to content

Commit

Permalink
Small path tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
AcidWeb committed Aug 8, 2019
1 parent 72597f5 commit badda24
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions CB/Core.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

class Core:
def __init__(self):
self.path = 'Interface\\AddOns'
self.path = os.path.join('Interface', 'AddOns')
self.config = None

def init_config(self):
Expand Down Expand Up @@ -173,9 +173,9 @@ def backup_toggle(self):

def backup_check(self):
if self.config['Backup']['Enabled']:
if not os.path.isfile(f'WTF-Backup\\{datetime.datetime.now().strftime("%d%m%y")}.zip'):
if not os.path.isfile(os.path.join('WTF-Backup', f'{datetime.datetime.now().strftime("%d%m%y")}.zip')):
listofbackups = os.listdir('WTF-Backup')
fullpath = [f'WTF-Backup\\{x}' for x in listofbackups]
fullpath = [os.path.join('WTF-Backup', x) for x in listofbackups]
if len([name for name in listofbackups]) == self.config['Backup']['Number']:
oldest_file = min(fullpath, key=os.path.getctime)
os.remove(oldest_file)
Expand All @@ -186,7 +186,7 @@ def backup_check(self):
return False

def backup_wtf(self):
zipf = zipfile.ZipFile(f'WTF-Backup\\{datetime.datetime.now().strftime("%d%m%y")}.zip', 'w',
zipf = zipfile.ZipFile(os.path.join('WTF-Backup', f'{datetime.datetime.now().strftime("%d%m%y")}.zip'), 'w',
zipfile.ZIP_DEFLATED)
filecount = 0
for root, dirs, files in os.walk('WTF/', topdown=True):
Expand Down
3 changes: 2 additions & 1 deletion CurseBreaker.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ def start(self):
self.setup_console()
self.print_header()
# Check if executable is in good location
if not os.path.isfile('Wow.exe') or not os.path.isdir('Interface\\AddOns') or not os.path.isdir('WTF'):
if not os.path.isfile('Wow.exe') or not os.path.isdir(os.path.join('Interface', 'AddOns')) or \
not os.path.isdir('WTF'):
printft(HTML('<ansibrightred>This executable should be placed in the same directory where Wow.exe is locate'
'd.</ansibrightred>\n'))
os.system('pause')
Expand Down

0 comments on commit badda24

Please sign in to comment.