Skip to content

Commit

Permalink
Merge f397954 into dc122f1
Browse files Browse the repository at this point in the history
  • Loading branch information
jensens committed Jul 8, 2019
2 parents dc122f1 + f397954 commit 992ef38
Show file tree
Hide file tree
Showing 31 changed files with 519 additions and 608 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ var/
# files
.installed.cfg
.mr.developer.cfg
.python-version
lib64
log.html
output.xml
Expand Down
28 changes: 16 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,32 @@
language: python
sudo: false
matrix:
include:
- python: "2.7"
env: PLONE_VERSION=5.2.x
- python: "3.6"
env: PLONE_VERSION=5.2.x
- python: "3.7"
env: PLONE_VERSION=5.2.x
dist: xenial
sudo: true
cache:
pip: true
directories:
- $HOME/buildout-cache
python:
- 2.7
- eggs
- downloads
before_install:
- mkdir -p $HOME/buildout-cache/{eggs,downloads}
- mkdir $HOME/.buildout
- echo "[buildout]" > $HOME/.buildout/default.cfg
- echo "download-cache = $HOME/buildout-cache/downloads" >> $HOME/.buildout/default.cfg
- echo "eggs-directory = $HOME/buildout-cache/eggs" >> $HOME/.buildout/default.cfg
- pip install -r requirements-$PLONE_VERSION.txt
- ln -sf plone-$PLONE_VERSION.cfg buildout.cfg
install:
- python bootstrap-buildout.py -c travis.cfg
- bin/buildout -Nc travis.cfg
- buildout -N annotate
- buildout -N
script:
- bin/code-analysis
- bin/test
after_success:
- bin/createcoverage
- pip install coveralls
- coveralls

notifications:
email:
- jk@kleinundpartner.at
14 changes: 11 additions & 3 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
Changelog
=========


1.1 (unreleased)
2.0 (unreleased)
----------------

- Python 3 compatibility
[jensens]

- Refactor index to be less complex on indexing.
[jensens]

- Bugfix: Use latest plone.app.multilingual and add subscribers to ensure in-/rein-/unindexing.
[jensens]

- Fixing "RuntimeError: the bucket being iterated changed size" (issue #3)
[gogobd]

- Depend on ``Products.CMFPlone`` instead of ``Plone`` to not fetch unnecessary dependencies.
[thet]

Expand Down
9 changes: 9 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@
plone.app.multilingualindexes
==============================================================================

.. image:: https://travis-ci.org/plone/plone.app.multilingualindexes.svg?branch=master
:target: https://travis-ci.org/plone/plone.app.multilingualindexes

.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/python/black

.. image:: https://coveralls.io/repos/github/plone/plone.app.multilingualindexes/badge.svg?branch=master
:target: https://coveralls.io/github/plone/plone.app.multilingualindexes?branch=master

Indexes optimized to query multilingual content made with plone.app.multilingual.

Features
Expand Down
45 changes: 45 additions & 0 deletions base.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
[buildout]
extensions = mr.developer
always-checkout = true
sources-dir = devsrc
extends =
https://raw.githubusercontent.com/plone/buildout.coredev/5.2/sources.cfg
auto-checkout =
archetypes.multilingual
plone.app.multilingual
parts =
instance
test
releaser
i18ndude
omelette
develop = .


[instance]
recipe = plone.recipe.zope2instance
user = admin:admin
http-address = 8080
eggs =
plone.app.multilingualindexes

[omelette]
recipe = collective.recipe.omelette
eggs = ${test:eggs}


[test]
recipe = zc.recipe.testrunner
eggs =
plone.app.multilingualindexes[test]
defaults = ['-s', 'plone.app.multilingualindexes', '--auto-color', '--auto-progress']


[releaser]
recipe = zc.recipe.egg
eggs = zest.releaser[recommended]


[i18ndude]
recipe = zc.recipe.egg
eggs = i18ndude
7 changes: 0 additions & 7 deletions bootstrap.sh

This file was deleted.

66 changes: 0 additions & 66 deletions buildout.cfg

This file was deleted.

6 changes: 3 additions & 3 deletions coredev5.cfg
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[buildout]
extends =
https://raw.githubusercontent.com/plone/buildout.coredev/5.1/versions.cfg
https://raw.githubusercontent.com/plone/buildout.coredev/5.1/sources.cfg
https://raw.githubusercontent.com/plone/buildout.coredev/5.1/checkouts.cfg
https://raw.githubusercontent.com/plone/buildout.coredev/5.2/versions.cfg
https://raw.githubusercontent.com/plone/buildout.coredev/5.2/sources.cfg
https://raw.githubusercontent.com/plone/buildout.coredev/5.3/checkouts.cfg

sources-dir = devsrc
4 changes: 4 additions & 0 deletions plone-5.2.x.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[buildout]
extends =
https://dist.plone.org/release/5.2-latest/versions.cfg
base.cfg
1 change: 1 addition & 0 deletions requirements-5.2.x.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-r https://dist.plone.org/release/5.2-latest/requirements.txt
61 changes: 27 additions & 34 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,57 +5,50 @@
from setuptools import setup


long_description = '\n\n'.join([
open('README.rst').read(),
open('CONTRIBUTORS.rst').read(),
open('CHANGES.rst').read(),
])
long_description = "\n\n".join(
[
open("README.rst").read(),
open("CONTRIBUTORS.rst").read(),
open("CHANGES.rst").read(),
]
)


setup(
name='plone.app.multilingualindexes',
version='1.1.dev0',
name="plone.app.multilingualindexes",
version="2.0.dev0",
description="Multilingual Catalog Indexes for Plone",
long_description=long_description,
# Get more from https://pypi.python.org/pypi?%3Aaction=list_classifiers
classifiers=[
"Environment :: Web Environment",
"Framework :: Plone",
"Framework :: Plone :: 5.1",
"Framework :: Plone :: Addon",
"Framework :: Plone :: 5.2",
"Programming Language :: Python",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Operating System :: OS Independent",
"License :: OSI Approved :: GNU General Public License v2 (GPLv2)",
],
keywords='Python Plone',
author='Jens W. Klein',
author_email='jk@kleinundpartner.at',
url='https://pypi.python.org/pypi/plone.app.multilingualindexes',
license='GPL version 2',
packages=find_packages('src', exclude=['ez_setup']),
namespace_packages=['plone', 'plone.app'],
package_dir={'': 'src'},
keywords="Python Plone",
author="Jens W. Klein",
author_email="jk@kleinundpartner.at",
url="https://pypi.python.org/pypi/plone.app.multilingualindexes",
license="GPL version 2",
packages=find_packages("src", exclude=["ez_setup"]),
namespace_packages=["plone", "plone.app"],
package_dir={"": "src"},
include_package_data=True,
zip_safe=False,
install_requires=[
'plone.api',
'Products.CMFPlone',
'Products.GenericSetup>=1.8.2',
'setuptools',
'z3c.jbot',
],
install_requires=["Products.CMFPlone", "setuptools"],
extras_require={
'test': [
'plone.app.testing',
# Plone KGS does not use this version, because it would break
# Remove if your package shall be part of coredev.
# plone_coredev tests as of 2016-04-01.
'plone.testing>=5.0.0',
'plone.app.contenttypes',
'plone.app.robotframework[debug]',
'plone.app.multilingual[test]',
'plone.app.querystring >1.3.999'
],
"test": [
"plone.app.testing",
"plone.app.multilingual[test]",
"plone.app.querystring",
]
},
entry_points="""
[z3c.autoinclude.plugin]
Expand Down
2 changes: 1 addition & 1 deletion src/plone/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# -*- coding: utf-8 -*-
__import__('pkg_resources').declare_namespace(__name__)
__import__("pkg_resources").declare_namespace(__name__)
2 changes: 1 addition & 1 deletion src/plone/app/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# -*- coding: utf-8 -*-
__import__('pkg_resources').declare_namespace(__name__)
__import__("pkg_resources").declare_namespace(__name__)
24 changes: 14 additions & 10 deletions src/plone/app/multilingualindexes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,24 @@
from zope.i18nmessageid import MessageFactory


_ = MessageFactory('plone.app.multilingualindexes')
_ = MessageFactory("plone.app.multilingualindexes")


def initialize(context):
from plone.app.multilingualindexes.languagefallback import LanguageFallbackIndex # NOQA
from plone.app.multilingualindexes.languagefallback import manage_addLFBIndexForm # NOQA
from plone.app.multilingualindexes.languagefallback import manage_addLFBIndex # NOQA
from plone.app.multilingualindexes.languagefallback import (
LanguageFallbackIndex,
) # NOQA
from plone.app.multilingualindexes.languagefallback import (
manage_addLFBIndexForm,
) # NOQA
from plone.app.multilingualindexes.languagefallback import (
manage_addLFBIndex,
) # NOQA

context.registerClass(
LanguageFallbackIndex,
permission='Add Pluggable Index',
constructors=(manage_addLFBIndexForm,
manage_addLFBIndex
),
icon='www/index.gif',
visibility=None
permission="Add Pluggable Index",
constructors=(manage_addLFBIndexForm, manage_addLFBIndex),
icon="www/index.gif",
visibility=None,
)
14 changes: 6 additions & 8 deletions src/plone/app/multilingualindexes/browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,22 @@


class TGPathFolderListing(BrowserView):

def __call__(self, batch=False, b_size=20, b_start=0, orphan=0, **kw):
query = {}
query.update(kw)

query['tgpath'] = {'query': '/'.join(tg_path(self.context)),
'depth': 1}
query["tgpath"] = {"query": "/".join(tg_path(self.context)), "depth": 1}

# if we don't have asked explicitly for other sorting, we'll want
# it by position in parent
if 'sort_on' not in query:
query['sort_on'] = 'getObjPositionInParent'
if "sort_on" not in query:
query["sort_on"] = "getObjPositionInParent"

# Provide batching hints to the catalog
if batch:
query['b_start'] = b_start
query['b_size'] = b_size + orphan
query["b_start"] = b_start
query["b_size"] = b_size + orphan

catalog = getToolByName(self.context, 'portal_catalog')
catalog = getToolByName(self.context, "portal_catalog")
results = catalog(query)
return IContentListing(results)

0 comments on commit 992ef38

Please sign in to comment.