Skip to content

Commit

Permalink
Added status message and fixed typo
Browse files Browse the repository at this point in the history
  • Loading branch information
bantya committed Oct 17, 2017
1 parent 48d36b3 commit fe5b503
Showing 1 changed file with 28 additions and 6 deletions.
34 changes: 28 additions & 6 deletions Sheller.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ def run (self, *args, **kwargs):
def folder_paras (self, path):
path = path.split("\\")
self.current_drive = path[0]

path.pop()
self.current_directory = "\\".join(path)

Expand All @@ -54,43 +55,61 @@ def on_folder (self):

self.PROJECT_PATH = self.view.window().folders()[0]

self.show_status(self.PROJECT_PATH)

def on_file (self, file_name):
self.folder_paras(file_name)

self.PROJECT_PATH = self.current_directory

self.show_status(self.PROJECT_PATH)

def open_shell_file (self, file_name):
self.folder_paras(file_name)
command = "cd " + self.current_directory + " & " + self.current_drive + " & start cmd"

directory = self.current_directory
command = "cd " + directory + " & " + self.current_drive + " & start cmd"

os.system(command)
self.show_status(directory)

def open_shell_folder (self):
self.check_dir_exist()

path = self.view.window().folders()[0]

self.folder_paras(path)
self.current_directory = path

command = "cd " + self.current_directory + " & " + self.current_drive + " & start cmd"

os.system(command)
self.show_status(path)

def reveal_file (self, file_name):
self.folder_paras(file_name)

directory = self.current_directory
self.args = []

self.view.window().run_command(
"open_dir",
{
"dir": self.current_directory
"open_dir", {
"dir": directory
}
)
self.show_status(directory)

def reveal_folder (self):
self.check_dir_exist()

directory = self.view.window().folders()[0]
self.args = []

self.view.window().run_command(
"open_dir",
{"dir": self.view.window().folders()[0]}
{"dir": directory}
)
self.show_status(directory)

def on_command (self):
self.view.window().show_input_panel(self.show_menu_label, '', self.on_show_menu, None, None)
Expand All @@ -99,9 +118,12 @@ def on_show_menu (self, show_menu):
self.args.extend(shlex.split(str(show_menu)))
self.on_done()

def show_status(self, message):
sublime.status_message('Directory: ' + message + os.sep)

def check_dir_exist(self):
if self.view.window().folders() == []:
sublime.error_message("Project Root Direcoty not found!")
sublime.error_message("Project root directory not found!")

def on_done (self):
if os.name != 'posix':
Expand Down

0 comments on commit fe5b503

Please sign in to comment.