فهرست منبع

Improve documentation re ignores.

Jelmer Vernooij 7 سال پیش
والد
کامیت
e10c39a00b
2فایلهای تغییر یافته به همراه8 افزوده شده و 5 حذف شده
  1. 1 3
      NEWS
  2. 7 2
      dulwich/ignore.py

+ 1 - 3
NEWS

@@ -17,9 +17,7 @@
  IMPROVEMENTS
 
   * Add basic support for reading ignore files in ``dulwich.ignore``.
-    Note that this is not yet hooked into the other parts of Dulwich,
-    and not all gitignore patterns are currently supported. See
-    the TODOs at the top of dulwich/ignore.py.
+    Note that this is not yet hooked into the other parts of Dulwich.
     (Jelmer Vernooij, #524)
 
  DOCUMENTATION

+ 7 - 2
dulwich/ignore.py

@@ -36,7 +36,7 @@ def translate(pat):
 
     res = ''
 
-    if not '/' in pat:
+    if '/' not in pat:
         # If there's no slash, this is a filename-based match
         res = '(.*\/)?'
 
@@ -161,7 +161,12 @@ class IgnoreFilterStack(object):
         self._filters = filters
 
     def is_ignored(self, path):
-        """Check whether a path is explicitly included or excluded in ignores."""
+        """Check whether a path is explicitly included or excluded in ignores.
+
+        :param path: Path to check
+        :return: None if the file is not mentioned, True if it is included,
+            False if it is explicitly excluded.
+        """
         status = None
         for filter in self._filters:
             status = filter.is_ignored(path)