Skip to content

Commit

Permalink
Removed inconsistent convenience interfaces; fixes #114 (#132)
Browse files Browse the repository at this point in the history
Removed Tree.treants, Treant.treants, View.bundle, Bundle.view,
Tree.discover, Treant.discover; favor use of classes and functions
directly for finer control (#114)
  • Loading branch information
dotsdl authored and kain88-de committed Feb 22, 2017
1 parent 2ee9fb2 commit 8e7e2f9
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 54 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ The rules for this file:

API Changes
* Group object no longer supported; removed (#130)
* Removed Tree.treants, Treant.treants, View.bundle, Bundle.view,
Tree.discover, Treant.discover; favor use of classes and functions
directly for finer control (#114)


Enhancements
Expand All @@ -27,7 +30,6 @@ Enhancements
Fixes



Changes


Expand Down
15 changes: 0 additions & 15 deletions src/datreant/core/collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -438,14 +438,6 @@ def relpaths(self):
"""
return [member.relpath for member in self]

@property
def bundle(self):
"""Obtain a Bundle of all existing Treants among the Trees and Leaves
in this View.
"""
return Bundle(self, limbs=self.limbs)

@property
def exists(self):
"""List giving existence of each member as a boolean.
Expand Down Expand Up @@ -1060,13 +1052,6 @@ def searchtime(self, value):
else:
raise TypeError("Must give a number or `None` for searchtime")

@property
def view(self):
"""Obtain a View giving the Tree for each Treant in this Bundle.
"""
return View([member.tree for member in self], limbs=self.limbs)

def globfilter(self, pattern):
"""Return a Bundle of members that match by name the given globbing
pattern.
Expand Down
25 changes: 0 additions & 25 deletions src/datreant/core/tests/test_trees.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,31 +173,6 @@ def test_hidden(self, tree):

assert len(tree.hidden) == 2

def test_treants(self, tree):
with pytest.raises(OSError):
tree.treants

# actually make the directory now
tree.makedirs()

assert len(tree.treants) == 0

# should only give treants immediately present in tree
Treant(tree['a/sprout/'])
Treant(tree['hide/here/'])

assert len(tree.treants) == 0

# should give treants immediately present in tree, including hidden
# ones
for name in ('thing1/', '.thing2/', 'thing3/'):
Treant(tree[name])

assert len(tree.treants) == 3

def test_discover(self, tree):
pass

def test_equal(self, tree):
t1 = tree['a dir/']
t2 = tree['another dir/']
Expand Down
13 changes: 0 additions & 13 deletions src/datreant/core/trees.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,19 +392,6 @@ def children(self):
from .collections import View
return View(self.trees + self.leaves + self.hidden, limbs=self.limbs)

discover = discover

@property
def treants(self):
"""Bundle of all Treants found within this Tree.
This does not return a Treant for a bare state file found within this
Tree. In effect this gives the same result as ``Bundle(self.trees)``.
"""
from .collections import Bundle
return Bundle(self.trees + self.hidden.membertrees, limbs=self.limbs)

def glob(self, pattern):
"""Return a View of all child Leaves and Trees matching given globbing
pattern.
Expand Down

0 comments on commit 8e7e2f9

Please sign in to comment.