diff options
author | Alexander <alex@spline.inf.fu-berlin.de> | 2020-09-15 21:26:53 +0200 |
---|---|---|
committer | Alexander <alex@spline.inf.fu-berlin.de> | 2020-09-15 21:26:53 +0200 |
commit | 3f7505a50bc6b9b14809f921e977b13c69319db2 (patch) | |
tree | c85f5838a9bd28f2b3dd4376ccbf44f3904a2bf5 /src/git_tftpd | |
parent | 27b3ebd4eb55174e67c643d864458371ad89eb66 (diff) | |
download | git-tftpd-master.tar.gz git-tftpd-master.tar.bz2 git-tftpd-master.zip |
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(): |