|
1 | | -################################################################################ |
2 | | -# # |
3 | | -# Copyright (C) 2020 Dominic Davis-Foster # |
4 | | -# # |
5 | | -# This program is free software; you can redistribute it and/or modify # |
6 | | -# it under the terms of the GNU General Public License version 2 as # |
7 | | -# published by the Free Software Foundation. # |
8 | | -# # |
9 | | -# This program is distributed in the hope that it will be useful, # |
10 | | -# but WITHOUT ANY WARRANTY; without even the implied warranty of # |
11 | | -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # |
12 | | -# GNU General Public License for more details. # |
13 | | -# # |
14 | | -# You should have received a copy of the GNU General Public License # |
15 | | -# along with this program; if not, write to the Free Software # |
16 | | -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # |
17 | | -# # |
18 | | -################################################################################ |
| 1 | +#!/usr/bin/env python3 |
| 2 | +# |
| 3 | +# __main__.py |
| 4 | +# |
| 5 | +# Copyright © 2020 Dominic Davis-Foster <dominic@davis-foster.co.uk> |
| 6 | +# |
| 7 | +# This program is free software; you can redistribute it and/or modify |
| 8 | +# it under the terms of the GNU General Public License version 2 |
| 9 | +# as published by the Free Software Foundation. |
| 10 | +# |
| 11 | +# This program is distributed in the hope that it will be useful, |
| 12 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | +# GNU General Public License for more details. |
| 15 | +# |
| 16 | +# You should have received a copy of the GNU General Public License |
| 17 | +# along with this program; if not, write to the Free Software |
| 18 | +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
| 19 | +# MA 02110-1301, USA. |
| 20 | +# |
19 | 21 |
|
20 | 22 | # stdlib |
21 | 23 | import argparse |
|
30 | 32 | from notebook2script.ipynb2py import convert_notebook |
31 | 33 | from notebook2script.pointless import Pointless |
32 | 34 |
|
33 | | -sys.path.append("..") |
34 | | -sys.path.append("../..") |
| 35 | +__all__ = ["main", "process_multiple_notebooks", "process_notebook"] |
35 | 36 |
|
36 | 37 | linter = Pointless() |
37 | 38 |
|
38 | 39 |
|
39 | 40 | def main() -> None: |
40 | | - # Strip out the current working directory from sys.path. |
41 | | - # Having the working directory in `sys.path` means that `pylint` might |
42 | | - # inadvertently import user code from modules having the same name as |
43 | | - # stdlib or pylint's own modules. |
44 | | - # CPython issue: https://bugs.python.org/issue33053 |
45 | | - if sys.path[0] == '' or sys.path[0] == os.getcwd(): |
46 | | - sys.path.pop(0) |
47 | 41 |
|
48 | 42 | parser = argparse.ArgumentParser(description="Convert Jupyter Notebooks to Python scripts") |
49 | 43 |
|
|
0 commit comments