Skip to content

Commit

Permalink
moving CloudSubsystem to plus since it requires plus anyway
Browse files Browse the repository at this point in the history
  • Loading branch information
efroemling committed Jan 16, 2024
1 parent 7182a29 commit ba60c69
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 59 deletions.
88 changes: 44 additions & 44 deletions .efrocachemap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/assets/.asset_manifest_public.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"ba_data/python/babase/__pycache__/_apputils.cpython-311.opt-1.pyc",
"ba_data/python/babase/__pycache__/_assetmanager.cpython-311.opt-1.pyc",
"ba_data/python/babase/__pycache__/_asyncio.cpython-311.opt-1.pyc",
"ba_data/python/babase/__pycache__/_cloud.cpython-311.opt-1.pyc",
"ba_data/python/babase/__pycache__/_devconsole.cpython-311.opt-1.pyc",
"ba_data/python/babase/__pycache__/_emptyappmode.cpython-311.opt-1.pyc",
"ba_data/python/babase/__pycache__/_env.cpython-311.opt-1.pyc",
Expand Down Expand Up @@ -42,7 +41,6 @@
"ba_data/python/babase/_apputils.py",
"ba_data/python/babase/_assetmanager.py",
"ba_data/python/babase/_asyncio.py",
"ba_data/python/babase/_cloud.py",
"ba_data/python/babase/_devconsole.py",
"ba_data/python/babase/_emptyappmode.py",
"ba_data/python/babase/_env.py",
Expand Down Expand Up @@ -121,8 +119,10 @@
"ba_data/python/baenv.py",
"ba_data/python/baplus/__init__.py",
"ba_data/python/baplus/__pycache__/__init__.cpython-311.opt-1.pyc",
"ba_data/python/baplus/__pycache__/_cloud.cpython-311.opt-1.pyc",
"ba_data/python/baplus/__pycache__/_hooks.cpython-311.opt-1.pyc",
"ba_data/python/baplus/__pycache__/_subsystem.cpython-311.opt-1.pyc",
"ba_data/python/baplus/_cloud.py",
"ba_data/python/baplus/_hooks.py",
"ba_data/python/baplus/_subsystem.py",
"ba_data/python/bascenev1/__init__.py",
Expand Down
4 changes: 2 additions & 2 deletions src/assets/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ SCRIPT_TARGETS_PY_PUBLIC = \
$(BUILD_DIR)/ba_data/python/babase/_apputils.py \
$(BUILD_DIR)/ba_data/python/babase/_assetmanager.py \
$(BUILD_DIR)/ba_data/python/babase/_asyncio.py \
$(BUILD_DIR)/ba_data/python/babase/_cloud.py \
$(BUILD_DIR)/ba_data/python/babase/_devconsole.py \
$(BUILD_DIR)/ba_data/python/babase/_emptyappmode.py \
$(BUILD_DIR)/ba_data/python/babase/_env.py \
Expand Down Expand Up @@ -210,6 +209,7 @@ SCRIPT_TARGETS_PY_PUBLIC = \
$(BUILD_DIR)/ba_data/python/baclassic/osmusic.py \
$(BUILD_DIR)/ba_data/python/baenv.py \
$(BUILD_DIR)/ba_data/python/baplus/__init__.py \
$(BUILD_DIR)/ba_data/python/baplus/_cloud.py \
$(BUILD_DIR)/ba_data/python/baplus/_hooks.py \
$(BUILD_DIR)/ba_data/python/baplus/_subsystem.py \
$(BUILD_DIR)/ba_data/python/bascenev1/__init__.py \
Expand Down Expand Up @@ -446,7 +446,6 @@ SCRIPT_TARGETS_PYC_PUBLIC = \
$(BUILD_DIR)/ba_data/python/babase/__pycache__/_apputils.cpython-311.opt-1.pyc \
$(BUILD_DIR)/ba_data/python/babase/__pycache__/_assetmanager.cpython-311.opt-1.pyc \
$(BUILD_DIR)/ba_data/python/babase/__pycache__/_asyncio.cpython-311.opt-1.pyc \
$(BUILD_DIR)/ba_data/python/babase/__pycache__/_cloud.cpython-311.opt-1.pyc \
$(BUILD_DIR)/ba_data/python/babase/__pycache__/_devconsole.cpython-311.opt-1.pyc \
$(BUILD_DIR)/ba_data/python/babase/__pycache__/_emptyappmode.cpython-311.opt-1.pyc \
$(BUILD_DIR)/ba_data/python/babase/__pycache__/_env.cpython-311.opt-1.pyc \
Expand Down Expand Up @@ -485,6 +484,7 @@ SCRIPT_TARGETS_PYC_PUBLIC = \
$(BUILD_DIR)/ba_data/python/baclassic/__pycache__/osmusic.cpython-311.opt-1.pyc \
$(BUILD_DIR)/ba_data/python/__pycache__/baenv.cpython-311.opt-1.pyc \
$(BUILD_DIR)/ba_data/python/baplus/__pycache__/__init__.cpython-311.opt-1.pyc \
$(BUILD_DIR)/ba_data/python/baplus/__pycache__/_cloud.cpython-311.opt-1.pyc \
$(BUILD_DIR)/ba_data/python/baplus/__pycache__/_hooks.cpython-311.opt-1.pyc \
$(BUILD_DIR)/ba_data/python/baplus/__pycache__/_subsystem.cpython-311.opt-1.pyc \
$(BUILD_DIR)/ba_data/python/bascenev1/__pycache__/__init__.cpython-311.opt-1.pyc \
Expand Down
2 changes: 0 additions & 2 deletions src/assets/ba_data/python/babase/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@
get_remote_app_name,
AppHealthMonitor,
)
from babase._cloud import CloudSubsystem
from babase._devconsole import (
DevConsoleTab,
DevConsoleTabEntry,
Expand Down Expand Up @@ -213,7 +212,6 @@
'clipboard_has_text',
'clipboard_is_supported',
'clipboard_set_text',
'CloudSubsystem',
'commit_app_config',
'ContextCall',
'ContextError',
Expand Down
2 changes: 2 additions & 0 deletions src/assets/ba_data/python/baplus/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@

import logging

from baplus._cloud import CloudSubsystem
from baplus._subsystem import PlusSubsystem

__all__ = [
'CloudSubsystem',
'PlusSubsystem',
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
import logging
from typing import TYPE_CHECKING, overload

import _babase
from babase._appsubsystem import AppSubsystem
import babase

if TYPE_CHECKING:
from typing import Callable, Any
Expand All @@ -23,7 +22,7 @@
# internal protocols.


class CloudSubsystem(AppSubsystem):
class CloudSubsystem(babase.AppSubsystem):
"""Manages communication with cloud components."""

@property
Expand All @@ -44,7 +43,7 @@ def on_connectivity_changed(self, connected: bool) -> None:
if DEBUG_LOG:
logging.debug('CloudSubsystem: Connectivity is now %s.', connected)

plus = _babase.app.plus
plus = babase.app.plus
assert plus is not None

# Inform things that use this.
Expand Down Expand Up @@ -117,12 +116,11 @@ def send_message_cb(
The provided on_response call will be run in the logic thread
and passed either the response or the error that occurred.
"""
from babase._general import Call

del msg # Unused.

_babase.pushcall(
Call(
babase.pushcall(
babase.Call(
on_response,
RuntimeError('Cloud functionality is not available.'),
)
Expand Down Expand Up @@ -188,7 +186,7 @@ def cloud_console_exec(code: str) -> None:
except Exception:
import traceback

apptime = _babase.apptime()
apptime = babase.apptime()
print(f'Exec error at time {apptime:.2f}.', file=sys.stderr)
traceback.print_exc()

Expand Down
3 changes: 2 additions & 1 deletion src/assets/ba_data/python/baplus/_subsystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
if TYPE_CHECKING:
from typing import Callable, Any

from babase import CloudSubsystem, AccountV2Subsystem
from baplus._cloud import CloudSubsystem
from babase import AccountV2Subsystem


class PlusSubsystem(AppSubsystem):
Expand Down
4 changes: 4 additions & 0 deletions src/assets/ba_data/python/bauiv1lib/promocode.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,10 @@ async def _run_code(code: str) -> None:
plus = bui.app.plus
assert plus is not None

# If we're signed in with a V2 account, ship this to V2 server.
# if plus.accounts.primary is not None:
# plus.cloud.send_message

plus.add_v1_account_transaction(
{
'type': 'PROMO_CODE',
Expand Down

0 comments on commit ba60c69

Please sign in to comment.