Install python workbook to well-known location
This removes the need to pass the system configuration
to all the scripts.
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/Makefile b/Makefile
index 67d9102..87acb71 100644
--- a/Makefile
+++ b/Makefile
@@ -14,7 +14,6 @@
rstbutton
SUBDIRS = $(GDBUS_APPS) \
- configs \
hacks \
ledctl \
libopenbmc_intf \
diff --git a/configs/Makefile b/configs/Makefile
deleted file mode 120000
index 76a90fc..0000000
--- a/configs/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile.python
\ No newline at end of file
diff --git a/configs/setup.py b/configs/setup.py
deleted file mode 100644
index 0132f01..0000000
--- a/configs/setup.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from distutils.core import setup
-
-setup(name='openbmc_configs',
- version='1.0',
- py_modules=['Palmetto', 'Garrison', 'Barreleye', 'Firestone', 'Witherspoon'],
- )
diff --git a/pydownloadmgr/download_manager.py b/pydownloadmgr/download_manager.py
index ba502da..9dd6c2d 100644
--- a/pydownloadmgr/download_manager.py
+++ b/pydownloadmgr/download_manager.py
@@ -7,11 +7,7 @@
import dbus.mainloop.glib
import subprocess
from obmc.dbuslib.bindings import get_dbus
-
-if (len(sys.argv) < 2):
- print "Usage: download_manager.py [system name]"
- exit(1)
-System = __import__(sys.argv[1])
+import obmc_system_config as System
DBUS_NAME = 'org.openbmc.managers.Download'
diff --git a/pyhwmon/hwmon.py b/pyhwmon/hwmon.py
index 9f4b1d9..a91b761 100644
--- a/pyhwmon/hwmon.py
+++ b/pyhwmon/hwmon.py
@@ -13,12 +13,7 @@
from obmc.sensors import SensorValue as SensorValue
from obmc.sensors import HwmonSensor as HwmonSensor
from obmc.sensors import SensorThresholds as SensorThresholds
-
-if (len(sys.argv) < 2):
- print "Usage: sensors_hwmon.py [system name]"
- exit(1)
-
-System = __import__(sys.argv[1])
+import obmc_system_config as System
SENSOR_BUS = 'org.openbmc.Sensors'
SENSOR_PATH = '/org/openbmc/sensors'
diff --git a/pyinventorymgr/inventory_items.py b/pyinventorymgr/inventory_items.py
index 5e53293..772fb3e 100644
--- a/pyinventorymgr/inventory_items.py
+++ b/pyinventorymgr/inventory_items.py
@@ -10,12 +10,7 @@
import json
import obmc.dbuslib.propertycacher as PropertyCacher
from obmc.dbuslib.bindings import get_dbus, DbusProperties, DbusObjectManager
-
-if (len(sys.argv) < 2):
- print "Usage: inventory_items.py [system name]"
- exit(1)
-System = __import__(sys.argv[1])
-
+import obmc_system_config as System
INTF_NAME = 'org.openbmc.InventoryItem'
DBUS_NAME = 'org.openbmc.Inventory'
diff --git a/pysensormgr/sensor_manager2.py b/pysensormgr/sensor_manager2.py
index fa3638a..d8fa013 100644
--- a/pysensormgr/sensor_manager2.py
+++ b/pysensormgr/sensor_manager2.py
@@ -8,8 +8,7 @@
import dbus.mainloop.glib
import obmc.sensors
from obmc.dbuslib.bindings import DbusProperties, DbusObjectManager, get_dbus
-
-System = __import__(sys.argv[1])
+import obmc_system_config as System
DBUS_NAME = 'org.openbmc.Sensors'
OBJ_PATH = '/org/openbmc/sensors'
diff --git a/pysystemmgr/system_manager.py b/pysystemmgr/system_manager.py
index 754700b..93ba603 100644
--- a/pysystemmgr/system_manager.py
+++ b/pysystemmgr/system_manager.py
@@ -11,12 +11,7 @@
import obmc.dbuslib.propertycacher as PropertyCacher
from obmc.dbuslib.bindings import DbusProperties, DbusObjectManager, get_dbus
import obmc.enums
-
-if (len(sys.argv) < 2):
- print "Usage: system_manager.py [system name]"
- exit(1)
-
-System = __import__(sys.argv[1])
+import obmc_system_config as System
DBUS_NAME = 'org.openbmc.managers.System'
OBJ_NAME = '/org/openbmc/managers/System'
diff --git a/pytools/gpioutil b/pytools/gpioutil
index ab44b4d..b6ec5ea 100644
--- a/pytools/gpioutil
+++ b/pytools/gpioutil
@@ -3,25 +3,22 @@
import sys
import os
import getopt
+import obmc_system_config as System
def printUsage():
print '\nUsage:'
- print 'gpioutil SYSTEM_NAME -n GPIO_NAME [-v value]'
- print 'gpioutil SYSTEM_NAME -i GPIO_NUM -d <DIRECTION = in,out,falling,rising,both> [-v value]'
- print 'gpioutil SYSTEM_NAME -p PIN_NAME -d <DIRECTION = in,out,falling,rising,both> [-v value]'
- print 'gpioutil SYSTEM_NAME -l PIN_NAME (lookup pin name only)'
+ print 'gpioutil -n GPIO_NAME [-v value]'
+ print 'gpioutil -i GPIO_NUM -d <DIRECTION = in,out,falling,rising,both> [-v value]'
+ print 'gpioutil -p PIN_NAME -d <DIRECTION = in,out,falling,rising,both> [-v value]'
+ print 'gpioutil -l PIN_NAME (lookup pin name only)'
exit(1)
-if (len(sys.argv) < 3):
+if (len(sys.argv) < 2):
printUsage()
-sys.argv.pop(0)
-libr = sys.argv.pop(0)
-System = __import__(libr)
-
GPIO_SYSFS = '/sys/class/gpio/'
class Gpio: