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

Commit

Permalink
Move unicodedata path loading to helper.py
Browse files Browse the repository at this point in the history
helper.py loads first, so unicodedata needs to be here as well.
  • Loading branch information
facelessuser committed Dec 8, 2015
1 parent 570f0b0 commit ee06ade
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
12 changes: 2 additions & 10 deletions MarkdownPreview.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,6 @@
import codecs
import cgi
import yaml
# Make sure unicodedata is accesible,
# if not add the python executable path to sys.path
# so we can properly import it (ST2 Windows).
try:
import unicodedata
except Exception:
sys.path.append(os.path.dirname(sys.executable))
import unicodedata

pygments_local = {
'github': 'pygments_css/github.css',
Expand All @@ -33,10 +25,10 @@ def is_ST3():


if is_ST3():
from .helper import INSTALLED_DIRECTORY
from . import desktop
from .markdown_settings import Settings
from .markdown_wrapper import StMarkdown as Markdown
from .helper import INSTALLED_DIRECTORY
from urllib.request import urlopen, url2pathname, pathname2url
from urllib.parse import urlparse, urlunparse
from urllib.error import HTTPError, URLError
Expand All @@ -51,10 +43,10 @@ def Request(url, data, headers):
unicode_str = str

else:
from helper import INSTALLED_DIRECTORY
import desktop
from markdown_settings import Settings
from markdown_wrapper import StMarkdown as Markdown
from helper import INSTALLED_DIRECTORY
from urllib2 import Request, urlopen, HTTPError, URLError
from urllib import quote, url2pathname, pathname2url
from urlparse import urlparse, urlunparse
Expand Down
9 changes: 9 additions & 0 deletions helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@
import re
import sys

# Make sure unicodedata is accesible,
# if not add the python executable path to sys.path
# so we can properly import it (ST2 Windows).
try:
import unicodedata
except Exception:
sys.path.append(os.path.dirname(sys.executable))
import unicodedata

'''
INSTALLED_DIRECTORY - The install directory name for this plugin.
Expand Down

0 comments on commit ee06ade

Please sign in to comment.