Skip to content

Commit

Permalink
Improve findSimilarVer
Browse files Browse the repository at this point in the history
  • Loading branch information
zam1024t committed Sep 16, 2018
1 parent bbbf6ca commit c036c7b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Localize.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -93,12 +93,14 @@ def getLink(locale):
return locale return locale


def findSimilarVer(): def findSimilarVer():
sVer = '' sVer = 0
for item in os.listdir(mDir): for item in os.listdir(mDir):
subDir = os.path.join(mDir, item) subDir = os.path.join(mDir, item)
if os.path.isdir(subDir) and item.isdigit() and item < version: if item.isdigit() and os.path.isdir(subDir):
sVer = item int_item = int(item)
return sVer if int_item > sVer and int_item < int(version):
sVer = int_item
return str(sVer)


def isset(dict, key): def isset(dict, key):
try: try:
Expand Down

0 comments on commit c036c7b

Please sign in to comment.