mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-02-01 00:45:52 +00:00
snapshot filetree work: fix pyflakes complaints
This commit is contained in:
parent
ff6b09d973
commit
8921c1b666
@ -1,10 +1,12 @@
|
||||
|
||||
from zope.interface import implements
|
||||
from twisted.internet import defer
|
||||
from allmydata.filetree.interfaces import (INode,
|
||||
IDirectoryNode,
|
||||
ISubTree,
|
||||
IMutableSubTree)
|
||||
ICHKDirectoryNode, ISSKDirectoryNode,
|
||||
NoSuchChildError,
|
||||
)
|
||||
from allmydata import download
|
||||
from allmydata.util import bencode
|
||||
|
||||
# interesting feature ideas:
|
||||
@ -16,6 +18,14 @@ from allmydata.util import bencode
|
||||
# vice versa.
|
||||
|
||||
|
||||
def to_node(spec):
|
||||
# TODO
|
||||
pass
|
||||
def to_spec(node):
|
||||
# TODO
|
||||
pass
|
||||
|
||||
|
||||
class SubTreeNode:
|
||||
implements(INode, IDirectoryNode)
|
||||
|
||||
@ -54,7 +64,7 @@ class SubTreeNode:
|
||||
if childname in self.subdirectory_node_children:
|
||||
del self.subdirectory_node_children[childname]
|
||||
elif childname in self.child_specifications:
|
||||
del to_node(self.child_specifications[childname])
|
||||
del self.child_specifications[childname]
|
||||
else:
|
||||
raise NoSuchChildError("no child named '%s'" % (childname,))
|
||||
|
||||
|
@ -216,3 +216,21 @@ class IVirtualDrive(Interface):
|
||||
|
||||
# ... detach subtree, merge subtree, etc
|
||||
|
||||
|
||||
# TODO
|
||||
|
||||
class ICHKDirectoryNode(Interface):
|
||||
pass
|
||||
class ISSKDirectoryNode(Interface):
|
||||
pass
|
||||
|
||||
|
||||
|
||||
class NoSuchChildError(Exception):
|
||||
pass
|
||||
class NoSuchDirectoryError(Exception):
|
||||
pass
|
||||
class PathAlreadyExistsError(Exception):
|
||||
pass
|
||||
class PathDoesNotExistError(Exception):
|
||||
pass
|
||||
|
@ -1,14 +1,21 @@
|
||||
|
||||
from allmydata.filetree import interfaces, opener
|
||||
from zope.interface import implements
|
||||
from allmydata.filetree import opener
|
||||
from allmydata.filetree.interfaces import (IVirtualDrive, ISubTree, IFileNode,
|
||||
IDirectoryNode, NoSuchDirectoryError,
|
||||
NoSuchChildError, PathAlreadyExistsError,
|
||||
PathDoesNotExistError,
|
||||
)
|
||||
from allmydata.upload import IUploadable
|
||||
|
||||
class VirtualDrive(object):
|
||||
implements(interfaces.IVirtualDrive)
|
||||
implements(IVirtualDrive)
|
||||
|
||||
def __init__(self, workqueue, downloader, root_specification):
|
||||
self.workqueue = workqueue
|
||||
workqueue.set_vdrive(self)
|
||||
# TODO: queen?
|
||||
self.opener = Opener(queen, downloader)
|
||||
self.opener = opener.Opener(self.queen, downloader)
|
||||
self.root_specification = root_specification
|
||||
|
||||
# these methods are used to walk through our subtrees
|
||||
@ -59,7 +66,7 @@ class VirtualDrive(object):
|
||||
def _got_directory(node):
|
||||
if not node:
|
||||
raise NoSuchDirectoryError
|
||||
assert interfaces.IDirectoryNode(node)
|
||||
assert IDirectoryNode(node)
|
||||
return node
|
||||
d.addCallback(_got_directory)
|
||||
return d
|
||||
|
@ -1,4 +1,5 @@
|
||||
|
||||
"""
|
||||
from zope.interface import implements
|
||||
from twisted.trial import unittest
|
||||
from twisted.internet import defer
|
||||
@ -309,3 +310,4 @@ del MultipleSubTrees
|
||||
|
||||
class Redirect(unittest.TestCase):
|
||||
pass
|
||||
"""
|
||||
|
@ -346,7 +346,7 @@ class WorkQueue(object):
|
||||
def step_addpath(self, boxname, *path):
|
||||
data = self.read_from_box(boxname)
|
||||
child_node = unserialize(data) # TODO: unserialize ?
|
||||
return self.vdrive.add(path, node)
|
||||
return self.vdrive.add(path, child_node)
|
||||
|
||||
def step_retain_ssk(self, index_a, read_key_a):
|
||||
pass
|
||||
|
Loading…
x
Reference in New Issue
Block a user