Exemple #1
0
 def func():
     import system
     import framework.common.util as CommonUtil
     commands = [['msg', u'잠시만 기다려주세요.']]
     if CommonUtil.is_docker():
         commands.append(['apk', 'add', '--no-cache', '--virtual', '.build-deps', 'gcc', 'g++', 'make', 'libffi-dev', 'openssl-dev'])
     
     commands.append(['pip', 'install', '--upgrade', 'pip'])
     commands.append(['pip', 'install', '--upgrade', 'setuptools'])
     commands.append(['pip', 'install', 'streamlink'])
     if CommonUtil.is_docker():
         commands.append(['apk', 'del', '.build-deps'])
     commands.append(['msg', u'설치가 완료되었습니다.'])
     system.SystemLogicCommand.start('설치', commands)
Exemple #2
0
 def func():
     import system
     LogicNormal.kill()
     commands = [['msg', u'설치 환경이 아닙니다.']]
     if CommonUtil.is_docker():
         commands = [['msg', u'잠시만 기다려주세요.'],
                     ['apk', 'add', 'aria2'],
                     ['msg', u'설치가 완료되었습니다.']]
     elif CommonUtil.is_termux():
         pass
     elif CommonUtil.is_linux():
         commands = [['msg', u'잠시만 기다려주세요.'],
                     ['apt-get', '-y', 'install', 'aria2'],
                     ['msg', u'설치가 완료되었습니다.']]
     system.SystemLogicCommand.start('설치', commands)
Exemple #3
0
    def get_binary():
        try:
            import framework.common.util as CommonUtil
            bin_path = os.path.join(os.path.dirname(os.path.abspath(__file__)),
                                    'bin')
            ret = ''
            import platform
            if CommonUtil.is_termux(
            ) and platform.platform().find('arch') != -1:
                ret = os.path.join(bin_path, 'termux', 'aria2c')
            elif CommonUtil.is_windows():
                ret = os.path.join(bin_path, 'Windows', 'aria2c.exe')
            elif CommonUtil.is_mac():
                ret = os.path.join(bin_path, 'Darwin', 'aria2c')
            elif CommonUtil.is_docker() or CommonUtil.is_linux():
                command = ['which', 'aria2c']
                log = Util.execute_command(command)
                if log:
                    ret = log[0].strip()
        except Exception as e:
            logger.error('Exception:%s', e)
            logger.error(traceback.format_exc())

        return ret