Permalink
Browse files

build better?

  • Loading branch information...
fivethreeo committed Jul 12, 2013
1 parent 3659b53 commit 39736fe36724935b9bbafb53a6abfa908b49fc80
Showing with 14 additions and 12 deletions.
  1. +4 −4 binding.gyp
  2. +10 −8 get_regvalue.py
View
@@ -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
@@ -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')

0 comments on commit 39736fe

Please sign in to comment.