diff options
author | Gary Bressler <garybressler@nc.rr.com> | 2010-04-30 14:51:19 -0400 |
---|---|---|
committer | Gary Bressler <garybressler@nc.rr.com> | 2010-04-30 14:51:19 -0400 |
commit | 9f9bb86ed919bcb6be32b6818ca232f071fe90f3 (patch) | |
tree | 05d97562eb53b7958d022eda02d3f6134850e0d9 /unit_trace/viz/viewer.py | |
parent | c21dea9f97dd31ad8a915469edc01f44345a469e (diff) |
Added ability to specify units along with -t command-line option
Diffstat (limited to 'unit_trace/viz/viewer.py')
-rw-r--r-- | unit_trace/viz/viewer.py | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/unit_trace/viz/viewer.py b/unit_trace/viz/viewer.py index bb1385c..4613c47 100644 --- a/unit_trace/viz/viewer.py +++ b/unit_trace/viz/viewer.py | |||
@@ -856,14 +856,8 @@ class MainWindow(gtk.Window): | |||
856 | if ret == gtk.RESPONSE_ACCEPT: | 856 | if ret == gtk.RESPONSE_ACCEPT: |
857 | err, time = None, None | 857 | err, time = None, None |
858 | try: | 858 | try: |
859 | input_tokens = self.text_input_dialog.get_input().split() | 859 | time = util.parse_time(self.text_input_dialog.get_input()) |
860 | if len(input_tokens) > 2: | ||
861 | raise ValueError | ||
862 | 860 | ||
863 | if len(input_tokens) > 1: | ||
864 | unit = util.parse_unit(input_tokens[1]) | ||
865 | |||
866 | time = unit.native_to_nsec(float(input_tokens[0])) | ||
867 | start, end = self.notebook.get_nth_page(self.notebook.last_page).get_graph_area() \ | 861 | start, end = self.notebook.get_nth_page(self.notebook.last_page).get_graph_area() \ |
868 | .get_schedule().get_time_bounds() | 862 | .get_schedule().get_time_bounds() |
869 | if time < start or time > end: | 863 | if time < start or time > end: |