[svnbook commit] r1605 - trunk/src/es

gradha svnbook-dev at red-bean.com
Sat Aug 13 19:36:21 CDT 2005


Author: gradha
Date: Sat Aug 13 19:36:20 2005
New Revision: 1605

Modified:
   trunk/src/es/author_statistics.py
   trunk/src/es/weekly_report.py
Log:
Book Spanish. Updated support scripts: now the author_statistics
module doesn't use hardcoded author lists. Therefore, the input
given by weekly_report from the TRABAJO file won't be ignored.


Modified: trunk/src/es/author_statistics.py
==============================================================================
--- trunk/src/es/author_statistics.py	(original)
+++ trunk/src/es/author_statistics.py	Sat Aug 13 19:36:20 2005
@@ -21,7 +21,7 @@
 
 
 # Some globals.
-LOOKING_FOR = ["gradha", "ruben", "beerfrick", "dbrouard"]
+LOOKING_FOR = []
 STATISTICS = []
 COMMIT_NUMBER = 0
 SECONDS_A_DAY = 60 * 60 * 24
@@ -141,6 +141,11 @@
     their last commited change data, and indicates how many days
     ago that was. Not found authors will assigned the earliest log
     date found.
+
+    NOTE: This method is just a "test", it shouldn't be used directly
+    unless you know what you are doing. Mainly, it is messing around
+    with the LOOKING_FOR global, which real users shouldn't touch.
+    Only look how it calls obtain_statistics() to process the data.
     """
     request = [author for author, date in STATISTICS] + LOOKING_FOR
     request.sort()
@@ -196,14 +201,21 @@
     stdout.readlines()
 
 
-def obtain_information():
+def obtain_information(author_list):
     """Fills data into the STATISTICS and STATE global variables.
 
     Creates an expat parser, runs the external 'svn log' command
     and connects its output to the XML parsing of expat. Commit
     information about the authors and the whole progress of the
     project will be gathered.
+
+    The author list is copied into the global LOOKING_FOR, and
+    modified during parsing. After this call, LOOKING_FOR will only
+    contain the names of the authors who don't appear in the log
+    (which is useful if you call print_statistics() too).
     """
+    global LOOKING_FOR
+    LOOKING_FOR = author_list[:]
     p = xml.parsers.expat.ParserCreate()
     
     p.StartElementHandler = start_element
@@ -235,7 +247,7 @@
     end of the operation, statistics are printed.
     """
     update_working_copy()
-    obtain_information()
+    obtain_information(["gradha", "ruben", "unknown"])
     print_statistics()
     
 

Modified: trunk/src/es/weekly_report.py
==============================================================================
--- trunk/src/es/weekly_report.py	(original)
+++ trunk/src/es/weekly_report.py	Sat Aug 13 19:36:20 2005
@@ -138,12 +138,13 @@
 
     Reads the file TRABAJO, parses it, and generates a report.
     """
-    author_statistics.obtain_information()
     file_input = file("TRABAJO", "rt")
     input_lines = file_input.readlines()
     file_input.close()
 
     commiters, file_status = parse_file(input_lines)
+    # Use external module to find out commit statistics.
+    author_statistics.obtain_information(commiters.keys())
 
     date = time.strftime("día %d del mes %m del %Y", time.localtime())
     print "Estado de la traducción, a %s\n" % date



More information about the svnbook-dev mailing list