This repository was archived by the owner on Jan 27, 2023. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55import sys
66import inspect
77
8+ ### Start of fixing import paths
89# realpath() with make your script run, even if you symlink it :)
910cmd_folder = os .path .realpath (os .path .abspath (os .path .split (inspect .getfile (inspect .currentframe ()))[0 ]))
1011if cmd_folder not in sys .path :
1819 # __file__ fails if script is called in different ways on Windows
1920 # __file__ fails if someone does os.chdir() before
2021 # sys.argv[0] also fails because it doesn't not always contains the path
22+ ### End of fixing import paths
2123
2224import searchengines
2325
Original file line number Diff line number Diff line change 1+ ### Start of fixing import paths
2+ import os , sys , inspect
3+ # realpath() with make your script run, even if you symlink it :)
4+ cmd_folder = os .path .realpath (os .path .abspath (os .path .split (inspect .getfile ( inspect .currentframe () ))[0 ]))
5+ if cmd_folder not in sys .path :
6+ sys .path .insert (0 , cmd_folder )
7+ # use this if you want to include modules from a subforder
8+ cmd_subfolder = os .path .realpath (os .path .abspath (os .path .join (os .path .split (inspect .getfile ( inspect .currentframe () ))[0 ],"subfolder" )))
9+ if cmd_subfolder not in sys .path :
10+ sys .path .insert (0 , cmd_subfolder )
11+ # Info:
12+ # cmd_folder = os.path.dirname(os.path.abspath(__file__)) # DO NOT USE __file__ !!!
13+ # __file__ fails if script is called in different ways on Windows
14+ # __file__ fails if someone does os.chdir() before
15+ # sys.argv[0] also fails because it doesn't not always contains the path
16+ ### End of fixing import paths
17+
118import base
219
320
Original file line number Diff line number Diff line change 1+ ### Start of fixing import paths
2+ import os , sys , inspect
3+ # realpath() with make your script run, even if you symlink it :)
4+ cmd_folder = os .path .realpath (os .path .abspath (os .path .split (inspect .getfile ( inspect .currentframe () ))[0 ]))
5+ if cmd_folder not in sys .path :
6+ sys .path .insert (0 , cmd_folder )
7+ # use this if you want to include modules from a subforder
8+ cmd_subfolder = os .path .realpath (os .path .abspath (os .path .join (os .path .split (inspect .getfile ( inspect .currentframe () ))[0 ],"subfolder" )))
9+ if cmd_subfolder not in sys .path :
10+ sys .path .insert (0 , cmd_subfolder )
11+ # Info:
12+ # cmd_folder = os.path.dirname(os.path.abspath(__file__)) # DO NOT USE __file__ !!!
13+ # __file__ fails if script is called in different ways on Windows
14+ # __file__ fails if someone does os.chdir() before
15+ # sys.argv[0] also fails because it doesn't not always contains the path
16+ ### End of fixing import paths
17+
118import base
219
320
Original file line number Diff line number Diff line change 1+ ### Start of fixing import paths
2+ import os , sys , inspect
3+ # realpath() with make your script run, even if you symlink it :)
4+ cmd_folder = os .path .realpath (os .path .abspath (os .path .split (inspect .getfile ( inspect .currentframe () ))[0 ]))
5+ if cmd_folder not in sys .path :
6+ sys .path .insert (0 , cmd_folder )
7+ # use this if you want to include modules from a subforder
8+ cmd_subfolder = os .path .realpath (os .path .abspath (os .path .join (os .path .split (inspect .getfile ( inspect .currentframe () ))[0 ],"subfolder" )))
9+ if cmd_subfolder not in sys .path :
10+ sys .path .insert (0 , cmd_subfolder )
11+ # Info:
12+ # cmd_folder = os.path.dirname(os.path.abspath(__file__)) # DO NOT USE __file__ !!!
13+ # __file__ fails if script is called in different ways on Windows
14+ # __file__ fails if someone does os.chdir() before
15+ # sys.argv[0] also fails because it doesn't not always contains the path
16+ ### End of fixing import paths
17+
118import base
219
320
Original file line number Diff line number Diff line change 1+ ### Start of fixing import paths
2+ import os , sys , inspect
3+ # realpath() with make your script run, even if you symlink it :)
4+ cmd_folder = os .path .realpath (os .path .abspath (os .path .split (inspect .getfile ( inspect .currentframe () ))[0 ]))
5+ if cmd_folder not in sys .path :
6+ sys .path .insert (0 , cmd_folder )
7+ # use this if you want to include modules from a subforder
8+ cmd_subfolder = os .path .realpath (os .path .abspath (os .path .join (os .path .split (inspect .getfile ( inspect .currentframe () ))[0 ],"subfolder" )))
9+ if cmd_subfolder not in sys .path :
10+ sys .path .insert (0 , cmd_subfolder )
11+ # Info:
12+ # cmd_folder = os.path.dirname(os.path.abspath(__file__)) # DO NOT USE __file__ !!!
13+ # __file__ fails if script is called in different ways on Windows
14+ # __file__ fails if someone does os.chdir() before
15+ # sys.argv[0] also fails because it doesn't not always contains the path
16+ ### End of fixing import paths
17+
118import base
219
320
Original file line number Diff line number Diff line change 1+ ### Start of fixing import paths
12import os , sys , inspect
23# realpath() with make your script run, even if you symlink it :)
34cmd_folder = os .path .realpath (os .path .abspath (os .path .split (inspect .getfile ( inspect .currentframe () ))[0 ]))
1213 # __file__ fails if script is called in different ways on Windows
1314 # __file__ fails if someone does os.chdir() before
1415 # sys.argv[0] also fails because it doesn't not always contains the path
16+ ### End of fixing import paths
1517
1618import base
1719
You can’t perform that action at this time.
0 commit comments