Пример #1
0
def process_zip(rz, results_dir):
    ########################################################################
    # Dump out results and installer for /index.php
    #

    installer_name = rz.installer

    txts = ('prebuilt', 'buildresults')
    for f in (f for f in txts if f in rz.namelist()):
        fname = relative_to(__file__, '../%s_%s.txt' % (f, rz.platform_id))
        with open(fname, 'w') as fh:
            fh.write(rz.read(f))

    if installer_name:
        with open(relative_to(__file__, '../%s' % installer_name), 'wb') as fh:
            fh.write(rz.read(installer_name))

    ########################################################################
    # Archive The Text
    #

    archive_zip = os.path.join (
        results_dir, 'archives', '%s_%s.zip' % (rz.platform_id, rz.latest_rev)
    )
    
    rz.archive_text(archive_zip)
Пример #2
0
def process_zip(rz, results_dir):
    ########################################################################
    # Dump out results and installer for /index.php
    #

    installer_name = rz.installer

    txts = ('prebuilt', 'buildresults')
    for f in (f for f in txts if f in rz.namelist()):
        fname = relative_to(__file__, '../%s_%s.txt' % (f, rz.platform_id))
        with open(fname, 'w') as fh:
            fh.write(rz.read(f))

    if installer_name:
        with open(relative_to(__file__, '../%s' % installer_name), 'wb') as fh:
            fh.write(rz.read(installer_name))

    ########################################################################
    # Archive The Text
    #

    archive_zip = os.path.join (
        results_dir, 'archives', '%s_%s.zip' % (rz.platform_id, rz.latest_rev)
    )
    
    rz.archive_text(archive_zip)
Пример #3
0
    archives_dir = os.path.join(d, "archives")
    db_dir = os.path.join(d, "db")

    for dir in (archives_dir, db_dir):
        if not os.path.exists(dir):
            os.makedirs(dir)


################################################################################

q = cgi.FieldStorage()

if q.has_key("results_file"):
    rz = ResultsZip(q["results_file"].file)

    results_dir = relative_to(__file__, "../results/%s" % rz.platform_id)
    prepare_results_dirs(results_dir)

    if "test_results_dict.txt" in rz.namelist():
        db = ZDB(os.path.join(results_dir, "db", "%s.fs" % rz.platform_id))
        db.root[rz.latest_rev] = rz.eval("test_results_dict.txt")
        db.close()

    process_results.process_zip(rz, results_dir)

    rz.close()

    print "%s RESULTS UPLOAD SUCCESSFUL" % rz.platform_id.upper()
else:
    print """
    <html>
Пример #4
0
    archives_dir = os.path.join(d, 'archives')
    db_dir = os.path.join(d, 'db')

    for dir in (archives_dir, db_dir):
        if not os.path.exists(dir):
            os.makedirs(dir)


################################################################################

q = cgi.FieldStorage()

if 'results_file' in q:
    rz = ResultsZip(q['results_file'].file)

    results_dir = relative_to(__file__, '../results/%s' % rz.platform_id)
    prepare_results_dirs(results_dir)

    if 'test_results_dict.txt' in rz.namelist():
        db = ZDB(os.path.join(results_dir, 'db', '%s.fs' % rz.platform_id))
        db.root[rz.latest_rev] = rz.eval('test_results_dict.txt')
        db.close()

    process_results.process_zip(rz, results_dir)

    rz.close()

    print('%s RESULTS UPLOAD SUCCESSFUL' % rz.platform_id.upper())
else:
    print("""
    <html>