From 1bd86b327772b06b16c5c2a71efdb6e115cf56d3 Mon Sep 17 00:00:00 2001
From: Walter Bender <walter.bender@gmail.com>
Date: Sat, 14 May 2011 11:04:40 -0400
Subject: [PATCH] properly parse bundle_path with depth greater than 1
Organization: Sugar Labs Foundation
---
src/jarabe/view/viewsource.py | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/jarabe/view/viewsource.py b/src/jarabe/view/viewsource.py
index a1c0be3..1dd06fb 100644
a
|
b
|
class ViewSource(gtk.Window): |
132 | 132 | |
133 | 133 | activity_bundle = ActivityBundle(bundle_path) |
134 | 134 | command = activity_bundle.get_command() |
| 135 | file_path = '' |
135 | 136 | if len(command.split(' ')) > 1: |
136 | | name = command.split(' ')[1].split('.')[0] |
137 | | file_name = name + '.py' |
| 137 | name = command.split(' ')[1].split('.')[-1] |
| 138 | tmppath = command.split(' ')[1].replace('.', '/') |
| 139 | file_name = tmppath[0:-(len(name) + 1)] + '.py' |
138 | 140 | path = os.path.join(activity_bundle.get_path(), file_name) |
139 | 141 | self._selected_file = path |
| 142 | logging.debug('view source: command %s, name %s, path %s' % (command, name, path)) |
140 | 143 | |
| 144 | logging.debug('view source: file_path %s' % (file_path)) |
141 | 145 | self._file_viewer = FileViewer(bundle_path, file_name) |
142 | 146 | self._file_viewer.connect('file-selected', self.__file_selected_cb) |
143 | 147 | pane.add1(self._file_viewer) |