Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

python2.7, pep8, simplify buildout

  • Loading branch information...
commit 3a63e2bc1f0e3773aba084893dbfbd0d4998d2be 1 parent 0fb1f45
@rnixx rnixx authored
View
1  .gitignore
@@ -10,6 +10,7 @@ develop-eggs
src/packages
*~
.pydevproject
+.pydevproject.bak
.project
var
.DS_Store
View
16 HISTORY.rst
@@ -2,7 +2,21 @@
History
=======
+
+1.0.1dev
+--------
+
+- PEP-8.
+ [rnix, 2012-10-16]
+
+- Python 2.7 Support.
+ [rnix, 2012-10-16]
+
+- Fix documentation.
+
+
1.0
---
-- make it work [rnix, jensens, et al]
+- make it work
+ [rnix, jensens, et al]
View
33 base.cfg
@@ -1,33 +0,0 @@
-[buildout]
-parts = test coverage py
-develop = .
-
-extensions = mr.developer
-sources = sources
-sources-dir = ${buildout:directory}/devsrc
-auto-checkout = *
-always-checkout = true
-
-[remotes]
-bda = git://github.com/bluedynamics
-bda_push = git@github.com:bluedynamics
-
-[sources]
-node.ext.zodb = git ${remotes:bda}/node.ext.zodb.git pushurl=${remotes:bda_push}/node.ext.zodb.git
-
-[test]
-recipe = zc.recipe.testrunner
-eggs =
- souper[test]
-defaults = ['--auto-color', '--auto-progress']
-
-[coverage]
-recipe = zc.recipe.testrunner
-eggs = ${test:eggs}
-defaults = ['--coverage', '../../coverage', '-v', '--auto-progress']
-
-[py]
-recipe = zc.recipe.egg
-eggs =
- ${test:eggs}
-interpreter = py
View
37 buildout.cfg
@@ -1,22 +1,47 @@
[buildout]
-extends = base.cfg
-unzip = true
-
-parts += omelette
+parts = test coverage py pydev omelette
+develop = .
extensions = mr.developer
+sources = sources
sources-dir = ${buildout:directory}/devsrc
-always-checkout = force
auto-checkout = *
-
+always-checkout = true
+unzip = true
[remotes]
bda = git://github.com/bluedynamics
bda_push = git@github.com:bluedynamics
[sources]
+odict = git ${remotes:bda}/odict.git pushurl=${remotes:bda_push}/odict.git
+node = git ${remotes:bda}/node.git pushurl=${remotes:bda_push}/node.git
node.ext.zodb = git ${remotes:bda}/node.ext.zodb.git pushurl=${remotes:bda_push}/node.ext.zodb.git
+[test]
+recipe = zc.recipe.testrunner
+eggs =
+ souper[test]
+ node.ext.zodb[test]
+ odict[test]
+ node[test]
+defaults = ['--auto-color', '--auto-progress']
+
+[coverage]
+recipe = zc.recipe.testrunner
+eggs = ${test:eggs}
+defaults = ['--coverage', '../../coverage', '-v', '--auto-progress']
+
+[py]
+recipe = zc.recipe.egg
+eggs =
+ ${test:eggs}
+interpreter = py
+
+[pydev]
+recipe = pb.recipes.pydev
+eggs = ${test:eggs}
+
[omelette]
recipe = collective.recipe.omelette
eggs = ${test:eggs}
View
6 setup.py
@@ -1,7 +1,7 @@
from setuptools import setup, find_packages
import os
-version = '1.0'
+version = '1.0.1dev'
shortdesc = \
'Souper - Generic Indexed Storage based on ZODB'
longdesc = open(os.path.join(os.path.dirname(__file__), 'README.rst')).read()
@@ -26,7 +26,7 @@
url=u'http://packages.python.org/souper',
license='BSD',
packages=find_packages('src'),
- package_dir = {'': 'src'},
+ package_dir={'': 'src'},
namespace_packages=['souper'],
include_package_data=True,
zip_safe=True,
@@ -37,7 +37,7 @@
],
tests_require=tests_require,
test_suite="souper.tests.test_suite",
- extras_require = dict(
+ extras_require=dict(
test=tests_require,
),
)
View
8 src/souper/interfaces.py
@@ -8,11 +8,9 @@
class ISoup(Interface):
"""The Container Interface.
"""
-
soup_name = Attribute(u"The identifier of this Soup")
nextrecordindex = Attribute(u"The next record index to use.")
-
def add(record):
"""Add record to soup.
@@ -75,7 +73,7 @@ def storage(soup_name):
class IRecordIndexer(Interface):
"""Interface to lookup values for being indexed from record.
"""
-
+
def __call__(context, default):
"""returns value to be indexed.
"""
@@ -88,6 +86,6 @@ class INodeAttributeIndexer(IRecordIndexer):
class INodeTextIndexer(IRecordIndexer):
"""Indexer combining several node attributes for fulltext search.
-
+
All combined attribute values must be string.
- """
+ """
View
10 src/souper/soup.py
@@ -77,10 +77,10 @@ def catalog(self):
factory = getUtility(ICatalogFactory, name=self.soup_name)
storage.catalog = factory(self.context)
return storage.catalog
-
+
def get(self, intid):
return self.data[intid]
-
+
def add(self, record):
"""adds a new record to the soup, creates soup unique id and index it.
"""
@@ -192,10 +192,10 @@ def __call__(self, context, default):
@implementer(INodeTextIndexer)
class NodeTextIndexer(object):
-
+
def __init__(self, attrs):
self.attrs = attrs
-
+
def __call__(self, context, default):
values = list()
for attr in self.attrs:
@@ -206,4 +206,4 @@ def __call__(self, context, default):
values = [_.strip().decode('utf-8') for _ in values if _.strip()]
if not values:
return default
- return u' '.join(values)
+ return u' '.join(values)
Please sign in to comment.
Something went wrong with that request. Please try again.