update
This commit is contained in:
parent
a35ae6df9e
commit
7812c4983f
|
|
@ -69,17 +69,23 @@ def getRunDir():
|
|||
def getRootDir():
|
||||
return os.path.dirname(getRunDir())
|
||||
|
||||
def getPanelDir():
|
||||
return getRootDir()
|
||||
|
||||
def getFatherDir():
|
||||
return os.path.dirname(os.path.dirname(getPanelDir()))
|
||||
|
||||
def getPluginDir():
|
||||
return getRootDir() + '/plugins'
|
||||
return getPanelDir() + '/plugins'
|
||||
|
||||
def getPanelDataDir():
|
||||
return getRootDir() + '/data'
|
||||
return getPanelDir() + '/data'
|
||||
|
||||
def getMWLogs():
|
||||
return getRootDir() + '/logs'
|
||||
return getPanelDir() + '/logs'
|
||||
|
||||
def getPanelTmp():
|
||||
return getRootDir() + '/tmp'
|
||||
return getPanelDir() + '/tmp'
|
||||
|
||||
|
||||
def getServerDir():
|
||||
|
|
@ -145,7 +151,7 @@ def isNumber(s):
|
|||
pass
|
||||
|
||||
return False
|
||||
|
||||
|
||||
def getPathSuffix(path):
|
||||
return os.path.splitext(path)[-1]
|
||||
|
||||
|
|
|
|||
|
|
@ -103,6 +103,7 @@ class MwPlugin(object):
|
|||
|
||||
def getVersion(self, path):
|
||||
version_t = path + '/version.pl'
|
||||
print(version_t)
|
||||
if os.path.exists(version_t):
|
||||
return mw.readFile(version_t).strip()
|
||||
return ''
|
||||
|
|
@ -152,11 +153,16 @@ class MwPlugin(object):
|
|||
path = ''
|
||||
coexist = False
|
||||
|
||||
if info["checks"].startswith('/'):
|
||||
checks = info["checks"]
|
||||
else:
|
||||
checks = mw.getFatherDir() + '/' + info['checks']
|
||||
|
||||
if 'path' in info:
|
||||
path = info['path']
|
||||
|
||||
if not path.startswith('/'):
|
||||
path = mw.getRootDir() + '/' + path
|
||||
path = mw.getFatherDir() + '/' + path
|
||||
|
||||
if 'coexist' in info and info['coexist']:
|
||||
coexist = True
|
||||
|
|
@ -192,9 +198,14 @@ class MwPlugin(object):
|
|||
if checks.find('VERSION') > -1:
|
||||
pInfo['install_checks'] = checks.replace('VERSION', info['versions'])
|
||||
|
||||
if path.find('VERSION') > -1:
|
||||
pInfo['path'] = path.replace('VERSION', info['versions'])
|
||||
|
||||
pInfo['display'] = self.checkDisplayIndex(info['name'], pInfo['versions'], coexist)
|
||||
pInfo['setup'] = os.path.exists(pInfo['install_checks'])
|
||||
|
||||
|
||||
|
||||
if coexist and pInfo['setup']:
|
||||
pInfo['setup_version'] = info['versions']
|
||||
else:
|
||||
|
|
|
|||
Loading…
Reference in New Issue