Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change input to input_val #307

Merged
merged 1 commit into from
Oct 13, 2021
Merged

Conversation

lldelisle
Copy link
Contributor

To solve #306

@sbesson
Copy link
Member

sbesson commented Oct 11, 2021

Thanks @lldelisle for reporting the issue and providing a fix. At first glance, it looks absolutely straightforward and we will include it into our CI builds for testing.

In order for us to release changes by third-party contributors, like many other projects, we know need a signed Contributor License Agreement - see here for the instructions. Could you fill and return this form while we review the PR?

@lldelisle
Copy link
Contributor Author

Where should I send the form? Do you need a 'real' signature (print and scan) or just my name in the form is sufficient.

@sbesson
Copy link
Member

sbesson commented Oct 11, 2021

Print, sign & scan is probably the best. There should be an email at the bottom of the instructions page for sending the form.

Copy link
Member

@sbesson sbesson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without this change, I was able to reproduce the bug reported in #306 using an user with a large enough number of tags:

(.venv3) bash-4.2$ omero tag list -q
Orphaned tags:
> 2:'Replacement Tag'
> 5:'New Tag'
> 8:'MyTag'
> 9:'MyTag'
> 10:'MyTag'
> 11:'new tag'
> 20:'new tag 1'
> 21:'new tag 2'
> 23:'training_user's tag'
> 24:'ladmin_user's tag'
> 52:'Replacement Tag'
> 55:'New Tag'
> 58:'MyTag'
> 59:'MyTag'
> 60:'MyTag'
> 61:'new tag'
> 70:'new tag 1'
> 71:'new tag 2'
> 73:'training_user's tag'
> 74:'ladmin_user's tag'
> 102:'Replacement Tag'
> 105:'New Tag'
> 108:'MyTag'
Traceback (most recent call last):
  File "/home/omero/workspace/OMERO-server/.venv3/bin/omero", line 11, in <module>
    load_entry_point('omero-py==5.10.1.dev0', 'console_scripts', 'omero')()
  File "/home/omero/workspace/OMERO-server/.venv3/lib64/python3.6/site-packages/omero/main.py", line 125, in main
    rv = omero.cli.argv()
  File "/home/omero/workspace/OMERO-server/.venv3/lib64/python3.6/site-packages/omero/cli.py", line 1784, in argv
    cli.invoke(args[1:])
  File "/home/omero/workspace/OMERO-server/.venv3/lib64/python3.6/site-packages/omero/cli.py", line 1222, in invoke
    stop = self.onecmd(line, previous_args)
  File "/home/omero/workspace/OMERO-server/.venv3/lib64/python3.6/site-packages/omero/cli.py", line 1299, in onecmd
    self.execute(line, previous_args)
  File "/home/omero/workspace/OMERO-server/.venv3/lib64/python3.6/site-packages/omero/cli.py", line 1381, in execute
    args.func(args)
  File "/home/omero/workspace/OMERO-server/.venv3/lib/python3.6/site-packages/omero/plugins/tag.py", line 715, in list
    self.pagetext(lines)
  File "/home/omero/workspace/OMERO-server/.venv3/lib/python3.6/site-packages/omero/plugins/tag.py", line 206, in pagetext
    self.print_line(line, index)
  File "/home/omero/workspace/OMERO-server/.venv3/lib/python3.6/site-packages/omero/plugins/tag.py", line 196, in print_line
    input = input("[Enter], [f]orward forever, or [q]uit: ")
UnboundLocalError: local variable 'input' referenced before assignment

With this PR included, the error does not show up anymore and all options of the interactive dialog prompt allow to control the flow of the tag list as expected

(.venv3) bash-4.2$ omero tag list -q
Orphaned tags:
> 4:'New Tag'
> 7:'MyTag'
> 8:'MyTag'
> 9:'MyTag'
> 10:'new tag'
> 54:'New Tag'
> 57:'MyTag'
> 58:'MyTag'
> 59:'MyTag'
> 60:'new tag'
> 104:'New Tag'
> 107:'MyTag'
> 108:'MyTag'
> 109:'MyTag'
> 110:'new tag'
> 154:'New Tag'
> 157:'MyTag'
> 158:'MyTag'
> 159:'MyTag'
> 160:'new tag'
> 204:'New Tag'
> 207:'MyTag'
> 208:'MyTag'
[Enter], [f]orward forever, or [q]uit: 
> 210:'new tag'
> 254:'New Tag'
> 257:'MyTag'
> 258:'MyTag'
> 259:'MyTag'
> 260:'new tag'
> 304:'New Tag'
> 307:'MyTag'
> 308:'MyTag'
> 309:'MyTag'
> 310:'new tag'
> 354:'New Tag'
> 357:'MyTag'
> 358:'MyTag'
> 359:'MyTag'
> 360:'new tag'
> 454:'New Tag'
> 457:'MyTag'
> 458:'MyTag'
> 459:'MyTag'
> 460:'new tag'
> 604:'New Tag'
> 607:'MyTag'
[Enter], [f]orward forever, or [q]uit: q

Thanks also for signing the CLA. I will prepare a patch release that corrects this regression.

@sbesson sbesson merged commit df803e7 into ome:master Oct 13, 2021
@sbesson
Copy link
Member

sbesson commented Oct 13, 2021

@lldelisle this is now released as https://pypi.org/project/omero-py/5.10.1. Thanks again for your contribution!

@lldelisle
Copy link
Contributor Author

You're welcome

@lldelisle lldelisle deleted the lldelisle-patch-1 branch October 13, 2021 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants