summaryrefslogtreecommitdiff
path: root/tools
diff options
authorThomi Richards <thomi.richards@canonical.com>2012-01-30 16:14:52 +1300
committerThomi Richards <thomi.richards@canonical.com>2012-01-30 16:14:52 +1300
commitc9fd689d49f996f49a39480f52e5492d75e137e0 (patch)
tree0c9c20b16c693856314f19c2258f53dd93b81015 /tools
parentad59148fe37997a6bfaeaa16989f44ac9a2e8d2e (diff)
Temnp files now cleaned up.
(bzr r1876.1.2)
Diffstat (limited to 'tools')
-rwxr-xr-xtools/unity-introspection-visualiser.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/unity-introspection-visualiser.py b/tools/unity-introspection-visualiser.py
index abb8e9041..bdefe0b51 100755
--- a/tools/unity-introspection-visualiser.py
+++ b/tools/unity-introspection-visualiser.py
@@ -3,6 +3,7 @@
#
# Script to generate a nice PNG file of the currently running unity introspection tree.
from argparse import ArgumentParser
+from os import remove
from os.path import splitext
import dbus
@@ -22,6 +23,7 @@ except ImportError:
NEXT_NODE_ID=1
+
def string_rep(dbus_type):
"""Get a string representation of various dbus types."""
if type(dbus_type) == dbus.Boolean:
@@ -37,6 +39,7 @@ def string_rep(dbus_type):
else:
return repr(dbus_type)
+
def escape(s):
"""Escape a string so it can be use in a dot label."""
return pydot.quote_if_necessary(s).replace('<','\\<').replace('>', '\\>')
@@ -97,8 +100,8 @@ if __name__ == '__main__':
tf = NamedTemporaryFile(suffix='.png', delete=False)
tf.write(graph.create_png())
tf.close()
- print tf.name
call(["eog", tf.name])
+ remove(tf.name)
else:
print 'unknown output mode!'