diff --git a/CB/__init__.py b/CB/__init__.py index db1946e..fb34f46 100644 --- a/CB/__init__.py +++ b/CB/__init__.py @@ -1,4 +1,4 @@ -__version__ = '1.1.1' +__version__ = '1.2.0' __license__ = 'GPLv3' __copyright__ = '2019, Paweł Jastrzębski ' __docformat__ = 'restructuredtext en' diff --git a/CurseBreaker.py b/CurseBreaker.py index cec04bd..e8b8541 100644 --- a/CurseBreaker.py +++ b/CurseBreaker.py @@ -81,7 +81,9 @@ def start(self): os.system('pause') sys.exit(0) self.print_header() - printft('Press TAB to see a list of available commands.\nPress CTRL+D to close the application.\n') + printft(HTML('Use command help or press TAB to see a list of avai' + 'lable commands.\nCommand exit or pressing CTRL+D wi' + 'll close the application.\n')) # Prompt session while True: try: @@ -142,7 +144,7 @@ def print_header(self): def setup_completer(self): commands = ['install', 'uninstall', 'update', 'force_update', 'status', 'orphans', 'toggle_backup', - 'uri_integration', 'exit'] + 'uri_integration', 'help', 'exit'] addons = sorted(self.core.config['Addons'], key=lambda k: k['Name'].lower()) for addon in addons: commands.extend([f'uninstall {addon["Name"]}', f'update {addon["Name"]}', f'force_update {addon["Name"]}', @@ -220,7 +222,11 @@ def c_update(self, args, addline=False, update=True, force=False): print('\n' + self.table.table if addline else self.table.table) def c_force_update(self, args): - self.c_update(args, False, True, True) + if args: + self.c_update(args, False, True, True) + else: + printft(HTML('Usage:\n\tThis command accepts a comma-separated list of links or addo' + 'n names as an argument.')) def c_status(self, args): self.c_update(args, False, False) @@ -236,13 +242,35 @@ def c_orphans(self, _): def c_uri_integration(self, _): self.core.create_reg() - printft('CurseBreaker.reg file was created. Import it to enable integration.') + printft('CurseBreaker.reg file was created. Attempting to import...') + out = os.system('Reg import CurseBreaker.reg') + if out != 0: + printft('Import failed. Please try to import REG file manually.') + else: + os.remove('CurseBreaker.reg') def c_toggle_backup(self, _): status = self.core.backup_toggle() printft('Backup of WTF directory is now:', HTML('ENABLED') if status else HTML('DISABLED')) + def c_help(self, _): + printft(HTML('install [URL]\n\tCommand accepts a comma-separated list of links.')) + printft(HTML('uninstall [URL/Name]\n\tCommand accepts a comma-separated list of links or' + ' addon names.')) + printft(HTML('update [URL/Name]\n\tCommand accepts a comma-separated list of links or ad' + 'don names.\n\tIf no argument is provided all non-modified addons will be updated.')) + printft(HTML('force_update [URL/Name]\n\tCommand accepts a comma-separated list of links' + ' or addon names.\n\tSelected addons will be reinstalled or updated regardless of their current st' + 'ate.')) + printft(HTML('status\n\tPrints the current state of all installed addons.')) + printft(HTML('orphans\n\tPrints list of orphaned directories and files.')) + printft(HTML('toggle_backup\n\tEnable/disable automatic daily backup of WTF directory.')) + printft(HTML('uri_integration\n\tEnable integration with CurseForge page. "Install" butt' + 'on will now start this application.')) + printft(HTML('\nSupported URLs:\n\thttps://www.curseforge.com/wow/addons/[ad' + 'don_name]\n\thttps://www.wowinterface.com/downloads/[addon_name]\n\tElvUI\n\tElvUI:Dev\n\tTukUI')) + def c_exit(self, _): sys.exit(0)