Skip to content

Instantly share code, notes, and snippets.

@gs
Created December 12, 2013 14:16
Show Gist options
  • Save gs/7928571 to your computer and use it in GitHub Desktop.
Save gs/7928571 to your computer and use it in GitHub Desktop.
open todo files from google drive/tasks
import os
import glob
import sublime_plugin
class OpenTasks(sublime_plugin.TextCommand):
def run(self, args):
self.files = glob.glob(os.path.expanduser('~/Google Drive/tasks' + '/*.TODO'))
if self.files and len(self.files) == 1:
self.view.window().open_file(self.files.get())
else:
self.view.window().show_quick_panel(self.files, self.on_selected)
def on_selected(self, index):
if index == -1:
return
self.view.window().open_file(self.files[index])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment