def build_backend(app_id): print("Building the App") app_file = app_id + ".json" app_dict = read_appfile(apps.STORAGEINDEX + "/ios/" + app_file) build_lock = "{}/{}.lock".format(STORAGEOTA, app_id) if not os.path.exists(build_lock): open(build_lock, "w").close() else: print("App is already building!!!") # TODO check if IPA already exists # build procedure here file = "{}/{}.json".format(apps.STORAGEIOS, app_id) assert os.path.exists(file) appdict = read_appfile(file) url = appdict["repo"] assert url is not None app_path = apps.STORAGEBUILD + "/" + app_id if os.path.exists(app_path): shutil.rmtree(app_path) gc.gitclone(url, aspath=app_path) identities = installer.get_identities() assert len(identities) == 1 # finished os.remove(build_lock) print("Finished building the app")
def ios_apps(): index_apps = os.listdir(apps.STORAGEINDEX + "/ios") apps_html = "" for index_app in index_apps: app_id = index_app[:-5] app_dict = read_appfile(apps.STORAGEINDEX + "/ios/" + index_app) apps_html += '<a href="{}">{}</a>\n<br>'.format(url_for("ios_app", app_id=app_id), app_dict["name"]) return apps_html
def search(search_term, searchmethod): if searchmethod is None: searchmethod = "QUICK" apps = search_backend(search_term, entity_type=TYPE.IOS, searchtype=searchmethod) for app in apps: appdict = read_appfile(STORAGEIOS + "/" + app) click.secho("{} ({}) @ {}".format(appdict["name"], app[:-5], appdict["repo"])) if len(apps) == 0: click.secho("Nothing found for \"{}\"".format(search_term)) click.secho("Make sure to update your index using: \"apps update\"")
def ios_app(app_id): app_file = app_id + ".json" app_dict = read_appfile(apps.STORAGEINDEX + "/ios/" + app_file) return """ <h1>{}</h1> <a href="{}"><button type="button">Install</button></a><br> <a href="{}">Repository</a><br> <p>{}</p><br> """.format( app_dict["name"], url_for("install_ios", app_id=app_id), app_dict["repo"], app_dict["description"] )
def get_backend(url, name, path): if name is None and url is None: name = click.prompt("Enter the module name") if name is not None and url is None: file = "{}/{}.json".format(STORAGEIOS, name) if os.path.exists(file): appdict = read_appfile(file) url = appdict["repo"] else: click.secho("The module you requested is not in the index", err=True) url = click.prompt("Please enter the url for the module") if url is not None: github_id = as_extracting.extract_github_id(url) if name is not None: appid = name else: appid = "github.{}.{}".format(github_id[0], github_id[1]) app_path = path+"/"+appid if os.path.exists(app_path): shutil.rmtree(app_path) gc.gitclone(url, aspath=app_path) return appdict, app_path