gzz-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gzz-commits] navidoc navidoc/util/path.py test/jython.test t...


From: Asko Soukka
Subject: [Gzz-commits] navidoc navidoc/util/path.py test/jython.test t...
Date: Mon, 02 Jun 2003 09:58:14 -0400

CVSROOT:        /cvsroot/navidoc
Module name:    navidoc
Changes by:     Asko Soukka <address@hidden>    03/06/02 09:58:14

Modified files:
        navidoc/util   : path.py 
        test           : jython.test 
Added files:
        test           : path.test 

Log message:
        some

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/navidoc/navidoc/navidoc/util/path.py.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/navidoc/navidoc/test/path.test?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/navidoc/navidoc/test/jython.test.diff?tr1=1.1&tr2=1.2&r1=text&r2=text

Patches:
Index: navidoc/navidoc/util/path.py
diff -u navidoc/navidoc/util/path.py:1.2 navidoc/navidoc/util/path.py:1.3
--- navidoc/navidoc/util/path.py:1.2    Mon Apr 28 04:27:34 2003
+++ navidoc/navidoc/util/path.py        Mon Jun  2 09:58:14 2003
@@ -19,7 +19,7 @@
 # MA  02111-1307  USA
 # 
 
-#$Id: path.py,v 1.2 2003/04/28 08:27:34 humppake Exp $
+#$Id: path.py,v 1.3 2003/06/02 13:58:14 humppake Exp $
 
 #
 # Written by Asko Soukka
@@ -31,21 +31,28 @@
 
 def listdir(path, extensions, dirs=0):
     """
-    Returns all directories and files with specific
-    extensions under path. Nonrecursive.
+    listdir(path, extensions, dirs=0)
+
+    Quite specialized listdir, which returns all directories and files
+    with specific extensions under given path. Nonrecursive.
+
+    Skipping files starting with '.' or including some of 'CVS', '#', '~'.
     """
     files = [f for f in os.listdir(path) if not f.startswith('.')
              and not f == 'CVS' and '#' not in f and '~' not in f]
 
-    files = [f for f in files if extensions.count(f.split('.')[-1]) > 0 \
-             or os.path.isdir(slashify(path)+f)]
+    if extensions:
+        files = [f for f in files if extensions.count(f.split('.')[-1]) > 0 \
+                 or os.path.isdir(slashify(path)+f)]
     if not dirs:
         files = [f for f in files if os.path.isfile(slashify(path)+f)]
     return files
 
 def slashify(path):
     """
-    Add a trailing slash if not already there.
+    slashify(path)
+
+    Ends path with a trailing slash, if still necessary.
     """
     if len(path) > 0:
         return (path+'/').replace('//','/')
@@ -53,7 +60,10 @@
 
 def relative_path(source, target):
     """
-    Returns a relative path from the source to the target.
+    relative_path(source, target)
+
+    Returns a relative filepath from the source filepath to the target
+    filepath.
     """
     import config
     dbg = config.dbg.shorthand('path')
Index: navidoc/test/jython.test
diff -u navidoc/test/jython.test:1.1 navidoc/test/jython.test:1.2
--- navidoc/test/jython.test:1.1        Mon Jun  2 08:43:58 2003
+++ navidoc/test/jython.test    Mon Jun  2 09:58:14 2003
@@ -16,8 +16,8 @@
 # MA  02111-1307  USA
 #  
 
-def testJythonLocaleIOBug():
-       """Test Jython's file IO with umlauts.
+def test_jython_locale_IO_bug():
+       """Test Jython's file I/O with umlauts.
        
        fail: *
        """




reply via email to

[Prev in Thread] Current Thread [Next in Thread]