Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:

build_python3:

runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
strategy:
matrix:
python-version: [3.9]
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## 0.9.3 (2025-05-13)

### Changes

- Regenerate the graph client.
- Rename "application" to "webapp".

## 0.9.2 (2025-04-04)

### Changes
Expand Down
2 changes: 1 addition & 1 deletion python/mujinwebstackclient/version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = '0.9.2'
__version__ = '0.9.3'

# Do not forget to update CHANGELOG.md

30 changes: 15 additions & 15 deletions python/mujinwebstackclient/webstackclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -838,9 +838,9 @@ def FlushCache(self, timeout=5):
if response.status_code != 200:
raise WebstackClientError(response.content.decode('utf-8'), response=response)

#
#
# Blob related
#
#

def DownloadBlob(self, blobId, timeout=5):
"""Downloads a blob with given id
Expand Down Expand Up @@ -876,29 +876,29 @@ def GetUserLog(self, category, level='DEBUG', keyword=None, limit=None, cursor=N
if response.status_code != 200:
raise WebstackClientError(_('Failed to retrieve user log, status code is %d') % response.status_code, response=response)
return response.json()

def DownloadSignalLog(self, limit=None, cursor=None, includecursor=False, forward=False, timeout=2):
"""Get the signal log from the controller.

Returns a stream response, so have to use
Returns a stream response, so have to use

for chunk in GetSignalLog().iter_content(chunk_size=10000):
if chunk:
f.write(chunk)

"""
params = {
'cursor': (cursor or '').strip(),
'includecursor': 'true' if includecursor else 'false',
'forward': 'true' if forward else 'false',
'limit': str(limit or 0),
}

response = self._webclient.Request('GET', '/log/plcsignal/', params=params, timeout=timeout, stream=True)
if response.status_code != 200:
raise WebstackClientError(_('Failed to retrieve user log, status code is %d') % response.status_code, response=response)
return response

#
# Query list of scenepks based on barcdoe field
#
Expand Down Expand Up @@ -926,7 +926,7 @@ def GetConfig(self, filename=None, timeout=5):
"""Retrieve configuration file content from controller.

:param filename: optional, can be one of controllersystem.conf, binpickingsystem.conf, teachworkersystem.conf, robotbridges.conf.json
:return: configuration file content dictionary
:return: configuration file content dictionary
"""
path = '/config/'
if filename:
Expand Down Expand Up @@ -1043,12 +1043,12 @@ def DeleteAllITLPrograms(self, timeout=5):
# Backup restore
#

def Backup(self, saveconfig=True, savemedia=True, backupscenepks=None, saveapps=True, saveitl=True, savedetection=False, savestate=True, savecalibration=False, savedebug=False, saveeds=True, saveiodd=True, timeout=600):
def Backup(self, saveconfig=True, savemedia=True, backupscenepks=None, savewebapps=True, saveitl=True, savedetection=False, savestate=True, savecalibration=False, savedebug=False, saveeds=True, saveiodd=True, timeout=600):
"""Downloads a backup file

:param saveconfig: Whether we want to include configs in the backup, defaults to True
:param savemedia: Whether we want to include media files in the backup, defaults to True
:param saveapps: Whether we want to include web apps in the backup, defaults to True
:param savewebapps: Whether we want to include web apps in the backup, defaults to True
:param saveitl: Whether we want to include itl programs in the backup, defaults to True
:param savedetection: Whether we want to include detection files in the backup, defaults to False
:param savestate: Whether we want to include state files in the backup, defaults to True
Expand All @@ -1064,7 +1064,7 @@ def Backup(self, saveconfig=True, savemedia=True, backupscenepks=None, saveapps=
response = self._webclient.Request('GET', '/backup/', stream=True, params={
'media': 'true' if savemedia else 'false',
'config': 'true' if saveconfig else 'false',
'apps': 'true' if saveapps else 'false',
'webApps': 'true' if savewebapps else 'false',
'itl': 'true' if saveitl else 'false',
'detection': 'true' if savedetection else 'false',
'state': 'true' if savestate else 'false',
Expand All @@ -1078,13 +1078,13 @@ def Backup(self, saveconfig=True, savemedia=True, backupscenepks=None, saveapps=
raise WebstackClientError(response.content.decode('utf-8'), response=response)
return response

def Restore(self, file, restoreconfig=True, restoremedia=True, restoreapps=True, restoreitl=True, restoreeds=True, restoreiodd=True, timeout=600):
def Restore(self, file, restoreconfig=True, restoremedia=True, restorewebapps=True, restoreitl=True, restoreeds=True, restoreiodd=True, timeout=600):
"""Uploads a previously downloaded backup file to restore

:param file: Backup filer in tarball format
:param restoreconfig: Whether we want to restore the configs, defaults to True
:param restoremedia: Whether we want to restore the media data, defaults to True
:param restoreapps: Whether we want to restore the web apps, defaults to True
:param restorewebapps: Whether we want to restore the web apps, defaults to True
:param restoreitl: Whether we want to restore the itl programs, defaults to True
:param restoreeds: Whether we want to restore the eds files, defaults to True
:param restoreiodd: Whether we want to restore the iodd files, defaults to True
Expand All @@ -1095,7 +1095,7 @@ def Restore(self, file, restoreconfig=True, restoremedia=True, restoreapps=True,
response = self._webclient.Request('POST', '/backup/', files={'file': file}, params={
'media': 'true' if restoremedia else 'false',
'config': 'true' if restoreconfig else 'false',
'apps': 'true' if restoreapps else 'false',
'webApps': 'true' if restorewebapps else 'false',
'itl': 'true' if restoreitl else 'false',
'eds': 'true' if restoreeds else 'false',
'iodd': 'true' if restoreiodd else 'false',
Expand Down
Loading