diff options
Diffstat (limited to 'src/git_tftpd')
-rw-r--r-- | src/git_tftpd/backend.py | 7 | ||||
-rw-r--r-- | src/git_tftpd/writer.py | 5 |
2 files changed, 5 insertions, 7 deletions
diff --git a/src/git_tftpd/backend.py b/src/git_tftpd/backend.py index 6fae5bd..2d45916 100644 --- a/src/git_tftpd/backend.py +++ b/src/git_tftpd/backend.py @@ -7,12 +7,11 @@ from tftp.util import deferred from twisted.python.context import get from twisted.python.filepath import FilePath, InsecurePath -from zope import interface +from zope.interface import implementer +@implementer(IBackend) class GitBackend(object): - interface.implements(IBackend) - def __init__(self, base_path): self.base_path = base_path self.base = FilePath(base_path) @@ -25,6 +24,6 @@ class GitBackend(object): def get_writer(self, file_name): try: target_path = self.base.descendant(file_name.split("/")) - except InsecurePath, e: + except InsecurePath as e: raise AccessViolation("Insecure path: %s" % e) return GitWriter(target_path, self.base_path, get('remote')) diff --git a/src/git_tftpd/writer.py b/src/git_tftpd/writer.py index bee731c..a181592 100644 --- a/src/git_tftpd/writer.py +++ b/src/git_tftpd/writer.py @@ -7,12 +7,11 @@ from .git import GitRepo from tftp.backend import IWriter from twisted.python import log -from zope import interface +from zope.interface import implementer +@implementer(IWriter) class GitWriter(object): - interface.implements(IWriter) - def __init__(self, file_path, repo, remote): file_dir = file_path.parent() if not file_dir.exists(): |