def main(): if sys.platform.startswith('linux'): #parse script arguments (options, args) = parse_args() if not args and args[0]: print("root missing") sys.exit(-1) root = args[0] #create lists addon_list = AddonList.AddonList("share_addons", root, options.file) libs = AddonList.AddonList("share_libs", root) #test patterns #for AddonList.parse_root(list_protected=list_protected) list_protected = [ "^Blizzard_.+?$", "s[A-Z].+?", "^SharedMedia_MyMedia$", "^DCSpam$" ] #addon_list.parse_root(True, list_protected) #implement list_protected option first ! addon_list.parse_url_config_file( ) #terrible error, if there is no file given #TODO remember to change back _remove tree in Addon.execute() #remove print in Reader if options.url: #pretty bad pattern ... seams to work though pattern = "^.*?(!?)(git|svn|hg);(.+?)$" match = re.match(pattern, options.url) print(options.url) if match: protected = False if match.group(1) == "!": protected = True temp_addon = Addon.Addon(root, (match.group(2), match.group(3)), protected=protected) #check if it doesnt already exist temp_addon.execute() #todo add to libs return #TEMP for addon in addon_list.list_addons: addon.execute() addon.parse_pkgmeta_file() temp_list = AddonList.AddonList("temp", root) temp_list.parse_pkgmeta_info(addon.config_info) libs = libs.merge(temp_list, 1) print("-------------------------") libs = libs.enhance_addon_list() libs = libs.merge(addon_list, "unique") libs.dump_list_addons() for lib in libs.list_addons: lib.execute() #print(addon_list.root) #print(addon_list.url_config_file) sys.exit(0)