Opened 10 years ago

Closed 10 years ago

#191 closed defect (fixed)

"alias" command has problems

Reported by: Elaine Meng Owned by: Greg Couch
Priority: blocker Milestone:
Component: Command Line Version:
Keywords: Cc: pett, Tom Goddard, Conrad Huang
Blocked By: Blocking:
Notify when closed: Platform: all
Project: chimera

Description

I don't know if these are all connected or separate problems, so that's why I'm reporting them together.

(a) space is stripped from log, e.g. typing
alias colh color helix $1 targ c
...gives Log:
aliascolh color helix $1 targ c

(b) then "alias list" gives traceback ending in
IndexError: string index out of range
... however, I can use the alias, e.g. "colh blue" works on my structure

(c) "alias delete" also gives traceback ending in UnboundLocalError: local variable 'word_info' referenced before assignment
... and apparently deletes all the aliases, although in the revised design it should require the argument "all" or the name of a specific alias.
http://preview.cgl.ucsf.edu/chimerax/docs/user/commands/alias.html

I'm inferring that it deletes them all because "colh" no longer works.

Change History (3)

comment:1 by Greg Couch, 10 years ago

Fixed (b), still looking for (a).

Don't get a backtrace for (c). Currently 'alias delete', by itself, deletes all aliases. Requiring the keyword all is better, so I'll do that too.

comment:2 by Elaine Meng, 10 years ago

alias delete
Traceback (most recent call last):
File "/Users/chimera/Applications/ChimeraX_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/chimera/cmd_line/gui.py", line 121, in on_enter
cmd.execute()
File "/Users/chimera/Applications/ChimeraX_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/chimera/core/commands/cli.py", line 1746, in execute
results.append(ci.function(session, **kw_args))
File "/Users/chimera/Applications/ChimeraX_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/chimera/core/commands/alias.py", line 44, in unalias
cli.remove_alias(name, user=True)
File "/Users/chimera/Applications/ChimeraX_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/chimera/core/commands/cli.py", line 2442, in remove_alias
deregister(name, is_user_alias=True)
File "/Users/chimera/Applications/ChimeraX_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/chimera/core/commands/cli.py", line 1611, in deregister
if is_user_alias and not word_info.is_user_alias():
UnboundLocalError: local variable 'word_info' referenced before assignment

comment:3 by Greg Couch, 10 years ago

Resolution: fixed
Status: newclosed

(c) was a side-effect of (b).

(a) is now fixed too. Bug was with consuming whitespace for a short command of a multiword command.

Note: See TracTickets for help on using tickets.