Index: trunk/tools/editor_trends/wikitree/xml.py |
— | — | @@ -18,7 +18,8 @@ |
19 | 19 | __version__ = '0.1' |
20 | 20 | |
21 | 21 | from utils import utils |
22 | | -import settings |
| 22 | +import configuration |
| 23 | +settings = configuration.Settings() |
23 | 24 | |
24 | 25 | |
25 | 26 | def convert_html_entities(text): |
— | — | @@ -27,7 +28,7 @@ |
28 | 29 | |
29 | 30 | def extract_text(elem, kwargs): |
30 | 31 | if elem != None and elem.text != None: |
31 | | - return elem.text.decode(settings.ENCODING) |
| 32 | + return elem.text.decode(settings.encoding) |
32 | 33 | return None |
33 | 34 | |
34 | 35 | |
Index: trunk/tools/editor_trends/run.py |
— | — | @@ -1,5 +1,6 @@ |
2 | 2 | import os |
3 | | -import settings |
| 3 | +import configuration |
| 4 | +settings = configuration.Settings() |
4 | 5 | #from utils import namespace_downloader as nd |
5 | 6 | #nd.launch_downloader() |
6 | 7 | |
— | — | @@ -28,8 +29,8 @@ |
29 | 30 | #from database import launcher |
30 | 31 | #launcher.launcher() |
31 | 32 | 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') |
34 | 35 | dbname = 'enwiki' |
35 | 36 | #sort.debug_mergesort_feeder(input, output) |
36 | 37 | #sort.mergesort_launcher(input, output) |
— | — | @@ -43,7 +44,8 @@ |
44 | 45 | cohort_charts.prepare_cohort_dataset() |
45 | 46 | import os |
46 | 47 | |
47 | | -import settings |
| 48 | +import configuration |
| 49 | +settings = configuration.Settings() |
48 | 50 | #from utils import namespace_downloader as nd |
49 | 51 | #nd.launch_downloader() |
50 | 52 | |
— | — | @@ -71,10 +73,10 @@ |
72 | 74 | |
73 | 75 | #from database import launcher |
74 | 76 | #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') |
78 | 80 | dbname = 'enwiki' |
79 | 81 | #sort.debug_mergesort_feeder(input, output) |
80 | 82 | #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 @@ |
2 | 2 | import re |
3 | | -import settings |
| 3 | +import configuration |
| 4 | +settings = configuration.Settings() |
4 | 5 | |
5 | 6 | try: |
6 | 7 | import psyco |
— | — | @@ -28,7 +29,7 @@ |
29 | 30 | 'name.txt': fh3 |
30 | 31 | } |
31 | 32 | for handle, var in handles.iteritems(): |
32 | | - var = codecs.open(handle, 'w', encoding=settings.ENCODING) |
| 33 | + var = codecs.open(handle, 'w', encoding=settings.encoding) |
33 | 34 | |
34 | 35 | return handles |
35 | 36 | |