[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [arm/release] fix: including gui resources with arm install



commit de8695a17bb96fd7a461c2b49fa5f064c004f9e2
Author: Damian Johnson <atagar@xxxxxxxxxxxxxx>
Date:   Sat Jul 16 22:29:46 2011 -0700

    fix: including gui resources with arm install
---
 install               |    2 +-
 setup.py              |    3 ++-
 src/gui/__init__.py   |    2 +-
 src/gui/controller.py |   13 ++++++++++---
 src/prereq.py         |    6 ++++--
 5 files changed, 18 insertions(+), 8 deletions(-)

diff --git a/install b/install
index fead85c..605f724 100755
--- a/install
+++ b/install
@@ -1,5 +1,5 @@
 #!/bin/sh
-python src/prereq.py
+python src/prereq.py --both
 
 if [ $? = 0 ]; then
   python setup.py -q install
diff --git a/setup.py b/setup.py
index 6e31f44..4513dee 100644
--- a/setup.py
+++ b/setup.py
@@ -93,7 +93,7 @@ if "install" in sys.argv:
 # When installing we include a bundled copy of TorCtl. However, when creating
 # a deb we have a dependency on the python-torctl package instead:
 # http://packages.debian.org/unstable/main/python-torctl
-installPackages = ['arm', 'arm.cli', 'arm.cli.graphing', 'arm.cli.connections', 'arm.cli.menu', 'arm.util']
+installPackages = ['arm', 'arm.cli', 'arm.cli.graphing', 'arm.cli.connections', 'arm.cli.menu', 'arm.gui', 'arm.gui.connections', 'arm.gui.graphing', 'arm.util', 'arm.cagraph', 'arm.cagraph.axis', 'arm.cagraph.series']
 if not isDebInstall: installPackages.append('arm.TorCtl')
 
 setup(name='arm',
@@ -108,6 +108,7 @@ setup(name='arm',
       data_files=[("/usr/bin", ["arm"]),
                   ("/usr/share/man/man1", [manFilename]),
                   (docPath, ["armrc.sample"]),
+                  ("/usr/share/arm/gui", ["src/gui/arm.xml"]),
                   ("/usr/share/arm", ["src/settings.cfg", "src/uninstall"])] + 
                   getResources("/usr/share/arm", "resources"),
      )
diff --git a/src/gui/__init__.py b/src/gui/__init__.py
index b700273..f274d81 100644
--- a/src/gui/__init__.py
+++ b/src/gui/__init__.py
@@ -2,5 +2,5 @@
 Panels, popups, and handlers comprising the arm user interface.
 """
 
-__all__ = ["controller", "logPanel"]
+__all__ = ["controller", "generalPanel", "logPanel"]
 
diff --git a/src/gui/controller.py b/src/gui/controller.py
index 5736def..4979ea1 100644
--- a/src/gui/controller.py
+++ b/src/gui/controller.py
@@ -13,10 +13,17 @@ gobject.threads_init()
 
 class GuiController:
   def __init__(self):
-    filename = 'src/gui/arm.xml'
-
     self.builder = gtk.Builder()
-    self.builder.add_from_file(filename)
+
+    try:
+      self.builder.add_from_file('src/gui/arm.xml')
+    except:
+      # when installed the above path doesn't work (the 'src' prefix doesn't
+      # exist and whichever path it's working off of doens't seem to exist),
+      # so using absolute path instead
+
+      self.builder.add_from_file('/usr/share/arm/gui/arm.xml')
+
     self.builder.connect_signals(self)
 
     self.logPanel = logPanel.LogPanel(self.builder)
diff --git a/src/prereq.py b/src/prereq.py
index eee9fdb..8641057 100644
--- a/src/prereq.py
+++ b/src/prereq.py
@@ -232,6 +232,8 @@ def guiPrereq():
 
 if __name__ == '__main__':
   isGui = "-g" in sys.argv or "--gui" in sys.argv
-  if isGui: guiPrereq()
-  else: cliPrereq()
+  isBoth = "--both" in sys.argv
+  
+  if isGui or isBoth: guiPrereq()
+  if not isGui or isBoth: cliPrereq()
 



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits