This commit is contained in:
midoks
2022-06-23 04:40:48 +08:00
parent 6f456bfd7f
commit 08b402d516
2 changed files with 24 additions and 0 deletions
+17
View File
@@ -98,6 +98,23 @@ def isAppleSystem():
return False
def isNumber(s):
try:
float(s)
return True
except ValueError:
pass
try:
import unicodedata
unicodedata.numeric(s)
return True
except (TypeError, ValueError):
pass
return False
def deleteFile(file):
if os.path.exists(file):
os.remove(file)
+7
View File
@@ -48,6 +48,13 @@ class plugins_api:
def listApi(self):
sType = request.args.get('type', '0')
sPage = request.args.get('p', '1')
if not mw.isNumber(sPage):
sPage = 1
if not mw.isNumber(sType):
sType = 0
# print sPage
data = self.getPluginList(sType, int(sPage))
return mw.getJson(data)