OLD | NEW |
1 # This file is part of the Adblock Plus web scripts, | 1 # This file is part of the Adblock Plus web scripts, |
2 # Copyright (C) 2006-present eyeo GmbH | 2 # Copyright (C) 2006-present eyeo GmbH |
3 # | 3 # |
4 # Adblock Plus is free software: you can redistribute it and/or modify | 4 # Adblock Plus is free software: you can redistribute it and/or modify |
5 # it under the terms of the GNU General Public License version 3 as | 5 # it under the terms of the GNU General Public License version 3 as |
6 # published by the Free Software Foundation. | 6 # published by the Free Software Foundation. |
7 # | 7 # |
8 # Adblock Plus is distributed in the hope that it will be useful, | 8 # Adblock Plus is distributed in the hope that it will be useful, |
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 'group': None, | 114 'group': None, |
115 'postsync': None, | 115 'postsync': None, |
116 'ignore': [] | 116 'ignore': [] |
117 } | 117 } |
118 if isinstance(result[name][setting], list): | 118 if isinstance(result[name][setting], list): |
119 result[name][setting] = get_config().get('filesync', option).split('
') | 119 result[name][setting] = get_config().get('filesync', option).split('
') |
120 else: | 120 else: |
121 result[name][setting] = get_config().get('filesync', option) | 121 result[name][setting] = get_config().get('filesync', option) |
122 return result | 122 return result |
123 | 123 |
| 124 |
124 if __name__ == '__main__': | 125 if __name__ == '__main__': |
125 setupStderr() | 126 setupStderr() |
126 | 127 |
127 syncState = ConfigParser.SafeConfigParser() | 128 syncState = ConfigParser.SafeConfigParser() |
128 syncStateFile = get_config().get('filesync', 'syncData') | 129 syncStateFile = get_config().get('filesync', 'syncData') |
129 if os.path.exists(syncStateFile): | 130 if os.path.exists(syncStateFile): |
130 syncState.read(syncStateFile) | 131 syncState.read(syncStateFile) |
131 | 132 |
132 settings = readSyncSettings() | 133 settings = readSyncSettings() |
133 for name, value in settings.iteritems(): | 134 for name, value in settings.iteritems(): |
134 syncFiles(name, value, syncState) | 135 syncFiles(name, value, syncState) |
135 | 136 |
136 file = open(syncStateFile, 'wb') | 137 file = open(syncStateFile, 'wb') |
137 syncState.write(file) | 138 syncState.write(file) |
OLD | NEW |