[Pywikipedia-l] SVN: [4882] trunk/pywikipedia/maintenance/family_check.py

borgo at svn.wikimedia.org borgo at svn.wikimedia.org
Mon Jan 14 11:34:31 UTC 2008


Revision: 4882
Author:   borgo
Date:     2008-01-14 11:34:31 +0000 (Mon, 14 Jan 2008)

Log Message:
-----------
Family_check.py now skips obsolete families before the check.

Modified Paths:
--------------
    trunk/pywikipedia/maintenance/family_check.py

Modified: trunk/pywikipedia/maintenance/family_check.py
===================================================================
--- trunk/pywikipedia/maintenance/family_check.py	2008-01-14 11:32:08 UTC (rev 4881)
+++ trunk/pywikipedia/maintenance/family_check.py	2008-01-14 11:34:31 UTC (rev 4882)
@@ -42,14 +42,15 @@
 	output(u'Checking namespaces for %s' % family.name)
 	result = {}
 	for lang in family.langs:
-		site = wikipedia.getSite(lang, family)
-		output(u'Checking %s' % site)
-		namespaces = check_namespaces(site)
-		if namespaces: 
-			for id, name, defined_namespace in namespaces:
-				output(u'Namespace %s for %s is %s, %s is defined in family file.' % \
-					(id, site, name, defined_namespace))
-			result[lang] = namespaces
+                if not family.obsolete.has_key(lang):
+        		site = wikipedia.getSite(lang, family)
+			output(u'Checking %s' % site)
+			namespaces = check_namespaces(site)
+			if namespaces: 
+				for id, name, defined_namespace in namespaces:
+					output(u'Namespace %s for %s is %s, %s is defined in family file.' % \
+						(id, site, name, defined_namespace))
+				result[lang] = namespaces
 	return result
 	
 if __name__ == '__main__':
@@ -58,4 +59,4 @@
 	result = check_family(family)
 	output(u'Writing raw Python dictionary to stdout.')
 	output(u'Format is: (namespace_id, namespace_name, predefined_namespace)')
-	print result
\ No newline at end of file
+	print result





More information about the Pywikipedia-l mailing list