예제 #1
0
    def on_select_item(self, index):
        if index == -1:
            return
        file_path = self.view.file_name()
        project_path = watch.get_observer_path(file_path)
        id = project.get_id(project_path)
        info = project.get_info(id)
        page_file = self.items[index][1]

        params = info['params']
        url = self.get_url(
            info[self.prefix_key],
            page_file,
            params['page_path'] if page_file in params else None
        )
        webbrowser.open_new_tab(url)
예제 #2
0
        def watch_project():
            watch.start(path, ProjectEventHandler(path))
            sublime.set_timeout(set_status, 0)

            id = project.get_id(path)

            def after_fetch(res):
                if res['errno']:
                    return
                data = res['data']
                project.set_info(id, {
                    'online_prefix': SITE + data['onlineprefix'],
                    'mobile_prefix': 'bainuo://component?url=' + SITE + data['mobileprefix'],
                    'params': data['param']
                })

            project.fetch_info(id, after_fetch)
예제 #3
0
        def watch_project():
            watch.start(path, ProjectEventHandler(path))
            sublime.set_timeout(set_status, 0)

            id = project.get_id(path)

            def after_fetch(res):
                if res['errno']:
                    return
                data = res['data']
                project.set_info(
                    id, {
                        'online_prefix':
                        SITE + data['onlineprefix'],
                        'mobile_prefix':
                        'bainuo://component?url=' + SITE +
                        data['mobileprefix'],
                        'params':
                        data['param']
                    })

            project.fetch_info(id, after_fetch)
예제 #4
0
 def after_create():
     project.preview(project.get_id(path))
예제 #5
0
 def __init__(self, path):
     FileSystemEventHandler.__init__(self)
     self.path = path
     self.id = project.get_id(path)
예제 #6
0
 def run(self, dirs):
     project.preview(project.get_id(dirs[0]))
예제 #7
0
 def after_create():
     project.preview(project.get_id(path))
예제 #8
0
 def __init__(self, path):
     FileSystemEventHandler.__init__(self)
     self.path = path
     self.id = project.get_id(path)
예제 #9
0
 def run(self, dirs):
     project.preview(project.get_id(dirs[0]))