Skip to content
This repository has been archived by the owner on May 17, 2018. It is now read-only.

Commit

Permalink
fix more ST3 issues
Browse files Browse the repository at this point in the history
  • Loading branch information
revolunet committed Jan 13, 2014
1 parent 81cf39c commit 60226fe
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions MarkdownPreview.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,17 @@ def load_utf8(filename):

def load_resource(name):
''' return file contents for files within the package root folder '''
filename = os.path.join(sublime.packages_path(), INSTALLED_DIRECTORY, name)

if not os.path.isfile(filename):
print('Error while lookup resources file: %s', name)
return ''

try:
return load_utf8(filename)
if is_ST3():
filename = os.path.join('Packages', INSTALLED_DIRECTORY, name)
return sublime.load_resource(filename)
else:
filename = os.path.join(sublime.packages_path(), INSTALLED_DIRECTORY, name)
if not os.path.isfile(filename):
print('Error while lookup resources file: %s', name)
return ''
return load_utf8(filename)
except:
print("Error while load_resource('%s')" % filename)
traceback.print_exc()
Expand Down

0 comments on commit 60226fe

Please sign in to comment.