Explorar o código

TOONTOWN_ENGINE_DEFAULT_PATH now private

Fabian Peter Hammerle %!s(int64=4) %!d(string=hai) anos
pai
achega
42d2dfb117
Modificáronse 3 ficheiros con 14 adicións e 12 borrados
  1. 1 0
      CHANGELOG.md
  2. 0 11
      tooncher/__init__.py
  3. 13 1
      tooncher/_cli.py

+ 1 - 0
CHANGELOG.md

@@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
   - `tooncher.LOGIN_API_URL`
   - `tooncher.LoginDelayed`
   - `tooncher.LoginSuccessful`
+  - `tooncher.TOONTOWN_ENGINE_DEFAULT_PATH`
   - `tooncher.api_request`
 - `start_engine` & `launch`: expected `isinstance(engine_path, pathlib.Path)`
   (instead of `str`)

+ 0 - 11
tooncher/__init__.py

@@ -15,17 +15,6 @@ import urllib.request
 
 _LOGIN_API_URL = "https://www.toontownrewritten.com/api/login?format=json"
 
-if sys.platform == "darwin":
-    TOONTOWN_ENGINE_DEFAULT_PATH = os.path.join(
-        os.path.expanduser("~"),
-        "Library",
-        "Application Support",
-        "Toontown Rewritten",
-        "Toontown Rewritten",
-    )
-else:
-    TOONTOWN_ENGINE_DEFAULT_PATH = None
-
 
 def start_engine(
     engine_path: pathlib.Path, gameserver: str, playcookie: str, **popen_kwargs

+ 13 - 1
tooncher/_cli.py

@@ -1,11 +1,23 @@
 import argparse
 import os
 import pathlib
+import sys
 
 import yaml
 
 import tooncher
 
+if sys.platform == "darwin":
+    _TOONTOWN_ENGINE_DEFAULT_PATH = os.path.join(
+        os.path.expanduser("~"),
+        "Library",
+        "Application Support",
+        "Toontown Rewritten",
+        "Toontown Rewritten",
+    )
+else:
+    _TOONTOWN_ENGINE_DEFAULT_PATH = None
+
 
 def run(
     username,
@@ -52,7 +64,7 @@ def _init_argparser():
         "-e",
         metavar="path",
         dest="engine_path",
-        default=tooncher.TOONTOWN_ENGINE_DEFAULT_PATH,
+        default=_TOONTOWN_ENGINE_DEFAULT_PATH,
         help="\n".join(
             [
                 "path to toontown engine.",