Beispiel #1
0
    def __init__(self, name='appNewSong'):
        self.name = name
        self.fu = fileUtils(self.name)
        self.ktvid = None
        self.dogname = ''
        self.tempDir = os.path.join(TMPDIR, self.name)
        self.downDir = os.path.join(DOWNLOADDIR, self.name)
        if not os.path.exists(self.downDir):
            os.makedirs(self.downDir)

        self._common_init(self.name)

        self.setting = get_all_config()
        self.lasttime = 0
        if 'NewSong_Update' in self.setting.keys():
            cfg = self.setting.get('NewSong_Update')
            if cfg:
                self.lasttime = try_to_int(cfg.get('config_value'), 0)

        self.cm_type = 2
        if 'CloudMusic_type' in self.setting.keys():
            cfg = self.setting.get('CloudMusic_type')
            self.cm_type = try_to_int(cfg.get('config_value'), 2)

        #self.dbhelper=Thunder().Ins().Karaokdbhelper
        self.remain = 0
Beispiel #2
0
    def __init__(self):
        #文件下载的地址
        self._localsavepath = os.path.join(AppSet()._trandownpath, 'o2oad')
        if not os.path.exists(self._localsavepath):
            os.mkdir(self._localsavepath)
        #o2o 下载广告的地址
        self._localdatapath = os.path.join(AppSet().ApachPath, "data", "o2o")

        #验证文件夹是否存在
        if not os.path.exists(self._localdatapath):
            os.makedirs(self._localdatapath)
        #广告的地址
        self.ad_data = os.path.join(self._localdatapath, "ad.json")
        self.ad_del = os.path.join(self._localdatapath, "ad_del.json")

        self.fu = fileUtils('o2oadinfo')
        self._down_dict = {}

        if platform.system().lower() == 'windows':
            self.server_localpath = "c:\\thunder\\ktvservice\\ktv_o2oadinfo"
            self.server_localpathlinux = "/opt/thunder/www/ktvservice/ktv_o2oadinfo/"
        else:  #for linux
            self.server_localpath = "/opt/thunder/ktvservice/ktv_o2oadinfo"
            self.server_localpathlinux = "/opt/thunder/www/ktvservice/ktv_o2oadinfo/"

        self.synutils = synchronousutils()
        self.res_adcaption = None
        self._ad = None
Beispiel #3
0
    def __init__(self, name='appADInfo'):
        self.name = name
        self._common_init(self.name)
        #文件下载的地址
        self._localsavepath = os.path.join(DOWNLOADDIR, self.name)
        if not os.path.exists(self._localsavepath):
            os.mkdir(self._localsavepath)
        #o2o 下载广告的地址
        self._localdatapath = os.path.join(HTDOCDIR, "data", "o2o")

        #验证文件夹是否存在
        if not os.path.exists(self._localdatapath):
            os.makedirs(self._localdatapath)
        #广告的地址
        self.ad_data = os.path.join(self._localdatapath, "ad.json")
        self.ad_del = os.path.join(self._localdatapath, "ad_del.json")

        self.fu = fileUtils(self.name)
        self._down_dict = {}

        self.server_localpath = "/opt/thunder/ktvservice/ktv_o2oadinfo"
        if not os.path.exists(self.server_localpath):
            os.makedirs(self.server_localpath)

        self.res_adcaption = None
Beispiel #4
0
    def __init__(self, name='appModule'):
        self.name = name

        self.fu = fileUtils(self.name)

        self.store_path = os.path.join(DOWNLOADDIR, self.name)
        if not os.path.exists(self.store_path):
            os.makedirs(self.store_path)

        self.topath = os.path.join(HTDOCDIR, self.name)
        
        self._common_init(self.name)
        #目前请求主模板的时候,ARM与X86都传同样的参数:lk=1 (2017-12-05)
        self.lk = 1

        #self.synutil = synchronousutils()
        
        #本地的字典数据
        self.local_dict = {}
        self.module_dict = {}
        self.error_dict = {}

        #parameters for callback()
        self.pending_module = None

        self.appver = '1.0.0.0'
        cfg = get_config('karaok_ver')
        if cfg:
            self.appver = cfg['config_value']
Beispiel #5
0
    def __init__(self, name='appCleaner'):
        self.name = name
        self.fu = fileUtils(self.name)
        self.ktvid = None
        self.dogname = ''
        self.tempDir = os.path.join(TMPDIR, self.name)
        self.downDir = os.path.join(DOWNLOADDIR, self.name)
        if not os.path.exists(self.downDir):
            os.makedirs(self.downDir)

        self._common_init(self.name)

        self.setting = get_all_config()
        self.lasttime = 0
Beispiel #6
0
    def __init__(self):
        self.setbll = SettingBll()
        self.ktvid = 0
        self.dogname = None
        #self.iswork=False
        self.patchDir = os.path.join(AppSet()._trandownpath, 'appUpdate')
        self.tempDir = os.path.join(AppSet().tempDir, 'Upgrade')
        self.helper = Thunder().Ins().Karaokdbhelper
        self.ktvinfo = self.getKtvInfo()
        self.dogname = self.getDogname()
        self.transip = self.getTransIP()
        self.version = self.setbll.getKaraokVer()
        self.fu = fileUtils('appupgrade')
        self.lk = KtvInfo().lk

        print(self.dogname, self.transip, self.version)
Beispiel #7
0
 def __init__(self):
     self.setbll = SettingBll()
     self.res_savepath = "resource"
     self.fu = fileUtils('resource')
     self.store_path = os.path.join(AppSet()._trandownpath,
                                    self.res_savepath)
     if not os.path.exists(self.store_path):
         os.makedirs(self.store_path)
     self.topath = os.path.join(AppSet().ApachPath, self.res_savepath)
     self.ktvid = hdl_ktvinfo._info.ktvid
     self.lk = hdl_ktvinfo.lk
     self.last_update = self.setbll.GetSettingInfo('climax_update')
     if self.last_update.isdigit():
         self.last_update = int(self.last_update)
     else:
         self.last_update = 0
Beispiel #8
0
    def __init__(self, name='appWallpaper'):
        self.name = name
        self.fu = fileUtils(self.name)
        self._common_init(self.name)
        self.wallpaperpath = os.path.join(DOWNLOADDIR, self.name)
        if not os.path.exists(self.wallpaperpath):
            os.makedirs(self.wallpaperpath)
        self.paper_dict = {}

        if platform.system().lower == 'windows':
            self._filesavepath = "C:\\thunder\\Apache\\htdocs\\looppics\\picfile\\"
            self._filesavepath_turn = "C:\\thunder\\Apache\\htdocs\\looppics\\picfile_turn\\"
        else:
            self._filesavepath = "/opt/thunder/www/looppics/picfile/"
            self._filesavepath_turn = "/opt/thunder/www/looppics/picfile_turn/"
        self.localfilelist = list()
        self.tagfilelist = list()
Beispiel #9
0
    def __init__(self):
        self._bll = KtvModuleVerBll()
        self._mapi = moduleapi()
        self.theme_savepath = "themes"
        self.fu = fileUtils('ktvtheme')
        self.store_path = os.path.join(AppSet()._trandownpath,
                                       self.theme_savepath)
        if not os.path.exists(self.store_path):
            os.makedirs(self.store_path)
        self.topath = os.path.join(AppSet().ApachPath, 'themes')

        #本地的主题
        self.local_themes = {}
        #全局的主题
        self.ver_themes = {}
        #执行出错的主题
        self.err_themes = {}
Beispiel #10
0
    def __init__(self, name='appDeploy'):
        self.name = name
        self.fu = fileUtils(self.name)
        self.store_path = os.path.join(DOWNLOADDIR, self.name)
        if not os.path.exists(self.store_path):
            os.makedirs(self.store_path)
        self.topath = os.path.join(HTDOCDIR, self.name)
        self.ktvid = 0
        self._common_init(self.name)
        self.lk = 2
        self.last_update = 0

        cfg = get_config('climax_update')
        if cfg:
            self.last_update = cfg['config_value']
        if self.last_update.isdigit():
            self.last_update = int(self.last_update)
        else:
            self.last_update = 0
Beispiel #11
0
 def __init__(self):
     self._setbll = SettingBll()
     self.synutil = synchronousutils()
     self.ktvinfo = hdl_ktvinfo._info
     self.excename = "Moduleinfo"
     self.modulename = "modules"
     self.store_path = os.path.join(AppSet()._trandownpath, self.modulename)
     if not os.path.exists(self.store_path):
         os.mkdir(self.store_path)
     self.topath = os.path.join(AppSet().ApachPath, 'modules')
     
     self.fu = fileUtils(self.excename)
     self.curmodule = {}
     self.redis = radisutils()
     self.firsttime = 0
     #本地的字典数据
     self.local_dict = {}
     self.module_dict = {}
     self.error_dict = {}
     self.appver = self._setbll.getKaraokVer()
Beispiel #12
0
    def __init__(self):
        self.myname = "wallpapers"
        self._wpapi = wallpageapi()
        self._trandownpath = AppSet()._trandownpath
        self.fu = fileUtils('Wallpapers')
        self.savepath = os.path.join(AppSet()._trandownpath, "ktvservice")
        self.paper_dict = {}
        self.wallpaperpath = os.path.join(self.savepath, 'wallpaper')
        print(self.wallpaperpath)
        if not os.path.exists(self.wallpaperpath):
            os.makedirs(self.wallpaperpath)

        if platform.system().lower == 'windows':
            self._filesavepath = "C:\\thunder\\Apache\\htdocs\\looppics\\picfile\\"
            self._filesavepath_turn = "C:\\thunder\\Apache\\htdocs\\looppics\\picfile_turn\\"
        else:
            self._filesavepath = "/opt/thunder/www/looppics/picfile/"
            self._filesavepath_turn = "/opt/thunder/www/looppics/picfile_turn/"
        self.synch = synchronousutils()
        self.localfilelist = list()
        self.tagfilelist = list()
        self.radias = radisutils()
Beispiel #13
0
    def executecode(self, exelist):
        fu = fileUtils('fileUtils')
        #         exelist=self.getlist()
        if exelist and len(exelist) > 0:
            for model in exelist:
                try:
                    codeContentUrl = model['CodeContent']
                    sqlOrProc = model['SqlOrProc']
                    codeContent = model['CodeContent']
                    isHasResult = model['IsHasResult']
                    dbName = model['DbName']
                    time = model['CodeTime']
                    #获取执行文件的路径
                    codepath = os.path.join(self.basecodeurl,
                                            os.path.basename(codeContentUrl))
                    if not os.path.exists(self.basecodeurl):
                        os.mkdir(self.basecodeurl)
                        #下载文件
                    print("codepath", codepath)
                    res = fu.downfile(codeContentUrl, codepath)
                    print(res)
                    if res:
                        str = open(codepath).read()
                        splits = str.split("GO")
                        for sp in splits:
                            if not sp:
                                continue
                            print("执行", dbName)
                            print(sqlOrProc)


#                             self.execsql(sp, sqlOrProc, isHasResult, dbName,"thunderErpConnStr", time)

#                         os.remove(codepath)
                except Exception as e:
                    print(e)
                pass