Opened 7 years ago

Closed 7 years ago

#1331 closed defect (fixed)

Attempted override of builtin color produces traceback

Reported by: Elaine Meng Owned by: Eric Pettersen
Priority: normal Milestone:
Component: Core Version:
Keywords: Cc:
Blocked By: Blocking:
Notify when closed: Platform: all
Project: ChimeraX

Description

The following bug report has been submitted:
Platform:        Darwin-17.7.0-x86_64-i386-64bit
ChimeraX Version: 0.8 (2018-09-26)
Description
trying to redefine builtin color gives traceback

Very minor bug.  I agree it should not be possible to redefine a builtin color, but should give message rather than traceback.  Example command: color name red 80,80,80

Log:
UCSF ChimeraX version: 0.8 (2018-09-26)  
How to cite UCSF ChimeraX  

open /Users/meng/Desktop/glorb.cxs format session ↵

opened ChimeraX session  

color glorb ↵

color name glorb 80,80,50 ↵

Color 'glorb' is opaque, 80% red, 80% green, and 50% blue 

  

color glorb ↵

color name glorb 50,50,20 ↵

Color 'glorb' is opaque, 50% red, 50% green, and 20% blue 

  

color glorb ↵

color name red 80,80,80 ↵

Traceback (most recent call last):  
  File
"/Users/chimera/Applications/ChimeraX_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-
packages/chimerax/cmd_line/tool.py", line 205, in execute  
    cmd.run(cmd_text)  
  File
"/Users/chimera/Applications/ChimeraX_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-
packages/chimerax/core/commands/cli.py", line 2561, in run  
    result = ci.function(session, **kw_args)  
  File
"/Users/chimera/Applications/ChimeraX_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-
packages/chimerax/std_commands/colorname.py", line 32, in name_color  
    session.user_colors.add(name, color)  
  File
"/Users/chimera/Applications/ChimeraX_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-
packages/chimerax/core/colors.py", line 70, in add  
    raise ValueError('Can not override builtin color')  
ValueError: Can not override builtin color  
  

ValueError: Can not override builtin color  
  
File
"/Users/chimera/Applications/ChimeraX_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-
packages/chimerax/core/colors.py", line 70, in add  
raise ValueError('Can not override builtin color')  
  
See log for complete Python traceback.  
  




OpenGL version: 4.1 NVIDIA-10.32.0 355.11.10.10.40.102
OpenGL renderer: NVIDIA GeForce GTX 675MX OpenGL Engine
OpenGL vendor: NVIDIA Corporation

Change History (2)

comment:1 by Eric Pettersen, 7 years ago

Component: UnassignedCore
Owner: set to Eric Pettersen
Platform: all
Project: ChimeraX
Status: newaccepted
Summary: ChimeraX bug report submissionAttempted override of builtin color produces traceback

comment:2 by Eric Pettersen, 7 years ago

Resolution: fixed
Status: acceptedclosed

Changed it to raise "UserError" which produces a status line message and log entry instead of a traceback.

Note: See TracTickets for help on using tickets.