Commit a34db1d2 authored by aagbsn's avatar aagbsn
Browse files

Remove redundant filename check

parent 8a99835c
......@@ -50,25 +50,19 @@ def upload_files(client, basedir):
"""
files = []
p = re.compile('.*\.tar.xz$')
for name in os.listdir(basedir):
path = os.path.abspath(os.path.join(basedir, name))
if os.path.isfile(path) and p.match(path)\
and valid_format(name, 'linux'):
if os.path.isfile(path) and valid_format(name, 'linux'):
files.append(name)
p = re.compile('.*\.exe$')
for name in os.listdir(basedir):
path = os.path.abspath(os.path.join(basedir, name))
if os.path.isfile(path) and p.match(path)\
and valid_format(name, 'windows'):
if os.path.isfile(path) and valid_format(name, 'windows'):
files.append(name)
p = re.compile('.*\.dmg$')
for name in os.listdir(basedir):
path = os.path.abspath(os.path.join(basedir, name))
if os.path.isfile(path) and p.match(path)\
and valid_format(name, 'osx'):
if os.path.isfile(path) and valid_format(name, 'osx'):
files.append(name)
# dictionary to store file names and IDs
......
......@@ -39,25 +39,19 @@ def upload_files(basedir, client):
"""
files = []
p = re.compile('.*\.tar.xz$')
for name in os.listdir(basedir):
path = os.path.abspath(os.path.join(basedir, name))
if os.path.isfile(path) and p.match(path)\
and valid_format(name, 'linux'):
if os.path.isfile(path) and valid_format(name, 'linux'):
files.append(name)
p = re.compile('.*\.exe$')
for name in os.listdir(basedir):
path = os.path.abspath(os.path.join(basedir, name))
if os.path.isfile(path) and p.match(path)\
and valid_format(name, 'windows'):
if os.path.isfile(path) and valid_format(name, 'windows'):
files.append(name)
p = re.compile('.*\.dmg$')
for name in os.listdir(basedir):
path = os.path.abspath(os.path.join(basedir, name))
if os.path.isfile(path) and p.match(path)\
and valid_format(name, 'osx'):
if os.path.isfile(path) and valid_format(name, 'osx'):
files.append(name)
for file in files:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment