Permalink
Browse files

An ugly way to solve the import problem between Py2 and Py2.

  • Loading branch information...
1 parent 79afc76 commit 123101031a5fa0ac8dc5c87eb492dad9c29a935e @demon386 committed Mar 23, 2013
Showing with 25 additions and 7 deletions.
  1. +5 −1 headline.py
  2. +6 −2 headline_move.py
  3. +6 −2 smart_folding.py
  4. +4 −1 smart_table.py
  5. +4 −1 table.py
View
@@ -9,7 +9,11 @@
import re
import sublime
-from .utilities import is_region_void
+
+try:
+ from .utilities import is_region_void
+except ValueError:
+ from utilities import is_region_void
MATCH_PARENT = 1 # Match headlines at the same or higher level
MATCH_CHILD = 2 # Match headlines at the same or lower level
View
@@ -8,8 +8,12 @@
import sublime
import sublime_plugin
-from . import headline
-from .utilities import is_region_void
+try:
+ from . import headline
+ from .utilities import is_region_void
+except ValueError:
+ import headline
+ from utilities import is_region_void
class HeadlineMoveCommand(sublime_plugin.TextCommand):
View
@@ -13,8 +13,12 @@
import sublime
import sublime_plugin
-from . import headline
-from .utilities import is_region_void
+try:
+ from . import headline
+ from .utilities import is_region_void
+except ValueError:
+ import headline
+ from utilities import is_region_void
HEADLINE_PATTERN = re.compile(r'^(#+)\s.*')
View
@@ -10,7 +10,10 @@
import sublime
import sublime_plugin
-from . import table
+try:
+ from . import table
+except ValueError:
+ import table
class SmartTable(sublime_plugin.TextCommand):
View
@@ -14,7 +14,10 @@
import sublime
-from . import utilities
+try:
+ from . import utilities
+except ValueError:
+ import utilities
TABLE_PATTERN = re.compile(r"\s*\|")
SEPARATOR_PATTERN = re.compile(r"\s*(\+[=-])")

0 comments on commit 1231010

Please sign in to comment.