Skip to content

Commit

Permalink
Merge pull request #142 from pierrepo/dev/fix-weblogo
Browse files Browse the repository at this point in the history
Fix weblogo weblogolib.SymbolColor/ColorGroup import
  • Loading branch information
pierrepo authored Dec 21, 2016
2 parents 44d317e + 38a3c18 commit ca63db4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- Use of bumpversion to sync version across files
- Add MDAnalysis as a mandatory module
- Add matplotlib as a mandatory module
- Fix weblogo weblogolib.SymbolColor/ColorGroup import

**1.3.1**
- remove pbxplore import from setup.py and add version number
Expand Down
15 changes: 8 additions & 7 deletions pbxplore/analysis/visualization.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@

try:
import weblogolib
# Weblogo compatibility
# With version < 3.5, the color class is 'ColorGroup'. In version >= 3.5,
# it is 'SymbolColor'. Here, we change to always have 'ColorGroup'.
try:
ColorGroup = weblogolib.SymbolColor
except NameError:
ColorGroup = weblogolib.ColorGroup
except ImportError:
IS_WEBLOGO = False
else:
Expand All @@ -35,13 +42,7 @@
except NameError:
pass

# Weblogo compatibility
# With version < 3.5, the color class is 'ColorGroup'. In version >= 3.5,
# it is 'SymbolColor'. Here, we change to always have 'ColorGroup'.
try:
ColorGroup = weblogolib.SymbolColor
except NameError:
ColorGroup = weblogolib.ColorGroup



# Create the __all__ keyword according to the conditional imports
Expand Down

0 comments on commit ca63db4

Please sign in to comment.