]> granicus.if.org Git - python/commitdiff
Allow either README or README.txt as a "standard file".
authorGreg Ward <gward@python.net>
Sun, 30 Jan 2000 20:22:27 +0000 (20:22 +0000)
committerGreg Ward <gward@python.net>
Sun, 30 Jan 2000 20:22:27 +0000 (20:22 +0000)
Lib/distutils/command/dist.py

index 76332b2751317a7e37f0aebbe40f308897e622f6..ea61a4806e3f73fde09d719eaa696ecc5dc8a556 100644 (file)
@@ -219,12 +219,24 @@ class Dist (Command):
 
     def find_defaults (self):
 
-        standards = ['README', 'setup.py']
+        standards = [('README', 'README.txt'), 'setup.py']
         for fn in standards:
-            if os.path.exists (fn):
-                self.files.append (fn)
+            if type (fn) is TupleType:
+                alts = fn
+                for fn in alts:
+                    if os.path.exists (fn):
+                        got_it = 1
+                        self.files.append (fn)
+                        break
+
+                if not got_it:
+                    self.warn ("standard file not found: should have one of " +
+                               string.join (alts, ', '))
             else:
-                self.warn ("standard file %s not found" % fn)
+                if os.path.exists (fn):
+                    self.files.append (fn)
+                else:
+                    self.warn ("standard file %s not found" % fn)
 
         optional = ['test/test*.py']
         for pattern in optional: