Skip to content

Commit

Permalink
Fix syntax and other minor updates
Browse files Browse the repository at this point in the history
- Bump to 0.1.1
  • Loading branch information
smathot committed Mar 18, 2023
1 parent fa6cedb commit 8fa73b8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
3 changes: 0 additions & 3 deletions opensesame_extensions/updater/updater/update_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ def __init__(self, parent):

def set_script(self, script):
self._editor.setPlainText(script)
# cursor = self._editor.textCursor()
# cursor.movePosition(cursor.Start)
# self._editor.setTextCursor(cursor)

def _run_script(self):
self.extension_manager.fire('jupyter_run_code',
Expand Down
9 changes: 4 additions & 5 deletions opensesame_extensions/updater/updater/updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ def _pkg_info(pkg):
result = subprocess.run(cmd, capture_output=True)
info = json.loads(result.stdout)
if len(info) != 1:
print(f'failed to parse {info}')
return None, None
return info[0], parse(info[0]['version'])

Expand Down Expand Up @@ -105,7 +104,7 @@ def _check_update(pkg):
def _check_updates(queue, pkgs):
"""The main process function that checks for each package in pkgs whether
it can be updated, and puts UpdateInfo objects into the queue.
""""
"""
available_updates = []
for pkg in pkgs:
info = _check_update(pkg)
Expand Down Expand Up @@ -151,7 +150,7 @@ def _check_update_process(self):
oslogger.debug('checking update process')
if self._queue.empty():
try:
print('update process still running')
oslogger.debug('update process still running')
except ValueError:
# Is raised when getting the pid of a closed process
return
Expand All @@ -176,15 +175,15 @@ def _finish_update_process(self):
conda_updates = [info for info in self._updates if not info.pypi]
if conda_updates:
script.append(
'# The following packages can be updated through conda:')
_('# The following packages can be updated through conda:'))
for info in conda_updates:
script.append(
f'# - {info.pkg} from {info.current} to {info.latest}')
pkgs = ' '.join([info.pkg for info in pypi_updates])
script.append(f'%conda update {pkgs} -y')
if pypi_updates:
script.append(
'# The following packages can be updated through pip:')
_('# The following packages can be updated through pip:'))
for info in pypi_updates:
script.append(
f'# - {info.pkg} from {info.current} to {info.latest}')
Expand Down
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
[tool.poetry]
name = "opensesame-extension-updater"
version = "0.1.0"
version = "0.1.1"
description = "Checks for updates to extensions and plugins in OpenSesame"
authors = ["Sebastiaan Mathôt <[email protected]>"]
readme = "readme.md"
packages = [
{include = "opensesame_extensions"},
]
license = "COPYING"
homepage = "https://osdoc.cogsci.nl"
repository = "https://github.com/open-cogsci/opensesame-extension-updater"

[tool.poetry.dependencies]
python = ">= 3.7"
Expand Down

0 comments on commit 8fa73b8

Please sign in to comment.