r76858 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r76857‎ | r76858 | r76859 >
Date:23:51, 16 November 2010
Author:diederik
Status:deferred
Tags:
Comment:
Forgot to commit.
Modified paths:
  • /trunk/tools/editor_trends/algorithms/red_wiki_editors.py (modified) (history)
  • /trunk/tools/editor_trends/run.py (modified) (history)
  • /trunk/tools/editor_trends/wikitree/xml.py (modified) (history)

Diff [purge]

Index: trunk/tools/editor_trends/wikitree/xml.py
@@ -18,7 +18,8 @@
1919 __version__ = '0.1'
2020
2121 from utils import utils
22 -import settings
 22+import configuration
 23+settings = configuration.Settings()
2324
2425
2526 def convert_html_entities(text):
@@ -27,7 +28,7 @@
2829
2930 def extract_text(elem, kwargs):
3031 if elem != None and elem.text != None:
31 - return elem.text.decode(settings.ENCODING)
 32+ return elem.text.decode(settings.encoding)
3233 return None
3334
3435
Index: trunk/tools/editor_trends/run.py
@@ -1,5 +1,6 @@
22 import os
3 -import settings
 3+import configuration
 4+settings = configuration.Settings()
45 #from utils import namespace_downloader as nd
56 #nd.launch_downloader()
67
@@ -28,8 +29,8 @@
2930 #from database import launcher
3031 #launcher.launcher()
3132 from utils import sort
32 -input = os.path.join(settings.XML_FILE_LOCATION, 'en', 'wiki', 'txt')
33 -output = os.path.join(settings.XML_FILE_LOCATION, 'en', 'wiki', 'sorted')
 33+input = os.path.join(settings.input_location, 'en', 'wiki', 'txt')
 34+output = os.path.join(settings.input_location, 'en', 'wiki', 'sorted')
3435 dbname = 'enwiki'
3536 #sort.debug_mergesort_feeder(input, output)
3637 #sort.mergesort_launcher(input, output)
@@ -43,7 +44,8 @@
4445 cohort_charts.prepare_cohort_dataset()
4546 import os
4647
47 -import settings
 48+import configuration
 49+settings = configuration.Settings()
4850 #from utils import namespace_downloader as nd
4951 #nd.launch_downloader()
5052
@@ -71,10 +73,10 @@
7274
7375 #from database import launcher
7476 #launcher.launcher()
75 -from utils import sort
76 -input = os.path.join(settings.XML_FILE_LOCATION, 'en', 'wiki', 'txt')
77 -output = os.path.join(settings.XML_FILE_LOCATION, 'en', 'wiki', 'sorted')
 77+from etl import loader
 78+input = os.path.join(settings.input_location, 'en', 'wiki', 'txt')
 79+output = os.path.join(settings.input_location, 'en', 'wiki', 'sorted')
7880 dbname = 'enwiki'
7981 #sort.debug_mergesort_feeder(input, output)
8082 #sort.mergesort_launcher(input, output)
81 -sort.mergesort_external_launcher(dbname, output, output)
\ No newline at end of file
 83+loader.mergesort_external_launcher(dbname, output, output)
\ No newline at end of file
Index: trunk/tools/editor_trends/algorithms/red_wiki_editors.py
@@ -1,5 +1,6 @@
22 import re
3 -import settings
 3+import configuration
 4+settings = configuration.Settings()
45
56 try:
67 import psyco
@@ -28,7 +29,7 @@
2930 'name.txt': fh3
3031 }
3132 for handle, var in handles.iteritems():
32 - var = codecs.open(handle, 'w', encoding=settings.ENCODING)
 33+ var = codecs.open(handle, 'w', encoding=settings.encoding)
3334
3435 return handles
3536

Status & tagging log