Changeset 2193:9531e61ed8df

Show
Ignore:
Timestamp:
11/23/09 21:31:18 (4 months ago)
Author:
Ronny Pfannschmidt <Ronny.Pfannschmidt@…>
Branch:
default
Message:

clean up glade plugin install script, fixes #352

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • tools/glade3-plugin/install.py

    r2155 r2193  
    1 from os.path import join 
    2 import subprocess, sys, os 
    31 
    4 pipe = subprocess.Popen(['which', 'glade-3'], stdout=subprocess.PIPE) 
    5 sto = pipe.communicate()[0] 
    6 if pipe.returncode: 
     2from os.path import join, dirname 
     3import os 
     4from shutil import copy 
     5 
     6found = False 
     7 
     8for path in os.environ['PATH'].split(os.pathsep): 
     9    path = join(path, 'glade-3') 
     10    if os.access(path, os.X_OK): 
     11        found = True 
     12        break 
     13 
     14if not found: 
    715    print "glade-3 not found in path" 
     16    raise SystemExit 
    817 
    9 glade3_prefix = sto.strip()[:len('bin/glade-3')-1] 
     18glade3_prefix = dirname(dirname(path)) 
    1019 
    11 print "installing in prefix %s" %glade3_prefix 
     20print "installing in prefix", glade3_prefix 
    1221 
    1322 
    14 subprocess.call(["cp", 'kiwiwidgets.xml',  
    15           os.path.join(glade3_prefix, 'share', 'glade3', 'catalogs')]) 
    16 subprocess.call(["cp", 'kiwiwidgets.py', 
    17           os.path.join(glade3_prefix, 'lib', 'glade3', 'modules')]) 
     23copy('kiwiwidgets.xml', 
     24     os.path.join(glade3_prefix, 'share/glade3/catalogs')) 
     25copy('kiwiwidgets.py', 
     26     os.path.join(glade3_prefix, 'lib/glade3/modules'))