diff --git a/assets/src/ba_data/python/ba/_dependency.py b/assets/src/ba_data/python/ba/_dependency.py index 6fb414b4..a2dcc2d8 100644 --- a/assets/src/ba_data/python/ba/_dependency.py +++ b/assets/src/ba_data/python/ba/_dependency.py @@ -117,9 +117,9 @@ class DependencyComponent: # For now lets issue a warning if these are instantiated without # a dep-entry; we'll make this an error once we're no longer # seeing warnings. - entry = getattr(self, '_dep_entry', None) - if entry is None: - print(f'FIXME: INSTANTIATING DEP CLASS {type(self)} DIRECTLY.') + # entry = getattr(self, '_dep_entry', None) + # if entry is None: + # print(f'FIXME: INSTANTIATING DEP CLASS {type(self)} DIRECTLY.') @classmethod def dep_is_present(cls, config: Any = None) -> bool: @@ -142,11 +142,11 @@ class DependencyComponent: class DependencyEntry: """Data associated with a dependency/config pair in a ba.DependencySet.""" - def __del__(self) -> None: - print('~DepEntry()', self.cls) + # def __del__(self) -> None: + # print('~DepEntry()', self.cls) def __init__(self, depset: DependencySet, dep: Dependency[T]): - print("DepEntry()", dep.cls) + # print("DepEntry()", dep.cls) self.cls = dep.cls self.config = dep.config @@ -190,7 +190,7 @@ class DependencySet(Generic[T]): """ def __init__(self, root_dependency: Dependency[T]): - print('DepSet()') + # print('DepSet()') self._root_dependency = root_dependency self._resolved = False self._loaded = False @@ -198,8 +198,8 @@ class DependencySet(Generic[T]): # Dependency data indexed by hash. self.entries: Dict[int, DependencyEntry] = {} - def __del__(self) -> None: - print("~DepSet()") + # def __del__(self) -> None: + # print("~DepSet()") def resolve(self) -> None: """Resolve the complete set of required dependencies for this set. @@ -211,7 +211,7 @@ class DependencySet(Generic[T]): if self._resolved: raise Exception("DependencySet has already been resolved.") - print('RESOLVING DEP SET') + # print('RESOLVING DEP SET') # First, recursively expand out all dependencies. self._resolve(self._root_dependency, 0) @@ -229,7 +229,7 @@ class DependencySet(Generic[T]): raise DependencyError(missing) self._resolved = True - print('RESOLVE SUCCESS!') + # print('RESOLVE SUCCESS!') @property def resolved(self) -> bool: diff --git a/assets/src/ba_data/python/ba/_playlist.py b/assets/src/ba_data/python/ba/_playlist.py index 3083cd3a..9e473999 100644 --- a/assets/src/ba_data/python/ba/_playlist.py +++ b/assets/src/ba_data/python/ba/_playlist.py @@ -154,6 +154,8 @@ def filter_playlist(playlist: PlaylistType, and 'default' in setting): entry['settings'][setting_name] = setting['default'] goodlist.append(entry) + except ImportError as exc: + print(f'Import failed while scanning playlist: {exc}') except Exception: from ba import _error _error.print_exception() diff --git a/assets/src/ba_data/python/ba/_session.py b/assets/src/ba_data/python/ba/_session.py index e49fa261..a5c1583a 100644 --- a/assets/src/ba_data/python/ba/_session.py +++ b/assets/src/ba_data/python/ba/_session.py @@ -107,7 +107,7 @@ class Session: from ba._error import DependencyError from ba._dependency import Dependency, AssetPackage - print(' WOULD LOOK AT DEP SETS', depsets) + # print(' WOULD LOOK AT DEP SETS', depsets) # first off, resolve all dep-sets we were passed. # if things are missing, we'll try to gather them into @@ -140,7 +140,8 @@ class Session: required_asset_packages: Set[str] = set() for depset in depsets: required_asset_packages.update(depset.get_asset_package_ids()) - print('Would set host-session asset-reqs to:', required_asset_packages) + # print('Would set host-session asset-reqs to:', + # required_asset_packages) if team_names is None: team_names = ['Good Guys'] diff --git a/assets/src/ba_data/python/bastd/ui/playlist/browser.py b/assets/src/ba_data/python/bastd/ui/playlist/browser.py index 753fd1f8..bc577000 100644 --- a/assets/src/ba_data/python/bastd/ui/playlist/browser.py +++ b/assets/src/ba_data/python/bastd/ui/playlist/browser.py @@ -503,8 +503,8 @@ class PlaylistBrowserWindow(ba.OldWindow): position=(h + scl * 75, v + scl * 10), texture=ba.gettexture('lock'), draw_controller=btn) - assert v is not None - v -= scl * 130.0 + if v is not None: + v -= scl * 130.0 except Exception: ba.print_exception("error listing playlist maps") diff --git a/docs/ba_module.md b/docs/ba_module.md index 8e23777f..6c217938 100644 --- a/docs/ba_module.md +++ b/docs/ba_module.md @@ -1,5 +1,5 @@ -

last updated on 2020-04-03 for Ballistica version 1.5.0 build 20001

+

last updated on 2020-04-04 for Ballistica version 1.5.0 build 20001

This page documents the Python classes and functions in the 'ba' module, which are the ones most relevant to modding in Ballistica. If you come across something you feel should be included here or could be better explained, please let me know. Happy modding!


diff --git a/tools/snippets b/tools/snippets index 765214e5..b70f9346 100755 --- a/tools/snippets +++ b/tools/snippets @@ -754,17 +754,20 @@ def checkenv() -> None: from efrotools import PYTHON_BIN print('Checking environment...', flush=True) + # Make sure they've got curl. + # Make sure they've got our target python version. - if subprocess.run(['which', PYTHON_BIN], check=False, + if subprocess.run(['which', 'curl'], check=False, capture_output=True).returncode != 0: - raise CleanError(f'{PYTHON_BIN} is required.') + raise CleanError(f'curl is required; please install it.') # Make sure they've got pip for that python version. if subprocess.run(f"{PYTHON_BIN} -m pip --version", shell=True, check=False, capture_output=True).returncode != 0: - raise CleanError('pip (for {PYTHON_BIN}) is required.') + raise CleanError( + 'pip (for {PYTHON_BIN}) is required; please install it.') # Check for some required python modules. for modname, minver, packagename in REQUIRED_PYTHON_MODULES: