Permalink
Browse files

Lazy load sendtotrash, desktop. 2nd fix #92

  • Loading branch information...
titoBouzout committed Apr 28, 2013
1 parent aa4328d commit 2e106b3559ad5d0d8378027fc133c3b69dd02360
Showing with 9 additions and 12 deletions.
  1. +3 −3 .gitignore
  2. +1 −1 Side Bar.sublime-settings
  3. +4 −3 SideBar.py
  4. +1 −5 sidebar/SideBarItem.py
View
@@ -1,4 +1,4 @@
-*.sublime-project
-*.cache
-push.bat
+*.sublime-project
+*.cache
+push.bat
*.pyc
@@ -24,7 +24,7 @@
"disabled_menuitem_empty": true,
//if installed in a default location maybe this works.
- "default_browser": "chrome", //one of this list: firefox, chrome, chromium, opera, safari
+ "default_browser": "", //one of this list: firefox, chrome, chromium, opera, safari
"portable_browser": "" // for example: C:/Program Files (x86)/Nightly/firefox.exe
View
@@ -7,7 +7,6 @@
from .sidebar.SideBarItem import SideBarItem
from .sidebar.SideBarSelection import SideBarSelection
from .sidebar.SideBarProject import SideBarProject
-from .send2trash import send2trash
# needed for getting local app data path on windows
if sublime.platform() == 'windows':
@@ -1053,6 +1052,7 @@ def run(self, paths = [], confirmed = 'False'):
self.confirm([item.path() for item in SideBarSelection(paths).getSelectedItems()], [item.pathWithoutProject() for item in SideBarSelection(paths).getSelectedItems()])
else:
try:
+ from .send2trash import send2trash
for item in SideBarSelection(paths).getSelectedItemsWithoutChildItems():
if s.get('close_affected_buffers_when_deleting_even_if_dirty', False):
item.close_associated_buffers()
@@ -1144,6 +1144,7 @@ def run(self, paths = [], confirmed = 'False'):
else:
try:
for item in SideBarSelection(paths).getSelectedDirectoriesOrDirnames():
+ from .send2trash import send2trash
for content in os.listdir(item.path()):
file = os.path.join(item.path(), content)
if not SideBarSelection().isNone(file):
@@ -1440,12 +1441,12 @@ def try_open(self, url, browser):
pass
try:
if sublime.platform() == 'windows':
- print(url);
- commands = ['start', url]
+ commands = ['cmd','/c','start', '', url]
subprocess.Popen(commands)
elif sublime.platform() == 'linux':
commands = ['xdg-open', url]
subprocess.Popen(commands)
+ return
except:
pass
View
@@ -6,11 +6,6 @@
from .SideBarProject import SideBarProject
-try:
- from . import desktop
-except:
- pass
-
class Object():
pass
@@ -188,6 +183,7 @@ def open(self):
import subprocess
subprocess.Popen([self.nameSystem()], cwd=self.dirnameSystem(), shell=True)
else:
+ from . import desktop
desktop.open(self.path())
def edit(self):

0 comments on commit 2e106b3

Please sign in to comment.