Skip to content

Commit

Permalink
fix: optimize File path formats. Easier to run with crontab
Browse files Browse the repository at this point in the history
  • Loading branch information
caiyuhu committed Nov 21, 2022
1 parent 589199b commit e27ca3d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import json
from urllib3.exceptions import InsecureRequestWarning
import argparse
import os

BLOCK_SIZE = 16 # Bytes
def pad(s): return s + (BLOCK_SIZE - len(s) % BLOCK_SIZE) * \
Expand Down Expand Up @@ -129,8 +130,9 @@ def main(users):


if __name__ == "__main__":
config_path = os.path.join(os.path.dirname(__file__), 'config.json')
parser = argparse.ArgumentParser(prog='Chao Xing seat auto reserve')
parser.add_argument('-u','--user', default="config.json")
parser.add_argument('-u','--user', default=config_path, help='user config file')
args = parser.parse_args()
with open(args.user, "r+") as data:
userdata = json.load(data)["reserve"]
Expand Down

0 comments on commit e27ca3d

Please sign in to comment.