Created
December 12, 2013 14:16
-
-
Save gs/7928571 to your computer and use it in GitHub Desktop.
open todo files from google drive/tasks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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