mail[Wesnoth-commits] r24639 - /trunk/data/tools/wesnoth/campaignserver_client.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by esr on March 14, 2008 - 16:24:
Author: esr
Date: Fri Mar 14 16:24:55 2008
New Revision: 24639

URL: http://svn.gna.org/viewcvs/wesnoth?rev=24639&view=rev
Log:
Use endswith for all excluded-suffix checks.

Modified:
    trunk/data/tools/wesnoth/campaignserver_client.py

Modified: trunk/data/tools/wesnoth/campaignserver_client.py
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/tools/wesnoth/campaignserver_client.py?rev=24639&r1=24638&r2=24639&view=diff
==============================================================================
--- trunk/data/tools/wesnoth/campaignserver_client.py (original)
+++ trunk/data/tools/wesnoth/campaignserver_client.py Fri Mar 14 16:24:55 2008
@@ -4,6 +4,8 @@
 class CampaignClient:
     # First port listed will be used as default.
     portmap = (("15003", "1.3.x"), ("15004", "1.2.x"), ("15005", "1.4.x"))
+    # Files with these suffixes will not be downloaded
+    excluded = ("~", "-bak", ".pbl", ".exe", ".com", ".bat", ".scr", ".sh")
 
     def __init__(self, address = None):
         """
@@ -314,9 +316,7 @@
             for fn in glob.glob(path + "/*"):
                 if os.path.isdir(fn):
                     sub = put_dir(os.path.basename(fn), fn)
-                elif fn.endswith("~") or fn.endswith("-bak") or \
-                     ".pbl" in fn or ".exe" in fn or ".com" in fn or \
-                     ".bat" in fn or ".scr" in fn or ".sh" in fn:
+                elif filter(lambda x: fn.endswith(x), 
CampaignClient.excluded):
                     continue
                 else:
                     sub = put_file(os.path.basename(fn), file(fn))




Related Messages


Powered by MHonArc, Updated Fri Mar 14 17:41:39 2008