| LEFT | RIGHT |
| 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-2017 eyeo GmbH | 2 # Copyright (C) 2006-2017 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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 path = os.path.join(dir, filename) | 137 path = os.path.join(dir, filename) |
| 138 if os.path.isfile(path) and path not in known_files: | 138 if os.path.isfile(path) and path not in known_files: |
| 139 os.remove(path) | 139 os.remove(path) |
| 140 elif os.path.isdir(path): | 140 elif os.path.isdir(path): |
| 141 remove_unknown(path) | 141 remove_unknown(path) |
| 142 if not os.listdir(path): | 142 if not os.listdir(path): |
| 143 os.rmdir(path) | 143 os.rmdir(path) |
| 144 remove_unknown(output_dir) | 144 remove_unknown(output_dir) |
| 145 | 145 |
| 146 if __name__ == '__main__': | 146 if __name__ == '__main__': |
| 147 parser = ArgumentParser() | 147 parser = ArgumentParser('Convert website source to static website') |
| 148 parser.add_argument('-r', '--rev', | 148 parser.add_argument('-r', '--rev', |
| 149 help='see "hg help revisions" for more details', | 149 help=('Specify which revision to generate from. ' |
| 150 'See "hg help revisions" for details.'), |
| 150 default='default') | 151 default='default') |
| 151 parser.add_argument('source', help="Path to your website's repository") | 152 parser.add_argument('source', help="Path to website's repository") |
| 152 parser.add_argument('output', help='Path to the desired output directory') | 153 parser.add_argument('output', help='Path to desired output directory') |
| 153 args = parser.parse_args() | 154 args = parser.parse_args() |
| 154 generate_pages(args.source, args.output, args.rev) | 155 generate_pages(args.source, args.output, args.rev) |
| LEFT | RIGHT |