Rev 34: Merge vitaliy.kulikov's .java addition in http://bazaar.launchpad.net/~bzr/bzr-stats/trunk

John Arbash Meinel john at arbash-meinel.com
Fri Jan 15 21:53:11 GMT 2010


At http://bazaar.launchpad.net/~bzr/bzr-stats/trunk

------------------------------------------------------------
revno: 34 [merge]
revision-id: john at arbash-meinel.com-20100115215250-hmrp4yeu2ty035nl
parent: john at arbash-meinel.com-20100115215102-1nuu51oweckdtw9t
parent: vitaliy.kulikov-20091102210204-vd30mhh5v5fswl6o
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: trunk
timestamp: Fri 2010-01-15 15:52:50 -0600
message:
  Merge vitaliy.kulikov's .java addition
modified:
  classify.py                    classify.py-20080628185133-8xhhatnjpbn0efxq-1
-------------- next part --------------
=== modified file 'classify.py'
--- a/classify.py	2008-09-29 16:24:00 +0000
+++ b/classify.py	2010-01-15 21:52:50 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 2008 Jelmer Vernooij <jelmer at samba.org>
+# Copyright (C) 2008, 2010 Jelmer Vernooij <jelmer at samba.org>
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -23,14 +23,17 @@
 
 def classify_filename(name):
     """Classify a file based on its name.
-    
+
     :param name: File path.
-    :return: One of code, documentation, translation or art. 
+    :return: One of code, documentation, translation or art.
         None if determining the file type failed.
     """
-    # FIXME: Use mime types? Ohcount? 
+    # FIXME: Use mime types? Ohcount?
+    # TODO: It will be better move those filters to properties file
+	# and have possibility to determining own types !?
     extension = os.path.splitext(name)[1]
-    if extension in (".c", ".h", ".py", ".cpp", ".rb", ".pm", ".pl", ".ac"):
+    if extension in (".c", ".h", ".py", ".cpp", ".rb", ".pm", ".pl", ".ac",
+                        ".java"):
         return "code"
     if extension in (".html", ".xml", ".txt", ".rst", ".TODO"):
         return "documentation"
@@ -40,7 +43,7 @@
         return "art"
     if not extension:
         basename = urlutils.basename(name)
-        if basename in ("README", "NEWS", "TODO", 
+        if basename in ("README", "NEWS", "TODO",
                         "AUTHORS", "COPYING"):
             return "documentation"
         if basename in ("Makefile",):
@@ -56,7 +59,7 @@
     :param delta: A TreeDelta to inspect
     :return: List with classes found (see classify_filename)
     """
-    # TODO: This is inaccurate, since it doesn't look at the 
+    # TODO: This is inaccurate, since it doesn't look at the
     # number of lines changed in a file.
     types = []
     for d in delta.added + delta.modified:



More information about the bazaar-commits mailing list