Created
December 11, 2016 04:11
-
-
Save thurask/cd74d45c0da2c5e33a7314b3b3c1df4b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from bbarchivist import textgenerator | |
from bbarchivist import utilities | |
def darcexport(infile, osv, rdv, swv): | |
with open(infile, "r") as afile: | |
data = afile.readlines() | |
apps = [x.strip() for x in data if x.startswith(("com.", "sys."))] | |
formapps = ["{0}-{1}".format(x.split("-")[0].split(".")[-1], x.split("-")[1]) for x in apps] | |
baseurl = utilities.create_base_url(swv) | |
appurls = ["{0}/{1}-nto+armle-v7+signed.bar".format(baseurl, x) for x in formapps] | |
osurls, coreurls, radurls = textgenerator.url_gen(osv, rdv, swv) | |
textgenerator.write_links(swv, osv, rdv, osurls, coreurls, radurls, True, True, appurls) | |
def infoimport(infofile): | |
with open(infofile, "r") as afile: | |
data = afile.readlines() | |
osv, rdv, swv = [x.strip().split(" ")[1] for x in data[0:3]] | |
return osv, rdv, swv | |
def main(infile, infofile): | |
osv, rdv, swv = infoimport(infofile) | |
darcexport(infile, osv, rdv, swv) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment