Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

build better?

  • Loading branch information...
commit 39736fe36724935b9bbafb53a6abfa908b49fc80 1 parent 3659b53
@fivethreeo fivethreeo authored
Showing with 14 additions and 12 deletions.
  1. +4 −4 binding.gyp
  2. +10 −8 get_regvalue.py
View
8 binding.gyp
@@ -20,10 +20,10 @@
"conditions": [
['OS=="win"', {
"libraries": [
- '-l<(MAGICK_ROOT)lib/CORE_RL_magick_.lib',
- '-l<(MAGICK_ROOT)lib/CORE_RL_Magick++_.lib',
- '-l<(MAGICK_ROOT)lib/CORE_RL_wand_.lib',
- '-l<(MAGICK_ROOT)lib/X11.lib'
+ '-l<(MAGICK_ROOT)/lib/CORE_RL_magick_.lib',
+ '-l<(MAGICK_ROOT)/lib/CORE_RL_Magick++_.lib',
+ '-l<(MAGICK_ROOT)/lib/CORE_RL_wand_.lib',
+ '-l<(MAGICK_ROOT)/lib/X11.lib'
],
'include_dirs': [
'<(MAGICK_ROOT)/include',
View
18 get_regvalue.py
@@ -1,12 +1,14 @@
-import subprocess
+import _winreg
def get_regvalue(regkey, regvalue):
- cmd = ['reg.exe', 'query', regkey, '/v', regvalue]
+
+ explorer = _winreg.OpenKey(
+ _winreg.HKEY_LOCAL_MACHINE,
+ regkey
+ )
- p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
- for line in p.communicate()[0].splitlines():
- if regvalue in line:
- data = line.split(' ')[3] + "\\"
- return data
+ value, type = _winreg.QueryValueEx(explorer, regvalue)
+
+ return value
-print get_regvalue('HKEY_LOCAL_MACHINE\\SOFTWARE\\ImageMagick\\Current', "LibPath")
+print get_regvalue('SOFTWARE\\ImageMagick\\Current', 'LibPath')
Please sign in to comment.
Something went wrong with that request. Please try again.