summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2021-01-17 21:25:57 +0000
committerRoy Marples <roy@marples.name>2021-01-17 21:25:57 +0000
commitc093fc18d834f0545f186a84a11c58d8696f6e47 (patch)
tree73785016468a10b7bb8568f42894cf5545c7dfea
parent7d4553c150daae9f1cfe900e61e8b25c663a9a94 (diff)
downloadpython-fastimport-git-c093fc18d834f0545f186a84a11c58d8696f6e47.tar.gz
Import our own modules using relative pathing
This allows python-fastimport to be embedded as vendor code within other modules. Although python disallows a dash in a module name so I called it vendor/python_fastimport.
-rw-r--r--fastimport/commands.py2
-rw-r--r--fastimport/dates.py2
-rw-r--r--fastimport/parser.py4
-rw-r--r--fastimport/processor.py4
-rw-r--r--fastimport/processors/filter_processor.py2
-rw-r--r--fastimport/processors/info_processor.py6
-rw-r--r--fastimport/processors/query_processor.py2
7 files changed, 10 insertions, 12 deletions
diff --git a/fastimport/commands.py b/fastimport/commands.py
index f2b44fb..6278c78 100644
--- a/fastimport/commands.py
+++ b/fastimport/commands.py
@@ -24,7 +24,7 @@ import re
import stat
import sys
-from fastimport.helpers import (
+from .helpers import (
newobject as object,
utf8_bytes_string,
repr_bytes,
diff --git a/fastimport/dates.py b/fastimport/dates.py
index 3deb8e1..e1c660b 100644
--- a/fastimport/dates.py
+++ b/fastimport/dates.py
@@ -24,7 +24,7 @@ timestamp,timezone where
"""
import time
-from fastimport import errors
+from . import errors
def parse_raw(s, lineno=0):
diff --git a/fastimport/parser.py b/fastimport/parser.py
index d53ffe5..0a88d84 100644
--- a/fastimport/parser.py
+++ b/fastimport/parser.py
@@ -164,12 +164,12 @@ import re
import sys
import codecs
-from fastimport import (
+from . import (
commands,
dates,
errors,
)
-from fastimport.helpers import (
+from .helpers import (
newobject as object,
utf8_bytes_string,
)
diff --git a/fastimport/processor.py b/fastimport/processor.py
index 1eb33cb..be4270c 100644
--- a/fastimport/processor.py
+++ b/fastimport/processor.py
@@ -32,8 +32,8 @@ processors package for examples.
import sys
import time
-from fastimport import errors
-from fastimport.helpers import newobject as object
+from . import errors
+from .helpers import newobject as object
class ImportProcessor(object):
diff --git a/fastimport/processors/filter_processor.py b/fastimport/processors/filter_processor.py
index 6c8c967..91c54f1 100644
--- a/fastimport/processors/filter_processor.py
+++ b/fastimport/processors/filter_processor.py
@@ -14,7 +14,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
"""Import processor that filters the input (and doesn't import)."""
-from fastimport import (
+from .. import (
commands,
helpers,
processor,
diff --git a/fastimport/processors/info_processor.py b/fastimport/processors/info_processor.py
index ffbfef7..3268e29 100644
--- a/fastimport/processors/info_processor.py
+++ b/fastimport/processors/info_processor.py
@@ -18,16 +18,14 @@
from __future__ import absolute_import
from .. import (
+ commands,
+ processor,
reftracker,
)
from ..helpers import (
invert_dict,
invert_dictset,
)
-from fastimport import (
- commands,
- processor,
- )
import stat
diff --git a/fastimport/processors/query_processor.py b/fastimport/processors/query_processor.py
index 0d40b48..ce93c90 100644
--- a/fastimport/processors/query_processor.py
+++ b/fastimport/processors/query_processor.py
@@ -17,7 +17,7 @@
from __future__ import print_function
-from fastimport import (
+from .. import (
commands,
processor,
)