Skip to content

Commit

Permalink
refactor: load config dataclass natively instead of new_config()
Browse files Browse the repository at this point in the history
also remove unused "cookies" option
  • Loading branch information
yzqzss committed Apr 16, 2024
1 parent 11b021a commit 5e655bd
Showing 1 changed file with 20 additions and 21 deletions.
41 changes: 20 additions & 21 deletions wikiteam3/dumpgenerator/cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -512,27 +512,26 @@ def sleep(self, response=None):
exnamespaces = [int(i) for i in ns.split(",")]


config = new_config({
"curonly": args.curonly,
"date": datetime.datetime.utcnow().strftime("%Y%m%d"),
"api": api,
"failfast": args.failfast,
"http_method": "POST",
"api_chunksize": int(args.api_chunksize),
"index": index,
"images": args.images,
"logs": False,
"xml": args.xml,
"xmlapiexport": args.xmlapiexport,
"xmlrevisions": args.xmlrevisions or args.xmlrevisions_page,
"xmlrevisions_page": args.xmlrevisions_page,
"namespaces": namespaces,
"exnamespaces": exnamespaces,
"path": args.path and os.path.normpath(args.path) or "",
"cookies": args.cookies or "",
"delay": args.delay,
"retries": int(args.retries),
})
config = Config(
curonly = args.curonly,
date = datetime.datetime.utcnow().strftime("%Y%m%d"),
api = api,
failfast = args.failfast,
http_method = "POST",
api_chunksize = int(args.api_chunksize),
index = index,
images = args.images,
logs = False,
xml = args.xml,
xmlapiexport = args.xmlapiexport,
xmlrevisions = args.xmlrevisions or args.xmlrevisions_page,
xmlrevisions_page = args.xmlrevisions_page,
namespaces = namespaces,
exnamespaces = exnamespaces,
path = args.path and os.path.normpath(args.path) or "",
delay = args.delay,
retries = int(args.retries),
)


other = OtherConfig(
Expand Down

0 comments on commit 5e655bd

Please sign in to comment.