[tor-commits] [gettor/master] Remove redundant filename check

ilv at torproject.org ilv at torproject.org
Mon Feb 15 20:06:58 UTC 2016


commit a34db1d2c957c1d28130d39ddc4190a5c7ccd684
Author: aagbsn <aagbsn at extc.org>
Date:   Fri Feb 5 19:02:34 2016 +0000

    Remove redundant filename check
---
 upload/bundles2drive.py   | 12 +++---------
 upload/bundles2dropbox.py | 12 +++---------
 2 files changed, 6 insertions(+), 18 deletions(-)

diff --git a/upload/bundles2drive.py b/upload/bundles2drive.py
index e6ad04b..0acada5 100644
--- a/upload/bundles2drive.py
+++ b/upload/bundles2drive.py
@@ -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
diff --git a/upload/bundles2dropbox.py b/upload/bundles2dropbox.py
index 9007410..40157bc 100644
--- a/upload/bundles2dropbox.py
+++ b/upload/bundles2dropbox.py
@@ -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:





More information about the tor-commits mailing list