コード例 #1
0
def GetSystemTmpPath() -> cPath:
    """ Gets the path to the tmp folder """
    oPath:cPath

    oPath = cPath(GetEnvVar(u"TMPDIR"))
    if oPath.Exists():
        return oPath

    oPath = cPath(GetEnvVar(u"TMP"))
    if oPath.Exists():
        return oPath

    oPath = cPath(u"/var/tmp")
    if oPath.Exists():
        return oPath

    oPath = cPath(u"/var/tmp")
    if oPath.Exists():
        return oPath

    oPath = cPath(u"/tmp")
    if oPath.Exists():
        return oPath

    oPath = Globals.oPathUserDownload+"orcatmp"

    oPath.Create()
    return oPath
コード例 #2
0
 def AddParameter(self, oParser):
     oParser.add_argument(
         '--wikigitserver',
         default=GetEnvVar(
             'ORCAWIKIGITSERVER',
             'https://github.com/thica/ORCA-Remote/blob/master'),
         action=cParserAction,
         oParameter=self,
         dest="uWikiGitServer",
         help=
         'Set the Git Path to the ORCA Images (can be passed as ORCAGITWIKISERVER environment var)'
     )
     oParser.add_argument('--wikigittargetfolder',
                          default=GetEnvVar('ORCAWIKIGITTARGETFOLDER',
                                            Globals.oPathTmp.string),
                          action=cParserAction,
                          oParameter=self,
                          dest="uWikiGitTargetFolder",
                          help='Sets local folder for the wiki files')
     oParser.add_argument(
         '--wikigitapp',
         default=GetEnvVar('ORCAWIKIGITAPP', "GITWIKI"),
         action=cParserAction,
         oParameter=self,
         dest="uWikiGitApp",
         help='Sets the target for the wiki files (MEDIAWIKI or GITWIKI)'
     )
コード例 #3
0
def GetInstallationDataPath() -> cPath:
    """ Gets the path to the folder where the installer places the ORCA files"""
    '''
    The environment ist
    'ANDROID_ROOT': '/system', 'ANDROID_ASSETS': '/system/app', 'ANDROID_DATA': '/data', 'ANDROID_STORAGE': '/storage', 'EXTERNAL_STORAGE': '/sdcard', 'ASEC_MOUNTPOINT': '/mnt/asec', 'BOOTCLASSPATH': '/system/framework/core-oj.jar:/system/framework/core-libart.jar:/system/framework/conscrypt.jar:/system/framework/okhttp.jar:/system/framework/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/telephony-common.jar:/system/framework/voip-common.jar:/system/framework/ims-common.jar:/system/framework/apache-xml.jar:/system/framework/org.apache.http.legacy.boot.jar', 'SYSTEMSERVERCLASSPATH': '/system/framework/services.jar:/system/framework/ethernet-service.jar:/system/framework/wifi-service.jar', 'ANDROID_SOCKET_zygote': '8', 'ANDROID_ENTRYPOINT': 'main.pyc', 'ANDROID_ARGUMENT': '/data/user/0/org.orca.orca/files/app', 'ANDROID_APP_PATH': '/data/user/0/org.orca.orca/files/app', 'ANDROID_PRIVATE': '/data/user/0/org.orca.orca/files', 'ANDROID_UNPACK': '/data/user/0/org.orca.orca/files/app', 'PYTHONHOME': '/data/user/0/org.orca.orca/files/app', 'PYTHONPATH': '/data/user/0/org.orca.orca/files/app:/data/user/0/org.orca.orca/files/app/lib', 'PYTHONOPTIMIZE': '2', 'P4A_BOOTSTRAP': 'SDL2', 'PYTHON_NAME': 'python', 'P4A_IS_WINDOWED': 'True', 'P4A_ORIENTATION': 'sensor', 'P4A_NUMERIC_VERSION': 'None', 'P4A_MINSDK': '21', 'LC_CTYPE': 'C.UTF-8'})
    # we expect as result
    # /data/data/org.orca.orca/files/app
    
    Access to the environment looks like

    Environment     = autoclass('android.os.Environment')
    tt1:str  = Environment.getStorageDirectory().getPath()
    tt2:str   = Environment.getRootDirectory().getPath()
    tt3:str   = Environment.getDataDirectory().getPath()

    Android getStorageDirectory() = /storage
    Android getRootDirectory() = /system
    Android getDataDirectory() = /data
    
    So we make it simple to utilize the environment var
    
    '''

    oPath = cPath(GetEnvVar(u"ANDROID_APP_PATH"))
    Logger.debug("Android GetInstallationDataPath = " + oPath.string)
    return oPath
コード例 #4
0
 def AddParameter(self,oParser):
     oParser.add_argument('--ftpserver', default=GetEnvVar('ORCAFTPSERVER'), action=cParserAction, oParameter=self, dest="uFTPServer", help='Set the FTP Server address for the repository manager (can be passed as ORCAFTPSERVER environment var)')
     oParser.add_argument('--ftpserverpath', default=GetEnvVar('ORCAFTPSERVERPATH'), action=cParserAction, oParameter=self, dest="uFTPServerPath", help='Set the FTP Server path for the repository manager (can be passed as ORCAFTPSERVERPATH environment var)')
     oParser.add_argument('--ftpuser', default=GetEnvVar('ORCAFTPUSER'), action=cParserAction, oParameter=self, dest="uFTPUser", help='Set the username for the FTP Server for the repository manager (can be passed as ORCAFTPUSER environment var)')
     oParser.add_argument('--ftppassword', default=GetEnvVar('ORCAFTPPW'), action=cParserAction, oParameter=self, dest="uFTPPassword", help='Set the password for the FTP Server for the repository manager (can be passed as ORCAFTPPW environment var)')
     oParser.add_argument('--ftpssl', default=GetEnvVar('ORCAFTPSSL'), action=cParserAction, oParameter=self, dest="uFTPSSL", help='Flag 0/1 to use SSL to connect to the FTP server (can be passed as ORCAFTPSSL environment var)')
     oParser.add_argument('--ftprepsourcepath', default=GetEnvVar('ORCAREPSOURCEPATH',Globals.oPathRoot.string), action=cParserAction, oParameter=self, dest="oPathRepSource", help='Changes the path for repository manager where to find the repositry files to upload (can be passed as ORCAREPSOURCEPATH environment var)')
     oParser.add_argument('--wwwserverpath', default=GetEnvVar('ORCAWWWSERVERPATH'), action=cParserAction, oParameter=self, dest="uWWWServerPath", help='Set the WWW Server path for the repository manager  (can be passed as ORCAWWWSERVERPATH environment var)')
コード例 #5
0
 def AddParameter(self, oParser):
     oParser.add_argument(
         '--irdbuser',
         default=GetEnvVar('IRDBUSER'),
         action=cParserAction,
         oParameter=self,
         dest="uIRDBUser",
         help=
         'Set the initialisation username for the IRDB (can be passed as IRDBUSER environment var)'
     )
     oParser.add_argument(
         '--irdbpassword',
         default=GetEnvVar('IRDBPASSWORD'),
         action=cParserAction,
         oParameter=self,
         dest="uIRDBPassword",
         help=
         'Set the initialisation password for the IRDB (can be passed as IRDBPASSWORD environment var)'
     )
コード例 #6
0
ファイル: Parameter.py プロジェクト: thica/ORCA-Remote
 def AddParameter(self, oParser: argparse.ArgumentParser) -> None:
     """
     Adds all valid command line arguments to the parser object
     :param oParser:
     :return:
     """
     oParser.add_argument(
         '--debugpath',
         default=GetEnvVar('DEBUGPATH'),
         action=cParserAction,
         oParameter=self,
         dest="oPathDebug",
         help=
         'Changes the path for ORCA files (can be passed as DEBUGPATH environment var)'
     )
     oParser.add_argument(
         '--logpath',
         default=GetEnvVar('ORCALOGPATH'),
         action=cParserAction,
         oParameter=self,
         dest="oPathLog",
         help=
         'Changes the path for ORCA/Kivy log files (can be passed as ORCALOGPATH environment var)'
     )
     oParser.add_argument(
         '--tmppath',
         default=GetEnvVar('ORCATMPPATH'),
         action=cParserAction,
         oParameter=self,
         dest="oPathTmp",
         help=
         'Changes the path for ORCA temp folder (can be passed as ORCATMPPATH environment var)'
     )
     oParser.add_argument(
         '--smallscreen',
         default=GetEnvVar('ORCASMALL'),
         action=cParserAction,
         oParameter=self,
         dest="bSmallScreen",
         help=
         'If set ORCA switches to small screen (can be passed as ORCASMALL environment var)'
     )
コード例 #7
0
ファイル: script.py プロジェクト: thica/ORCA-Remote
 def AddParameter(self,oParser:argparse.ArgumentParser):
     oParser.add_argument('--wikiserver',        default=GetEnvVar('ORCAWIKISERVER', 'www.mediawiki.orca-remote.org'),         action=cParserAction, oParameter=self, dest="uWikiServer",      help='Set the WWW server address for the ORCA Wikipedia (can be passed as ORCAWIKISERVER environment var)')
     oParser.add_argument('--wikipath',          default=GetEnvVar('ORCAWIKIPATH', '/'),                             action=cParserAction, oParameter=self, dest="uWikiPath",        help='Set the WWW server path for the ORCA Wikipedia (can be passed as ORCAWIKIPATH environment var)')
     oParser.add_argument('--wikiuser',          default=GetEnvVar('ORCAWIKIUSER'),                                  action=cParserAction, oParameter=self, dest="uWikiUser",        help='Set the initialisation username for the ORCA Wikipedia (can be passed as ORCAWIKIUSER environment var)')
     oParser.add_argument('--wikipassword',      default=GetEnvVar('ORCAWIKIPW'),                                    action=cParserAction, oParameter=self, dest="uWikiPassword",    help='Set the initialisation password for the ORCA Wikipedia (can be passed as ORCAWIKIPW environment var)')
     oParser.add_argument('--wikitargetfolder',  default=GetEnvVar('ORCAWIKITARGETFOLDER',Globals.oPathTmp.string),  action=cParserAction, oParameter=self, dest="uWikiTargetFolder",help='Sets local folder for the wiki files')
     oParser.add_argument('--wikiapp',           default=GetEnvVar('ORCAWIKIAPP',"MEDIAWIKI"),                       action=cParserAction, oParameter=self, dest="uWikiApp",         help='Sets the target for the wiki files (MEDIAWIKI or GITWIKI)')
コード例 #8
0
 def AddParameter(self, oParser):
     oParser.add_argument(
         '--debugpath',
         default=GetEnvVar('DEBUGPATH'),
         action=cParserAction,
         oParameter=self,
         dest="oPathDebug",
         help=
         'Changes the path for ORCA files (can be passed as DEBUGPATH environment var)'
     )
     oParser.add_argument(
         '--logpath',
         default=GetEnvVar('ORCALOGPATH'),
         action=cParserAction,
         oParameter=self,
         dest="oPathLog",
         help=
         'Changes the path for ORCA/Kivy log files (can be passed as ORCALOGPATH environment var)'
     )
     oParser.add_argument(
         '--tmppath',
         default=GetEnvVar('ORCATMPPATH'),
         action=cParserAction,
         oParameter=self,
         dest="oPathTmp",
         help=
         'Changes the path for ORCA temp folder (can be passed as ORCATMPPATH environment var)'
     )
     oParser.add_argument(
         '--showborders',
         default=GetEnvVar('ORCASHOWBORDERS'),
         action=cParserAction,
         oParameter=self,
         dest="bShowBorders",
         help=
         'Flag 0/1 to show borders around all widgets (can be passed as ORCASHOWBORDERS environment var)'
     )
コード例 #9
0
def GetSystemTmpPath() -> cPath:
    """ Gets the path to the tmp folder """
    oPath: cPath

    oPath = cPath(GetEnvVar(u"TMP"))
    if oPath.Exists():
        return oPath

    oPath = OS_GetSystemUserPath() + "\\AppData\\Local\\Temp"
    if oPath.Exists():
        return oPath

    oPath = Globals.oPathUserDownload + "orcatmp"

    oPath.Create()
    return oPath