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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 for filename in files: | 115 for filename in files: |
116 path = os.path.join(dir, filename) | 116 path = os.path.join(dir, filename) |
117 if os.path.isfile(path) and path not in known_files: | 117 if os.path.isfile(path) and path not in known_files: |
118 os.remove(path) | 118 os.remove(path) |
119 elif os.path.isdir(path): | 119 elif os.path.isdir(path): |
120 remove_unknown(path) | 120 remove_unknown(path) |
121 if not os.listdir(path): | 121 if not os.listdir(path): |
122 os.rmdir(path) | 122 os.rmdir(path) |
123 remove_unknown(output_dir) | 123 remove_unknown(output_dir) |
124 | 124 |
| 125 |
125 if __name__ == '__main__': | 126 if __name__ == '__main__': |
126 parser = ArgumentParser('Convert website source to static website') | 127 parser = ArgumentParser('Convert website source to static website') |
127 parser.add_argument('-r', '--rev', | 128 parser.add_argument('-r', '--rev', |
128 help=('Specify which revision to generate from. ' | 129 help=('Specify which revision to generate from. ' |
129 'See "hg help revisions" for details.'), | 130 'See "hg help revisions" for details.'), |
130 default='default') | 131 default='default') |
131 parser.add_argument('source', help="Path to website's repository") | 132 parser.add_argument('source', help="Path to website's repository") |
132 parser.add_argument('output', help='Path to desired output directory') | 133 parser.add_argument('output', help='Path to desired output directory') |
133 args = parser.parse_args() | 134 args = parser.parse_args() |
134 generate_pages(args.source, args.output, args.rev) | 135 generate_pages(args.source, args.output, args.rev) |
OLD | NEW |