def index():
    db = get_db()
    iosprojectlist = db.execute(
        'select distinct projectName from iOSProject order by id desc'
    ).fetchall()
    return render_template('projects/iosprojectlist.html',
                           iosprojectlist=iosprojectlist)
Esempio n. 2
0
def index(f):
    db = get_db()
    projects = db.execute(
        'select moduleName, package, productFlavorName, packageVersionCode, packageVersionName, '
        'packageTargetSdk, packageMiniSdk, packageMappingUrl, deepLinkScheme, gitSHACode, gitBranchName, date '
        'from Package where packageName = ? order by id desc',
        (f, )).fetchall()
    return render_template('projects/projects.html',
                           projectname=f,
                           projects=projects)
Esempio n. 3
0
 def isUseSnapshot(pVName, pK):
     # print(pVName)
     # print(pK)
     db = get_db()
     lVersion = db.execute(
         'select libraryVersion from PackageLibrary WHERE packageVersionName = ? and package = ?',
         (pVName, pK)).fetchall()
     items = [dict(libraryVersion=row[0]) for row in lVersion]
     for item in items:
         print(item['libraryVersion'])
         if '-SNAPSHOT' in item['libraryVersion']:
             return True
     print('Not found')
     return False
Esempio n. 4
0
 def xframeWork(iOSPV, iOSPN):
     # print(iOSPV)
     # print(iOSPN)
     db = get_db()
     iOSlVersion = db.execute(
         'select frameworkVersion from Framework WHERE projectName = ? and projectVersion = ?',
         (iOSPV, iOSPN)).fetchall()
     items = [dict(iOSFrameworkVersion=row[0]) for row in iOSlVersion]
     for item in items:
         print(item['iOSFrameworkVersion'])
         if re.match(r'\d+.\d+.0\d+',
                     item['iOSFrameworkVersion']) or 'x' in str(
                         item['iOSFrameworkVersion']):
             return True
     print('Not found')
     return False
Esempio n. 5
0
def index(a, b, c):
    print(a, b, c)
    # ufc-tv prod 8.0613
    db = get_db()
    # package
    # packageName
    # productFlavorName
    # packageVersionName
    projectdetails = db.execute(
        'select package, packageName, productFlavorName, packageVersionName, libraryGroup, '
        'libraryName, libraryVersion from PackageLibrary WHERE package = ? '
        'and productFlavorName = ? and packageVersionName = ?', (
            a,
            b,
            c,
        )).fetchall()
    items = [
        dict(pname=row[1], pFlavor=row[2], pversion=row[3])
        for row in projectdetails
    ]
    names = []
    versions = []
    flavors = []
    for item in items:
        # print('item: ' + item)
        names.append(item['pname'])
        versions.append(item['pversion'])
        flavors.append(item['pFlavor'])
    # print(names, versions)
    name = names[0]
    version = versions[0]
    flavor = flavors[0]
    # print(projectdetails)
    return render_template('projects/projectdetail.html',
                           name=name,
                           flavor=flavor,
                           version=version,
                           projectdetails=projectdetails)
Esempio n. 6
0
def index(g):
    db = get_db()
    iosprojects = db.execute('select projectName, projectVersion, date from iOSProject where projectName = ? order by id desc', (g,)).fetchall()
    return render_template('projects/iosprojects.html', iosprojectname=g, iosprojects=iosprojects)
Esempio n. 7
0
def index():
    db = get_db()
    projectlist = db.execute('select distinct package, packageName from Package order by id desc').fetchall()
    return render_template('projects/projectlist.html', projectlist=projectlist)
Esempio n. 8
0
    def projects():
        if request.method == 'POST':
            a = request.data
            templist = json.loads(a)
            # dict1 = templist[0]
            db = get_db()
            for dict1 in templist:
                #print(dict1)
                if db.execute(
                        'SELECT package, packageVersionName, productFlavorName, moduleName FROM Package WHERE package = ? and packageVersionName = ? and productFlavorName = ? and moduleName = ?',
                    (dict1['package'], dict1['packageVersionName'],
                     dict1['productFlavorName'],
                     dict1['moduleName'])).fetchone() is not None:
                    # print('Found')
                    db.execute(
                        'UPDATE Package SET packageName = ?, packageVersionCode = ?,productFlavorName = ?, packageTargetSdk = ?, '
                        'packageMiniSdk = ?, packageMappingUrl = ?, deepLinkScheme = ?, gitSHACode = ?, gitBranchName = ? WHERE package = ? and packageVersionName = ? and productFlavorName = ? and moduleName = ?',
                        (dict1['packageName'], dict1['packageVersionCode'],
                         dict1['productFlavorName'], dict1['packageTargetSdk'],
                         dict1['packageMiniSdk'], dict1['packageMappingUrl'],
                         dict1['deepLinkScheme'], dict1['gitSHACode'],
                         dict1['gitBranchName'], dict1['package'],
                         dict1['packageVersionName'],
                         dict1['productFlavorName'], dict1['moduleName']))
                    db.execute(
                        'UPDATE Package SET date = datetime(\'now\', \'localtime\') WHERE package = ? and '
                        'packageVersionName = ?',
                        (dict1['package'], dict1['packageVersionName']))
                    db.commit()

                    id = db.execute(
                        'select id from PackageLibrary WHERE package = ? and packageVersionName = ? and productFlavorName = ?',
                        (dict1['package'], dict1['packageVersionName'],
                         dict1['productFlavorName']))
                    pids = [dict(id=row[0]) for row in id.fetchall()]
                    ids = []

                    for item in pids:
                        ids.append(item['id'])

                    # print(ids)

                    i = 0
                    for dict2 in dict1['libraryCoordinateList']:
                        db.execute(
                            'UPDATE PackageLibrary SET package = ?, packageName = ?, productFlavorName = ?, packageVersionName = ?, '
                            'libraryGroup = ?, libraryName = ?, libraryVersion = ? WHERE package = ? and '
                            'packageVersionName = ? and id = ?',
                            (dict1['package'], dict1['packageName'],
                             dict1['productFlavorName'],
                             dict1['packageVersionName'], dict2['group'],
                             dict2['name'], dict2['currentVersion'],
                             dict1['package'], dict1['packageVersionName'],
                             ids[i]))
                        db.commit()
                        i = i + 1

                # insert new data
                else:
                    print(dict1)
                    db.execute(
                        'INSERT INTO Package (package, packageName , productFlavorName, packageVersionCode, packageVersionName, '
                        'packageTargetSdk, packageMiniSdk, packageMappingUrl, deepLinkScheme, gitSHACode, gitBranchName, moduleName) '
                        'VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)',
                        (dict1['package'], dict1['packageName'],
                         dict1['productFlavorName'],
                         dict1['packageVersionCode'],
                         dict1['packageVersionName'],
                         dict1['packageTargetSdk'], dict1['packageMiniSdk'],
                         dict1['packageMappingUrl'], dict1['deepLinkScheme'],
                         dict1['gitSHACode'], dict1['gitBranchName'],
                         dict1['moduleName']))
                    db.commit()
                    for dict2 in dict1['libraryCoordinateList']:
                        # print(dict2['libraryName'], dict2['libraryVersion'])
                        db.execute(
                            'INSERT INTO PackageLibrary (package, packageName, productFlavorName, packageVersionName, libraryGroup, '
                            'libraryName, libraryVersion) VALUES (?, ?, ?, ?, ?, ?, ?)',
                            (dict1['package'], dict1['packageName'],
                             dict1['productFlavorName'],
                             dict1['packageVersionName'], dict2['group'],
                             dict2['name'], dict2['currentVersion']))
                        db.commit()
            return 'Project info stored'
        else:
            return '<h1>Only accept post request!</h1>'
Esempio n. 9
0
    def iosprojects():
        if request.method == 'POST':
            a = request.data
            templist = json.loads(a)
            dict1 = templist[0]
            print(dict1['projectName'])
            db = get_db()
            # if already exist just update.
            if db.execute(
                    'SELECT projectName, projectVersion FROM iOSProject WHERE projectName = ? and projectVersion = ?',
                (dict1['projectName'],
                 dict1['projectVersion'])).fetchone() is not None:
                # print('Found')
                db.execute(
                    'UPDATE iOSProject SET projectName = ?, projectVersion = ? WHERE projectName = ? and '
                    'projectVersion = ?',
                    (dict1['projectName'], dict1['projectVersion'],
                     dict1['projectName'], dict1['projectVersion']))
                db.commit()
                db.execute(
                    'UPDATE iOSProject SET date = datetime(\'now\', \'localtime\') WHERE projectName = ? and '
                    'projectVersion = ?',
                    (dict1['projectName'], dict1['projectVersion']))
                db.commit()

                iosid = db.execute(
                    'select id from Framework WHERE projectName = ? and projectVersion = ?',
                    (dict1['projectName'], dict1['projectVersion']))
                pids = [dict(id=row[0]) for row in iosid.fetchall()]
                iosids = []

                for item in pids:
                    iosids.append(item['id'])

                # print(ids)

                i = 0
                for dict2 in dict1['frameworks']:
                    db.execute(
                        'UPDATE Framework SET projectName = ?, projectVersion = ?, frameworkName = ?, '
                        'frameworkVersion = ? WHERE projectName = ? and projectVersion = ? and id = ?',
                        (dict1['projectName'], dict1['projectVersion'],
                         dict2['frameworkName'], dict2['frameworkVersion'],
                         dict1['projectName'], dict1['projectVersion'],
                         iosids[i]))
                    db.commit()
                    i = i + 1
                return 'Project info Updated'
            # insert new data
            else:
                db.execute(
                    'INSERT INTO iOSProject (projectName, projectVersion) VALUES (?, ?)',
                    (dict1['projectName'], dict1['projectVersion']))
                db.commit()
                for dict2 in dict1['frameworks']:
                    # print(dict2['libraryName'], dict2['libraryVersion'])
                    db.execute(
                        'INSERT INTO Framework (projectName, projectVersion, frameworkName, frameworkVersion) '
                        'VALUES (?, ?, ?, ?)',
                        (dict1['projectName'], dict1['projectVersion'],
                         dict2['frameworkName'], dict2['frameworkVersion']))
                db.commit()
                return 'Project info stored'
        else:
            return '<h1>Only accept post request!</h1>'