Merge "show tips when there is no os file path"
This commit is contained in:
@@ -115,12 +115,15 @@ def get_version_files():
|
||||
ver_path = get_version_path()
|
||||
ver_files = []
|
||||
ver_file_format = ['.iso']
|
||||
items = os.listdir(ver_path)
|
||||
for item in items:
|
||||
full_path = os.path.join(ver_path, item)
|
||||
if os.path.isfile(full_path) \
|
||||
and os.path.splitext(full_path)[1] in ver_file_format:
|
||||
ver_files.append(item)
|
||||
try:
|
||||
items = os.listdir(ver_path)
|
||||
for item in items:
|
||||
full_path = os.path.join(ver_path, item)
|
||||
if os.path.isfile(full_path) \
|
||||
and os.path.splitext(full_path)[1] in ver_file_format:
|
||||
ver_files.append(item)
|
||||
except Exception, e:
|
||||
ver_files = []
|
||||
return ver_files
|
||||
|
||||
|
||||
|
||||
@@ -27,12 +27,14 @@ def get_files():
|
||||
VER_PATH = get_version_path()
|
||||
|
||||
files = []
|
||||
items = os.listdir(VER_PATH)
|
||||
|
||||
for item in items:
|
||||
full_path = os.path.join(VER_PATH, item)
|
||||
if os.path.isfile(full_path):
|
||||
files.append(item)
|
||||
try:
|
||||
items = os.listdir(VER_PATH)
|
||||
for item in items:
|
||||
full_path = os.path.join(VER_PATH, item)
|
||||
if os.path.isfile(full_path):
|
||||
files.append(item)
|
||||
except Exception, e:
|
||||
files = ['Directory of the Version file does not exist.']
|
||||
|
||||
return files
|
||||
|
||||
|
||||
Reference in New Issue
Block a user