Index: trunk/tools/editor_trends/etl/downloader.py |
— | — | @@ -28,6 +28,7 @@ |
29 | 29 | |
30 | 30 | from utils import file_utils |
31 | 31 | from utils import http_utils |
| 32 | +from utils import text_utils |
32 | 33 | from utils import log |
33 | 34 | |
34 | 35 | def download_wiki_file(task_queue, properties): |
— | — | @@ -52,15 +53,15 @@ |
53 | 54 | properties.dump_relative_path, |
54 | 55 | filename) |
55 | 56 | |
56 | | - mod_rem = http_utils.determine_modified_date(properties.settings.wp_dump_location, |
| 57 | + mod_date = http_utils.determine_modified_date(properties.settings.wp_dump_location, |
57 | 58 | properties.dump_relative_path, |
58 | 59 | filename) |
59 | | - |
| 60 | + mod_date = text_utils.convert_timestamp_to_datetime_naive(mod_date, properties.settings.timestamp_server) |
60 | 61 | if file_utils.check_file_exists(properties.location, filename): |
61 | 62 | #This can be activated as soon as bug 21575 is fixed. |
62 | 63 | properties.force = True |
63 | 64 | mod_loc = file_utils.get_modified_date(properties.location, filename) |
64 | | - if mod_loc != mod_rem and properties.force == False: |
| 65 | + if mod_loc != mod_date and properties.force == False: |
65 | 66 | print 'You already have downloaded the most recent %s%s dumpfile.' % (properties.language.code, properties.project.name) |
66 | 67 | break |
67 | 68 | |
— | — | @@ -97,7 +98,7 @@ |
98 | 99 | success = False |
99 | 100 | finally: |
100 | 101 | fh.close() |
101 | | - file_utils.set_modified_data(mod_rem, properties.location, filename) |
| 102 | + file_utils.set_modified_data(mod_date, properties.location, filename) |
102 | 103 | |
103 | 104 | return success |
104 | 105 | |
— | — | @@ -124,7 +125,7 @@ |
125 | 126 | |
126 | 127 | tasks.join() |
127 | 128 | for consumer in consumers: |
128 | | - if consumer.exitcode != 0 and consumer.exitcode != None: |
| 129 | + if consumer.exitcode != 0: |
129 | 130 | result = False |
130 | 131 | |
131 | 132 | return result |
Index: trunk/tools/editor_trends/utils/file_utils.py |
— | — | @@ -236,9 +236,9 @@ |
237 | 237 | ''' |
238 | 238 | path = os.path.join(location, filename) |
239 | 239 | print mod_rem |
240 | | - mod_rem = text_utils.convert_timestamp_to_datetime_naive(mod_rem, settings.timestamp_format) |
| 240 | + #smod_rem = text_utils.convert_timestamp_to_datetime_naive(mod_rem, settings.timestamp_format) |
241 | 241 | os.utime(path, (mod_rem, mod_rem)) |
242 | | - raise exceptions.NotYetImplementedError(set_modified_data) |
| 242 | + #sraise exceptions.NotYetImplementedError(set_modified_data) |
243 | 243 | |
244 | 244 | def get_modified_date(location, filename): |
245 | 245 | path = os.path.join(location, filename) |