mirror of
https://github.com/RYDE-WORK/ballistica.git
synced 2026-02-06 23:59:18 +08:00
latest cloudtool
This commit is contained in:
parent
a2795fd6ad
commit
83f60675f4
@ -107,6 +107,16 @@ class Asset:
|
|||||||
self.filepath = os.path.join(package.path, path + exts[assettype])
|
self.filepath = os.path.join(package.path, path + exts[assettype])
|
||||||
|
|
||||||
|
|
||||||
|
def get_tz_offset_seconds() -> float:
|
||||||
|
"""Return the offset between utc and local time in seconds."""
|
||||||
|
import time
|
||||||
|
import datetime
|
||||||
|
tval = time.time()
|
||||||
|
utc_offset = (datetime.datetime.fromtimestamp(tval) -
|
||||||
|
datetime.datetime.utcfromtimestamp(tval)).total_seconds()
|
||||||
|
return utc_offset
|
||||||
|
|
||||||
|
|
||||||
# Note to self: keep this synced with server-side validation func...
|
# Note to self: keep this synced with server-side validation func...
|
||||||
def validate_asset_package_name(name: str) -> None:
|
def validate_asset_package_name(name: str) -> None:
|
||||||
"""Throw an exception on an invalid asset-package name."""
|
"""Throw an exception on an invalid asset-package name."""
|
||||||
@ -286,7 +296,8 @@ class App:
|
|||||||
'c': cmd,
|
'c': cmd,
|
||||||
'v': VERSION,
|
'v': VERSION,
|
||||||
't': json.dumps(self._state.login_token),
|
't': json.dumps(self._state.login_token),
|
||||||
'd': json.dumps(data)
|
'd': json.dumps(data),
|
||||||
|
'z': get_tz_offset_seconds(),
|
||||||
},
|
},
|
||||||
files=files)
|
files=files)
|
||||||
response_raw_2.raise_for_status() # Except if anything went wrong.
|
response_raw_2.raise_for_status() # Except if anything went wrong.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user