Changeset 2193:9531e61ed8df
- 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:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r2155
|
r2193
|
|
| 1 | | from os.path import join |
| 2 | | import subprocess, sys, os |
| 3 | 1 | |
| 4 | | pipe = subprocess.Popen(['which', 'glade-3'], stdout=subprocess.PIPE) |
| 5 | | sto = pipe.communicate()[0] |
| 6 | | if pipe.returncode: |
| | 2 | from os.path import join, dirname |
| | 3 | import os |
| | 4 | from shutil import copy |
| | 5 | |
| | 6 | found = False |
| | 7 | |
| | 8 | for 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 | |
| | 14 | if not found: |
| 7 | 15 | print "glade-3 not found in path" |
| | 16 | raise SystemExit |
| 8 | 17 | |
| 9 | | glade3_prefix = sto.strip()[:len('bin/glade-3')-1] |
| | 18 | glade3_prefix = dirname(dirname(path)) |
| 10 | 19 | |
| 11 | | print "installing in prefix %s" %glade3_prefix |
| | 20 | print "installing in prefix", glade3_prefix |
| 12 | 21 | |
| 13 | 22 | |
| 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')]) |
| | 23 | copy('kiwiwidgets.xml', |
| | 24 | os.path.join(glade3_prefix, 'share/glade3/catalogs')) |
| | 25 | copy('kiwiwidgets.py', |
| | 26 | os.path.join(glade3_prefix, 'lib/glade3/modules')) |