Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Spring cleaning (Treant unification, no uuids, .datreant state) #145

Merged
merged 43 commits into from Nov 14, 2017
Merged
Changes from 4 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
802a22e
Removed uuids, also now use .datreant directory for Treant
dotsdl Apr 13, 2017
f931bc4
More hacking, getting tests to work, removing cruft.
dotsdl Apr 24, 2017
cfadd6d
Tests finally pass again. Need to add things I cut to changelog.
dotsdl Apr 24, 2017
86c4a69
Changed Treant.json to state.json
dotsdl Apr 24, 2017
dac55af
Now tags and categories have their own state file.
dotsdl May 5, 2017
27eef03
Using __getattribute__ requires __setstate__ gymnastics.
dotsdl May 5, 2017
9b67b2c
Added treeloc, leafloc path accessors to Tree, View, Bundle.
dotsdl May 28, 2017
dca3cf6
Bundle, View repr simplifications.
dotsdl Jul 16, 2017
ce0f3c6
Tests pass again. Can remove from bundle with names.
dotsdl Jul 16, 2017
2adcc2d
remove os library usage
kain88-de Jul 21, 2017
4c2b2be
use python 3.6 API of os.makedirs
kain88-de Jul 21, 2017
501c7dc
fix failing tests
kain88-de Jul 21, 2017
18a7330
verbose travis pytest output
kain88-de Jul 21, 2017
2b36a62
change python versions
kain88-de Jul 21, 2017
a98c43c
mock FileNotFoundError on python2.7
kain88-de Jul 21, 2017
aa0c161
fix python 2.7 error
kain88-de Jul 21, 2017
6f11e7d
add selection str parser
kain88-de Jul 6, 2017
83d42ff
possibly improve _getselection speed
kain88-de Jul 23, 2017
0528aec
Merge pull request #148 from datreant/add-selection-parser
dotsdl Jul 24, 2017
d77e6db
Small pep8 fixes to selectionparser.
dotsdl Jul 24, 2017
96a0de1
Simplified pickling; fixed pool behavior for Python 2.7 in the process
dotsdl Jul 24, 2017
d3f8a24
Added __fspath__ method to Veg.
dotsdl Jul 24, 2017
e019cd9
Added python-Levenshtein to dependencies to avoid ugly warning.
dotsdl Jul 24, 2017
91f42e4
add docstring for parse_selection
kain88-de Jul 24, 2017
8e47c5d
fix util.makedirs API
kain88-de Jul 24, 2017
51be851
Draw now doesn't display hidden directories by default.
dotsdl Jul 29, 2017
5ac5f96
Merge branch 'develop' into sp_c_merge
dotsdl Jul 29, 2017
1a770a0
.trees, .leaves are now methods with `hidden` keyword.
dotsdl Jul 29, 2017
d6eac7d
Limbs are generally applicable to Treants and Trees.
dotsdl Jul 31, 2017
a19006f
Allow all printable chars in selection parser
kain88-de Aug 16, 2017
5891e21
use range instead of xrange
kain88-de Aug 22, 2017
a153078
add test for __str__ of a treant tag
kain88-de Aug 22, 2017
dff9d9b
Removed all concept of limbs; View and Bundle practically immutable
dotsdl Oct 9, 2017
df30d66
Merge branch 'spring_cleaning' of github.com:datreant/datreant.core i…
dotsdl Oct 9, 2017
a0b918f
update gitignore
kain88-de Oct 9, 2017
b016323
use capital letter for globals
kain88-de Oct 10, 2017
f421cdb
remove unused kwargs
kain88-de Oct 10, 2017
78f7178
remove unnecessary import
kain88-de Oct 10, 2017
ae82c51
Added exceptions for when `.datreant` directory is missing.
dotsdl Nov 14, 2017
e5db06d
Merge branch 'spring_cleaning' of github.com:datreant/datreant.core i…
dotsdl Nov 14, 2017
890b720
Updated docs in line with changes in spring cleaning.
dotsdl Nov 14, 2017
ba55c61
Added docstrings to _init_state staticmethods pointing out their use
dotsdl Nov 14, 2017
5a2d993
Added note on file handles to docs.
dotsdl Nov 14, 2017
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

@@ -12,7 +12,6 @@
"""
# global registries of classes. Must be imported first! Other modules will try
# to import them and fail if they don't exist already
_TREANTS = dict()

_TREELIMBS = dict()
_LIMBS = dict()
@@ -10,7 +10,6 @@

from fuzzywuzzy import process

from . import filesystem
from . import _AGGTREELIMBS, _AGGLIMBS
from .collections import Bundle
from .limbs import Tags, Categories
@@ -9,34 +9,6 @@
from .core import JSONFile


def treantfile(filename, **kwargs):
"""Generate or regenerate the appropriate treant file instance from
filename.
:Arguments:
*filename*
path to state file (existing or to be created), including the
filename
:Returns:
*treantfile*
treantfile instance attached to the given file
"""
from .. import _TREANTS

treanttype = os.path.basename(filename).split(os.extsep)[0]

try:
statefileclass = _TREANTS[treanttype]._backendclass
except KeyError:
warnings.warn("No known treant type for file '{}'; "
"defaulting to TreantFile".format(filename))
statefileclass = _TREANTS['Treant']._backendclass

return statefileclass(filename, **kwargs)


class TreantFile(JSONFile):
"""Treant state file.
Oops, something went wrong.
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.