Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

WIP: testing on windows and conda packages/ wheels for master #5604

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

Merged
merged 19 commits into from
Dec 4, 2015
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
On Windows, initialize the animation.convert_path setting from the Re…
…gistry
  • Loading branch information
cgohlke committed Nov 25, 2015
commit a30ec664e39c27feaef595d2d81046222ec9afee
27 changes: 23 additions & 4 deletions 27 lib/matplotlib/animation.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
from matplotlib.cbook import iterable, is_string_like
from matplotlib.compat import subprocess
from matplotlib import verbose
from matplotlib import rcParams
from matplotlib import rcParams, rcParamsDefault

# Process creation flag for subprocess to prevent it raising a terminal
# window. See for example:
Expand Down Expand Up @@ -262,9 +262,7 @@ def isAvailable(cls):
Check to see if a MovieWriter subclass is actually available by
running the commandline tool.
'''
if platform.system() == 'Windows' and cls.bin_path() == 'convert':
# On Windows, the full path to convert must be specified in
# matplotlibrc since convert is also the name of a system tool.
if not cls.bin_path():
return False
try:
p = subprocess.Popen(cls.bin_path(),
Expand Down Expand Up @@ -549,6 +547,27 @@ def delay(self):
def output_args(self):
return [self.outfile]

@classmethod
def _init_from_registry(cls):
if sys.platform != 'win32' or rcParams[cls.exec_key] != 'convert':
return
from matplotlib.externals.six.moves import winreg
for flag in (0, winreg.KEY_WOW64_32KEY, winreg.KEY_WOW64_64KEY):
try:
hkey = winreg.OpenKeyEx(winreg.HKEY_LOCAL_MACHINE,
'Software\\Imagemagick\\Current',
0, winreg.KEY_QUERY_VALUE | flag)
binpath = winreg.QueryValueEx(hkey, 'BinPath')[0]
winreg.CloseKey(hkey)
binpath += '\\convert.exe'
break
except Exception:
binpath = ''
Copy link
Member

Choose a reason for hiding this comment

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

This doesn't sound very healthy.

rcParams[cls.exec_key] = rcParamsDefault[cls.exec_key] = binpath


ImageMagickBase._init_from_registry()
Copy link
Member

Choose a reason for hiding this comment

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

This is a strange addition. I'm not sure why it is necessary.

Copy link
Member

Choose a reason for hiding this comment

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

See #5460 for the discussion of this on windows



@writers.register('imagemagick')
class ImageMagickWriter(MovieWriter, ImageMagickBase):
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.