Core: move is_linux, _macos, _windows to Utils.py
This commit is contained in:
parent
103f9e0b85
commit
d9418d5ce1
|
@ -15,18 +15,14 @@ import sys
|
||||||
from typing import Iterable, Sequence, Callable, Union, Optional
|
from typing import Iterable, Sequence, Callable, Union, Optional
|
||||||
import subprocess
|
import subprocess
|
||||||
import itertools
|
import itertools
|
||||||
from Utils import is_frozen, user_path, local_path, init_logging
|
from Utils import is_frozen, user_path, local_path, init_logging, open_filename, messagebox,\
|
||||||
|
is_windows, is_macos, is_linux
|
||||||
from shutil import which
|
from shutil import which
|
||||||
import shlex
|
import shlex
|
||||||
from enum import Enum, auto
|
from enum import Enum, auto
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
|
||||||
is_linux = sys.platform.startswith('linux')
|
|
||||||
is_macos = sys.platform == 'darwin'
|
|
||||||
is_windows = sys.platform in ("win32", "cygwin", "msys")
|
|
||||||
|
|
||||||
|
|
||||||
def open_host_yaml():
|
def open_host_yaml():
|
||||||
file = user_path('host.yaml')
|
file = user_path('host.yaml')
|
||||||
if is_linux:
|
if is_linux:
|
||||||
|
|
|
@ -13,12 +13,12 @@ import logging
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
import Utils
|
import Utils
|
||||||
|
from Utils import is_windows
|
||||||
|
|
||||||
atexit.register(input, "Press enter to exit.")
|
atexit.register(input, "Press enter to exit.")
|
||||||
|
|
||||||
# 1 or more digits followed by m or g, then optional b
|
# 1 or more digits followed by m or g, then optional b
|
||||||
max_heap_re = re.compile(r"^\d+[mMgG][bB]?$")
|
max_heap_re = re.compile(r"^\d+[mMgG][bB]?$")
|
||||||
is_windows = sys.platform in ("win32", "cygwin", "msys")
|
|
||||||
|
|
||||||
|
|
||||||
def prompt_yes_no(prompt):
|
def prompt_yes_no(prompt):
|
||||||
|
|
4
Utils.py
4
Utils.py
|
@ -32,6 +32,10 @@ class Version(typing.NamedTuple):
|
||||||
__version__ = "0.3.2"
|
__version__ = "0.3.2"
|
||||||
version_tuple = tuplize_version(__version__)
|
version_tuple = tuplize_version(__version__)
|
||||||
|
|
||||||
|
is_linux = sys.platform.startswith('linux')
|
||||||
|
is_macos = sys.platform == 'darwin'
|
||||||
|
is_windows = sys.platform in ("win32", "cygwin", "msys")
|
||||||
|
|
||||||
import jellyfish
|
import jellyfish
|
||||||
from yaml import load, load_all, dump, SafeLoader
|
from yaml import load, load_all, dump, SafeLoader
|
||||||
|
|
||||||
|
|
3
setup.py
3
setup.py
|
@ -6,7 +6,7 @@ from pathlib import Path
|
||||||
from hashlib import sha3_512
|
from hashlib import sha3_512
|
||||||
import base64
|
import base64
|
||||||
import datetime
|
import datetime
|
||||||
from Utils import version_tuple
|
from Utils import version_tuple, is_windows
|
||||||
from collections.abc import Iterable
|
from collections.abc import Iterable
|
||||||
import typing
|
import typing
|
||||||
import setuptools
|
import setuptools
|
||||||
|
@ -39,7 +39,6 @@ else:
|
||||||
arch_folder = "exe.{platform}-{version}".format(platform=sysconfig.get_platform(),
|
arch_folder = "exe.{platform}-{version}".format(platform=sysconfig.get_platform(),
|
||||||
version=sysconfig.get_python_version())
|
version=sysconfig.get_python_version())
|
||||||
buildfolder = Path("build", arch_folder)
|
buildfolder = Path("build", arch_folder)
|
||||||
is_windows = sys.platform in ("win32", "cygwin", "msys")
|
|
||||||
|
|
||||||
|
|
||||||
# see Launcher.py on how to add scripts to setup.py
|
# see Launcher.py on how to add scripts to setup.py
|
||||||
|
|
Loading…
Reference in New Issue