mirror of
https://github.com/Jylpah/blitz-tools.git
synced 2026-10-23 19:19:53 +02:00
do chdir() to read config files correctly
This commit is contained in:
1 parent
cd93f815bd
commit
b8546fabf9
3 files changed
+7
-1
No files matched your search
@@ -17,7 +17,9 @@ wg = None
|
|||||||
## main() -------------------------------------------------------------
|
## main() -------------------------------------------------------------
|
||||||
async def main(argv):
|
async def main(argv):
|
||||||
global wg
|
global wg
|
||||||
|
# set the directory for the script
|
||||||
|
os.chdir(os.path.dirname(sys.argv[0]))
|
||||||
|
|
||||||
parser = argparse.ArgumentParser(description='Extract Tankopedia data from Blitz game files')
|
parser = argparse.ArgumentParser(description='Extract Tankopedia data from Blitz game files')
|
||||||
parser.add_argument('blitzAppBase', type=str, metavar="BLITZAPP_FOLDER", default=".", help='Base dir of the Blitz App files')
|
parser.add_argument('blitzAppBase', type=str, metavar="BLITZAPP_FOLDER", default=".", help='Base dir of the Blitz App files')
|
||||||
parser.add_argument('tanks', type=str, default='tanks.json', nargs='?', metavar="TANKS_FILE", help='File to write Tankopedia')
|
parser.add_argument('tanks', type=str, default='tanks.json', nargs='?', metavar="TANKS_FILE", help='File to write Tankopedia')
|
||||||
|
|||||||
@@ -49,6 +49,8 @@ async def get_tankopedia(filename: str):
|
|||||||
|
|
||||||
def main(argv):
|
def main(argv):
|
||||||
global VERBOSE, DEBUG
|
global VERBOSE, DEBUG
|
||||||
|
# set the directory for the script
|
||||||
|
os.chdir(os.path.dirname(sys.argv[0]))
|
||||||
|
|
||||||
parser = argparse.ArgumentParser(description='Retrieve Tankopedia from WoTinspector.com')
|
parser = argparse.ArgumentParser(description='Retrieve Tankopedia from WoTinspector.com')
|
||||||
parser.add_argument('--file', dest="outfile", help='Write Tankopedia to file')
|
parser.add_argument('--file', dest="outfile", help='Write Tankopedia to file')
|
||||||
|
|||||||
@@ -25,6 +25,8 @@ wi = None
|
|||||||
|
|
||||||
async def main(argv):
|
async def main(argv):
|
||||||
global wg, wi
|
global wg, wi
|
||||||
|
# set the directory for the script
|
||||||
|
os.chdir(os.path.dirname(sys.argv[0]))
|
||||||
|
|
||||||
## Read config
|
## Read config
|
||||||
config = configparser.ConfigParser()
|
config = configparser.ConfigParser()
|
||||||
|
|||||||
Reference in new issue
Block a user