예제 #1
0
def gen_library(path, output, Library=Library):
    """
    This method does the entire generation process for a random SWC.
    """
    if path.endswith(".swc"):
        L = Library.gen_library_swcdata(SwcData.from_filename(path))
    elif path.endswith(".abc"):
        L = Library.gen_library_abc(AbcFile.from_filename(path))
    L.save_pickledb(output)
예제 #2
0
def get_playerglobal_swc():
    """
    This downloads and "extracts" the playerglobal SWC from
    Adobe's official servers.
    """
    URL = "http://download.macromedia.com/pub/labs/flashplayer10/flashplayer10_globalswc.zip"
    zipf = zipfile.ZipFile(StringIO(urllib.urlopen(URL).read()))
    filename = next(f for f in zipf.namelist() if \
                    f.endswith("playerglobal.swc") and not \
                    f.startswith("__MACOSX"))
    return SwcData.from_file(StringIO(zipf.open(filename, "r").read()))