Rev 26: Add copyright headers. in file:///data/jelmer/bzr-stats/trunk/
Jelmer Vernooij
jelmer at samba.org
Mon Aug 4 20:49:52 BST 2008
At file:///data/jelmer/bzr-stats/trunk/
------------------------------------------------------------
revno: 26
revision-id: jelmer at samba.org-20080804194951-ia3xl7up9k0gd7hj
parent: jelmer at samba.org-20080717090533-lmzdo2blnmsgam9f
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: trunk
timestamp: Mon 2008-08-04 21:49:51 +0200
message:
Add copyright headers.
modified:
__init__.py __init__.py-20060629132721-mkbaty0vfk4y3v59-1
classify.py classify.py-20080628185133-8xhhatnjpbn0efxq-1
test_classify.py test_classify.py-20080628185419-ego83y2jujmkx52r-1
=== modified file '__init__.py'
--- a/__init__.py 2008-07-17 09:05:33 +0000
+++ b/__init__.py 2008-08-04 19:49:51 +0000
@@ -1,3 +1,18 @@
+# Copyright (C) 2005-2008 Canonical Ltd
+
+# 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
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
"""A Simple bzr plugin to generate statistics about the history."""
import re
=== modified file 'classify.py'
--- a/classify.py 2008-06-28 20:07:45 +0000
+++ b/classify.py 2008-08-04 19:49:51 +0000
@@ -1,6 +1,21 @@
+# Copyright (C) 2008 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
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
"""Classify a commit based on the types of files it changed."""
-from bzrlib import urlutils
+from bzrlib import urlutils
from bzrlib.trace import mutter
@@ -12,22 +27,21 @@
None if determining the file type failed.
"""
# FIXME: Use mime types? Ohcount?
- basename = urlutils.basename(name)
- try:
- extension = basename.split(".")[1]
- if extension in ("c", "h", "py", "cpp", "rb", "ac"):
- return "code"
- if extension in ("html", "xml", "txt", "rst", "TODO"):
- return "documentation"
- if extension in ("po"):
- return "translation"
- if extension in ("svg", "png", "jpg"):
- return "art"
- except IndexError:
+ extension = os.path.splitext(name)[1]
+ if extension in (".c", ".h", ".py", ".cpp", ".rb", ".pm", ".pl", ".ac"):
+ return "code"
+ if extension in (".html", ".xml", ".txt", ".rst", ".TODO"):
+ return "documentation"
+ if extension in (".po",):
+ return "translation"
+ if extension in (".svg", ".png", ".jpg"):
+ return "art"
+ if not extension:
+ basename = urlutils.basename(name)
if basename in ("README", "NEWS", "TODO",
"AUTHORS", "COPYING"):
return "documentation"
- if basename in ("Makefile"):
+ if basename in ("Makefile",):
return "code"
mutter("don't know how to classify %s", name)
=== modified file 'test_classify.py'
--- a/test_classify.py 2008-06-28 18:54:37 +0000
+++ b/test_classify.py 2008-08-04 19:49:51 +0000
@@ -1,3 +1,18 @@
+# Copyright (C) 2008 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
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
from bzrlib.tests import TestCase
from bzrlib.plugins.stats.classify import classify_filename, classify_delta
More information about the bazaar-commits
mailing list