Ejemplo n.º 1
0
 def updateData(self):
     query = session.query(CrashReportIE).order_by(
         CrashReportIE.Id.desc()).first()
     Hotfix_Version = int(query.ReleaseBuild.split(".")[2]) + 1
     Update_Version = query.ReleaseBuild.split(
         ".")[0] + "." + query.ReleaseBuild.split(".")[1] + "." + str(
             Hotfix_Version) + "." + Hotfix_Buildnumber.split('.')[3]
     Build_CA_IT, Build_AU_AR_ZA_PL, Build_MX_IE, APP_BUILD_NUM = getCrashRate.ReformatBuildVersion(
         Update_Version)
     ReleaseBuild = Build_MX_IE.split(' ')[0]
     HotFix_crashRate = getCrashRate.get_crash_rate_for_country(
         'Gumtree IE', Build_CA_IT, Build_AU_AR_ZA_PL, Build_MX_IE,
         APP_BUILD_NUM)
     if HotFix_crashRate == "0%":
         print("Crash Data is 0% ,no need to save into DB")
     else:
         query.ReleaseBuild = ReleaseBuild
         query.CrashRate = HotFix_crashRate
         query.ReleaseNumber = Hotfix_Buildnumber
     session.commit()
Ejemplo n.º 2
0
from sys import argv
import getCrashRate

engine = create_engine("sqlite:///scripts/PoltDemoDB.db", echo=True)
#engine = create_engine("sqlite:///PoltDemoDB.db", echo=True)
Base = declarative_base()
crashRate = 0
Session = sessionmaker(bind=engine)
session = Session()
Hotfix_Buildnumber = argv[2]
country = argv[1]
print(Hotfix_Buildnumber)
BuildVersion_AU = "5." + Hotfix_Buildnumber.split(
    '.')[1] + '.' + Hotfix_Buildnumber.split(
        '.')[2] + '.' + Hotfix_Buildnumber.split('.')[3]
Build_CA_IT, Build_AU_AR_ZA_PL, Build_MX_IE, APP_BUILD_NUM = getCrashRate.ReformatBuildVersion(
    BuildVersion_AU)


# update the crash rate of the last version for AU
class CrashReportAU(Base):
    __tablename__ = 'TestTableForAU'
    Id = Column(Integer, primary_key=True)
    ReleaseBuild = Column(String, nullable=False)
    CrashRate = Column(String, nullable=False)
    ReleaseNumber = Column(String, nullable=False)
    Notes = Column(String, nullable=True)

    # update crash rate up to date
    def updateData(self):
        # crashRate = getCrashRate.get_crash_rate_for_country('Gumtree AU',Build_CA_IT,Build_AU_AR_ZA_PL,Build_MX_IE,APP_BUILD_NUM)
        # ReleaseBuild = Build_AU_AR_ZA_PL.split(' ')[0]