Exemplo n.º 1
0
    def setUpClass(self):
        global ruleType, isRun, caseFrom, caseTo, curl, rulesApi, archiveNum, jar, excel, excelSheet1
        self.Time_PO = TimePO()
        self.File_PO = FilePO()
        self.Excel_PO = ExcelPO()
        self.Device_PO = DevicePO()
        self.List_PO = ListPO()
        self.Color_PO = ColorPO()
        self.excelFile = localReadConfig.get_excel("webFile")
        self.Mysql_PO = MysqlPO(localReadConfig.get_db("host"),
                                localReadConfig.get_db("username"),
                                localReadConfig.get_db("password"),
                                localReadConfig.get_db("database"),
                                localReadConfig.get_db("port"))
        # self.Log_PO = LogPO(logFile, fmt='%(levelname)s - %(message)s - %(asctime)s')  # 输出日志

        self.Web_PO = WebPO("chrome")
        self.Web_PO.openURL(localReadConfig.get_http("webUrl"))
        self.Web_PO.driver.maximize_window()  # 全屏

        self.varExcel = os.path.abspath(
            File_PO.getLayerPath("../config") + "/" + self.excelFile)
        self.varTimeYMDHSM = datetime.datetime.now().strftime(
            '%Y%m%d%H%M%S')  # 获取当天日期时间,格式:20161020130318
        bk = xlrd.open_workbook(self.varExcel, formatting_info=True)
        self.newbk = copy(bk)
        self.sheetMain = bk.sheet_by_name("main")
        self.sheetTestCase = bk.sheet_by_name("testcase")
        self.styleRed = xlwt.easyxf(
            'font: name Times New Roman, color-index red')
        self.styleBlue = xlwt.easyxf(
            'font: name Times New Roman, color-index blue')
        self.styleGray25 = xlwt.easyxf(
            'font: name Times New Roman, color-index gray25')
Exemplo n.º 2
0
class RulePO(object):

    def __init__(self):
        global ruleType,isRun,caseFrom,caseTo,curl,rulesApi,archiveNum,jar,excel,excelSheet1
        self.ruleType = localReadConfig.get_filter("ruleType")
        self.isRun = localReadConfig.get_filter("isRun")
        self.caseFrom = localReadConfig.get_filter("caseFrom")
        self.caseTo = localReadConfig.get_filter("caseTo")
        self.caseList = localReadConfig.get_filter("caseList")
        self.curl = localReadConfig.get_http("curl")
        self.rulesApi = localReadConfig.get_http("rulesApi")
        self.archiveNum = localReadConfig.get_http("archiveNum")
        self.jar = localReadConfig.get_jar("jar")
        self.excelFile = localReadConfig.get_excel("excelFile")
        self.excelFileSheetName = localReadConfig.get_excel("excelFileSheetName")

        host = localReadConfig.get_database("host")
        username = localReadConfig.get_database("username")
        password = localReadConfig.get_database("password")
        database = localReadConfig.get_database("database")
        self.Sqlserver_PO = SqlServerPO(host, username, password, database)
        # logFile = localReadConfig.get_log("logFile")
        self.Time_PO = TimePO()
        self.File_PO = FilePO()
        self.Excel_PO = ExcelPO()
        # self.Log_PO = LogPO(logFile, fmt='%(levelname)s - %(message)s - %(asctime)s')  # 输出日志

    # 执行SQL命令
    def execQuery(self, varSQL):
        return self.Sqlserver_PO.ExecQuery(varSQL)


    def switchPath(self, varSwitchPath, varFile):
        # 切换文件路径
        return self.File_PO.getLayerPath(varSwitchPath) + "\\" + varFile
Exemplo n.º 3
0
    def __init__(self):
        global ruleType,isRun,caseFrom,caseTo,curl,rulesApi,archiveNum,jar,excel,excelSheet1
        self.ruleType = localReadConfig.get_filter("ruleType")
        self.isRun = localReadConfig.get_filter("isRun")
        self.caseFrom = localReadConfig.get_filter("caseFrom")
        self.caseTo = localReadConfig.get_filter("caseTo")
        self.caseList = localReadConfig.get_filter("caseList")
        self.curl = localReadConfig.get_http("curl")
        self.rulesApi = localReadConfig.get_http("rulesApi")
        self.archiveNum = localReadConfig.get_http("archiveNum")
        self.jar = localReadConfig.get_jar("jar")
        self.excelFile = localReadConfig.get_excel("excelFile")
        self.excelFileSheetName = localReadConfig.get_excel("excelFileSheetName")

        host = localReadConfig.get_database("host")
        username = localReadConfig.get_database("username")
        password = localReadConfig.get_database("password")
        database = localReadConfig.get_database("database")
        self.Sqlserver_PO = SqlServerPO(host, username, password, database)
        # logFile = localReadConfig.get_log("logFile")
        self.Time_PO = TimePO()
        self.File_PO = FilePO()
        self.Excel_PO = ExcelPO()
Exemplo n.º 4
0
# Created on : 2021-6-30
# Description: 听喜马拉雅抖音频下载
# https://www.ximalaya.com/
# 获取index,专辑音频总数,页数 https://www.ximalaya.com/revision/album/getTracksList?albumId=13738175&pageNum=1
# 获取src,https://www.ximalaya.com/revision/play/album?albumId=13738175&pageNum=1
# 参考:https://blog.csdn.net/weixin_40873462/article/details/89706555
#******************************************************************************************************************

import sys
sys.path.append("../../")

from PO.DataPO import *
Data_PO = DataPO()

from PO.FilePO import *
File_PO = FilePO()

from PO.HtmlPO import *
Html_PO = HtmlPO()

from PO.StrPO import *
Str_PO = StrPO()


class Ximalaya:
    def __init__(self):
        # 初始化代理
        Html_PO.getHeadersProxies()

    # 1,获取音频列表
    def getAlbumList(self, albumId):