Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
use relative imports everywhere to avoid more of Python's BS
depending on how you import a module, it might be imported multiple times
leading to strange bugs if the module needs initialisation or is otherwise stateful
  • Loading branch information
DisposaBoy committed Feb 1, 2018
1 parent 257f749 commit 2d0daa6
Show file tree
Hide file tree
Showing 14 changed files with 42 additions and 42 deletions.
16 changes: 8 additions & 8 deletions GoSublime.py
Expand Up @@ -22,10 +22,10 @@
print("GoSublime: %s" % execErr)

def loadable_mods():
from gosubl import gs
from gosubl import sh
from gosubl import margo
from gosubl import mg9
from .gosubl import gs
from .gosubl import sh
from .gosubl import margo
from .gosubl import mg9

return [
('gs', gs),
Expand All @@ -35,10 +35,10 @@ def loadable_mods():
]

def plugin_loaded():
from gosubl import about
from gosubl import sh
from gosubl import ev
from gosubl import gs
from .gosubl import about
from .gosubl import sh
from .gosubl import ev
from .gosubl import gs

if VERSION != about.VERSION:
gs.show_output('GoSublime-main', '\n'.join([
Expand Down
2 changes: 1 addition & 1 deletion gosubl/gs.py
@@ -1,7 +1,7 @@
# Sublime modelines - https://github.com/SublimeText/Modelines
# sublime: translate_tabs_to_spaces false; rulers [100,120]

from gosubl import about
from . import about
from subprocess import Popen, PIPE
import copy
import datetime
Expand Down
2 changes: 1 addition & 1 deletion gosubl/gspatch.py
@@ -1,4 +1,4 @@
from gosubl import gs
from . import gs
import sublime
import sys

Expand Down
2 changes: 1 addition & 1 deletion gosubl/gsq.py
@@ -1,4 +1,4 @@
from gosubl import gs
from . import gs
import sublime
import threading

Expand Down
4 changes: 2 additions & 2 deletions gosubl/gsshell.py
@@ -1,5 +1,5 @@
from gosubl import gs
from gosubl import sh
from . import gs
from . import sh
import hashlib
import os
import re
Expand Down
10 changes: 5 additions & 5 deletions gosubl/mg9.py
@@ -1,8 +1,8 @@
from gosubl import about
from gosubl import ev
from gosubl import gs
from gosubl import gsq
from gosubl import sh
from . import about
from . import ev
from . import gs
from . import gsq
from . import sh
import atexit
import base64
import glob
Expand Down
12 changes: 6 additions & 6 deletions gs9o.py
@@ -1,9 +1,9 @@
from gosubl import about
from gosubl import gs
from gosubl import gsq
from gosubl import gsshell
from gosubl import mg9
from gosubl import sh
from .gosubl import about
from .gosubl import gs
from .gosubl import gsq
from .gosubl import gsshell
from .gosubl import mg9
from .gosubl import sh
import datetime
import json
import os
Expand Down
6 changes: 3 additions & 3 deletions gscommands.py
@@ -1,6 +1,6 @@
from gosubl import gs
from gosubl import gspatch
from gosubl import mg9
from .gosubl import gs
from .gosubl import gspatch
from .gosubl import mg9
import datetime
import os
import sublime
Expand Down
4 changes: 2 additions & 2 deletions gscomplete.py
@@ -1,5 +1,5 @@
from gosubl import gs
from gosubl import mg9
from .gosubl import gs
from .gosubl import mg9
from os.path import basename
from os.path import dirname
import json
Expand Down
6 changes: 3 additions & 3 deletions gsdoc.py
@@ -1,6 +1,6 @@
from gosubl import gs
from gosubl import gsq
from gosubl import mg9
from .gosubl import gs
from .gosubl import gsq
from .gosubl import mg9
import os
import re
import sublime
Expand Down
2 changes: 1 addition & 1 deletion gsev.py
@@ -1,4 +1,4 @@
from gosubl import gs
from .gosubl import gs
from . import gstest
import sublime
import sublime_plugin
Expand Down
8 changes: 4 additions & 4 deletions gslint.py
@@ -1,7 +1,7 @@
from gosubl import gs
from gosubl import gsq
from gosubl import gsshell
from gosubl import mg9
from .gosubl import gs
from .gosubl import gsq
from .gosubl import gsshell
from .gosubl import mg9
import os
import re
import sublime
Expand Down
6 changes: 3 additions & 3 deletions gspalette.py
@@ -1,6 +1,6 @@
from gosubl import gs
from gosubl import gspatch
from gosubl import mg9
from .gosubl import gs
from .gosubl import gspatch
from .gosubl import mg9
from os.path import dirname, basename, relpath
from . import gslint
import re
Expand Down
4 changes: 2 additions & 2 deletions gstest.py
@@ -1,5 +1,5 @@
from gosubl import gs
from gosubl import mg9
from .gosubl import gs
from .gosubl import mg9
import os
import re
import sublime
Expand Down

0 comments on commit 2d0daa6

Please sign in to comment.