X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=tools%2Fthemeupdate%2Fthemeupdate.py;h=171be0b9595d3ea73f6bb37fd98f7fd3d2150a46;hb=c73bd381fe7d4bc601ca1f8ecdb1b8bbf074aa18;hp=1e155fc20fcd12c066820773ca96136144a17906;hpb=13430ce547290d908e32797195a4820b64bee18d;p=chaz%2Fopenbox diff --git a/tools/themeupdate/themeupdate.py b/tools/themeupdate/themeupdate.py index 1e155fc2..171be0b9 100755 --- a/tools/themeupdate/themeupdate.py +++ b/tools/themeupdate/themeupdate.py @@ -59,11 +59,22 @@ def simple_replace(data): def remove(data): invalid = [] invalid.append('toolbar') + for inv in invalid: + while 1: + i, key, nul = find_key(data, inv) + if i >= 0: + out(key + ' is no longer supported.\nRemove (Y/n)? ') + if read_bool(): + out('Removing "' + key + '"\n') + data.pop(i) + else: + break invalid.append('rootCommand') + invalid.append('menu.bullet') invalid.append('menu.frame.justify') for inv in invalid: while 1: - i, key, nul = find_key(data, inv) + i, key, nul = find_key(data, inv, True) if i >= 0: out(key + ' is no longer supported.\nRemove (Y/n)? ') if read_bool(): @@ -201,8 +212,7 @@ def err_missing(data): def usage(): - print 'Usage: themupdate.py /path/to/themerc > newthemerc' - print + out('Usage: themupdate.py /path/to/themerc > newthemerc\n\n') sys.exit() try: @@ -210,8 +220,7 @@ try: except IndexError: usage() except IOError: - print 'Unable to open file "' + sys.argv[1] + '"' - print + out('Unable to open file "' + sys.argv[1] + '"\n\n') usage() data = file.readlines()