Skip to content

Commit

Permalink
Merge 28e1fe7 into 5607a95
Browse files Browse the repository at this point in the history
  • Loading branch information
hvelarde committed May 22, 2018
2 parents 5607a95 + 28e1fe7 commit 18168f2
Show file tree
Hide file tree
Showing 22 changed files with 232 additions and 202 deletions.
33 changes: 19 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,32 @@
language: python
python: 2.7
sudo: false
cache:
directories:
- eggs
env:
- PLONE_VERSION=4.2
- PLONE_VERSION=4.3 QA=true
- PLONE_VERSION=5.0
- PLONE_VERSION=4.3
- PLONE_VERSION=5.1
matrix:
include:
- python: 2.6
env: PLONE_VERSION=4.1
fast_finish: true
before_install:
# FIXME: I have no idea how and why six==1.11.0 is being installed
- pip uninstall -y six
install:
- sed -ie "s#travis-4.x.cfg#travis-$PLONE_VERSION.x.cfg#" travis.cfg
- mkdir -p buildout-cache/downloads
- easy_install -U setuptools
- python bootstrap.py -c travis.cfg
- bin/buildout -c travis.cfg annotate
- bin/buildout -c travis.cfg -N -q
- sed -ie "s#test-4.3#test-$PLONE_VERSION#" buildout.cfg
- python bootstrap.py
- bin/buildout -c travis.cfg annotate
- bin/buildout -c travis.cfg
before_script:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
script:
- test $QA && bin/code-analysis || true
- bin/test
after_success: test $QA && bin/coverage.sh && pip install -q coveralls && coveralls || true
- bin/code-analysis
- bin/test
after_success:
- bin/createcoverage --output-dir=htmlcov -t "--layer=!Robot"
- pip install coveralls
- coveralls
notifications:
irc: irc.freenode.org#plone-testing
7 changes: 5 additions & 2 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ Changelog
3.7 (unreleased)
----------------

- Drop support for Python 2.6 and Plone 4.1.
[hvelarde]

- Updated i18n support, adding i18n sentences for workflow strings, synced
the pot files and updated the po files.
[macagua]
Expand Down Expand Up @@ -63,13 +66,13 @@ Changelog
- Check if toPloneboardTime gets a callable and call it to get a Datetime
[jensens]

- Fixed visual issue with HTML lists when WISIWYG editor is enabled
- Fixed visual issue with HTML lists when WISIWYG editor is enabled
[keul]

- Call unmarkCreationFlag method after comment creation, to remove creation flag
[cekk]

- Fixed attachment translations
- Fixed attachment translations
[cekk]

- Fixed bug: moderation_form fail to render when using VirtualHostMonster
Expand Down
2 changes: 0 additions & 2 deletions base.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,6 @@ eggs = ${instance:eggs}
#packages = ./

[versions]
# use latest version of setuptools
setuptools =

[tools]
recipe=zc.recipe.egg
Expand Down
120 changes: 80 additions & 40 deletions bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@

from optparse import OptionParser

tmpeggs = tempfile.mkdtemp()
__version__ = '2015-07-01'
# See zc.buildout's changelog if this version is up to date.

tmpeggs = tempfile.mkdtemp(prefix='bootstrap-')

usage = '''\
[DESIRED PYTHON FOR BUILDOUT] bootstrap.py [options]
Expand All @@ -35,13 +38,14 @@
Simply run this script in a directory containing a buildout.cfg, using the
Python that you want bin/buildout to use.
Note that by using --find-links to point to local resources, you can keep
Note that by using --find-links to point to local resources, you can keep
this script from going over the network.
'''

parser = OptionParser(usage=usage)
parser.add_option("-v", "--version", help="use a specific zc.buildout version")

parser.add_option("--version",
action="store_true", default=False,
help=("Return bootstrap.py version."))
parser.add_option("-t", "--accept-buildout-test-releases",
dest='accept_buildout_test_releases',
action="store_true", default=False,
Expand All @@ -56,46 +60,81 @@
"file to be used."))
parser.add_option("-f", "--find-links",
help=("Specify a URL to search for buildout releases"))

parser.add_option("--allow-site-packages",
action="store_true", default=False,
help=("Let bootstrap.py use existing site packages"))
parser.add_option("--buildout-version",
help="Use a specific zc.buildout version")
parser.add_option("--setuptools-version",
help="Use a specific setuptools version")
parser.add_option("--setuptools-to-dir",
help=("Allow for re-use of existing directory of "
"setuptools versions"))

options, args = parser.parse_args()
if options.version:
print("bootstrap.py version %s" % __version__)
sys.exit(0)


######################################################################
# load/install setuptools

to_reload = False
try:
import pkg_resources
import setuptools
from urllib.request import urlopen
except ImportError:
ez = {}

try:
from urllib.request import urlopen
except ImportError:
from urllib2 import urlopen

# XXX use a more permanent ez_setup.py URL when available.
exec(urlopen('https://bootstrap.pypa.io/ez_setup.py'
).read(), ez)
setup_args = dict(to_dir=tmpeggs, download_delay=0)
ez['use_setuptools'](**setup_args)

if to_reload:
reload(pkg_resources)
import pkg_resources
# This does not (always?) update the default working set. We will
# do it.
for path in sys.path:
if path not in pkg_resources.working_set.entries:
pkg_resources.working_set.add_entry(path)
from urllib2 import urlopen

ez = {}
if os.path.exists('ez_setup.py'):
exec(open('ez_setup.py').read(), ez)
else:
exec(urlopen('https://bootstrap.pypa.io/ez_setup.py').read(), ez)

if not options.allow_site_packages:
# ez_setup imports site, which adds site packages
# this will remove them from the path to ensure that incompatible versions
# of setuptools are not in the path
import site
# inside a virtualenv, there is no 'getsitepackages'.
# We can't remove these reliably
if hasattr(site, 'getsitepackages'):
for sitepackage_path in site.getsitepackages():
# Strip all site-packages directories from sys.path that
# are not sys.prefix; this is because on Windows
# sys.prefix is a site-package directory.
if sitepackage_path != sys.prefix:
sys.path[:] = [x for x in sys.path
if sitepackage_path not in x]

setup_args = dict(to_dir=tmpeggs, download_delay=0)

if options.setuptools_version is not None:
setup_args['version'] = options.setuptools_version
if options.setuptools_to_dir is not None:
setup_args['to_dir'] = options.setuptools_to_dir

ez['use_setuptools'](**setup_args)
import setuptools
import pkg_resources

# This does not (always?) update the default working set. We will
# do it.
for path in sys.path:
if path not in pkg_resources.working_set.entries:
pkg_resources.working_set.add_entry(path)

######################################################################
# Install buildout

ws = pkg_resources.working_set

setuptools_path = ws.find(
pkg_resources.Requirement.parse('setuptools')).location

# Fix sys.path here as easy_install.pth added before PYTHONPATH
cmd = [sys.executable, '-c',
'import sys; sys.path[0:0] = [%r]; ' % setuptools_path +
'from setuptools.command.easy_install import main; main()',
'-mZqNxd', tmpeggs]

Expand All @@ -108,21 +147,23 @@
if find_links:
cmd.extend(['-f', find_links])

setuptools_path = ws.find(
pkg_resources.Requirement.parse('setuptools')).location

requirement = 'zc.buildout'
version = options.version
version = options.buildout_version
if version is None and not options.accept_buildout_test_releases:
# Figure out the most recent final version of zc.buildout.
import setuptools.package_index
_final_parts = '*final-', '*final'

def _final_version(parsed_version):
for part in parsed_version:
if (part[:1] == '*') and (part not in _final_parts):
return False
return True
try:
return not parsed_version.is_prerelease
except AttributeError:
# Older setuptools
for part in parsed_version:
if (part[:1] == '*') and (part not in _final_parts):
return False
return True

index = setuptools.package_index.PackageIndex(
search_path=[setuptools_path])
if find_links:
Expand All @@ -147,10 +188,9 @@ def _final_version(parsed_version):
cmd.append(requirement)

import subprocess
if subprocess.call(cmd, env=dict(os.environ, PYTHONPATH=setuptools_path)) != 0:
if subprocess.call(cmd) != 0:
raise Exception(
"Failed to execute command:\n%s",
repr(cmd)[1:-1])
"Failed to execute command:\n%s" % repr(cmd)[1:-1])

######################################################################
# Import and run buildout
Expand Down
15 changes: 9 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
open("CHANGES.rst").read(),
classifiers=[
"Framework :: Plone",
"Framework :: Plone :: 4.1",
"Framework :: Plone :: 4.2",
"Framework :: Plone :: 4.3",
"Framework :: Zope2",
"Programming Language :: Python",
'Programming Language :: Python :: 2 :: Only',
'Programming Language :: Python :: 2.7',
],
keywords='Zope CMF Plone board forum',
author='Jarn, Wichert Akkerman, Martin Aspeli',
Expand All @@ -29,7 +29,7 @@
zip_safe=False,
install_requires=[
'setuptools',
'Products.CMFPlone >= 4.1',
'Products.CMFPlone >= 4.2',
'Products.SimpleAttachment',
'plone.api',
'plone.app.controlpanel',
Expand All @@ -42,9 +42,12 @@
'AccessControl>=3.0',
],
extras_require=dict(
test=['plone.app.testing',
'lxml',
'Products.PloneTestCase', ],
test=[
'cssselect',
'lxml',
'plone.app.testing',
'Products.PloneTestCase',
],
),
entry_points="""
[z3c.autoinclude.plugin]
Expand Down
5 changes: 3 additions & 2 deletions src/Products/Ploneboard/Extensions/Install.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@

def install(self, reinstall=False):
tool = getToolByName(self, "portal_setup")
tool.runAllImportStepsFromProfile("profile-Products.Ploneboard:default",
purge_old=False)
tool.runAllImportStepsFromProfile(
"profile-Products.Ploneboard:default",
purge_old=False)


def uninstall(self):
Expand Down
11 changes: 6 additions & 5 deletions src/Products/Ploneboard/Extensions/WorkflowScripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def autopublish_script(self, sci):
parent = aq_parent(aq_inner(object))
if IConversation.providedBy(parent):
try:
if wftool.getInfoFor(parent, 'review_state', None) in (sci.old_state.getId(), 'pending'):
if wftool.getInfoFor(parent,'review_state', None) in (sci.old_state.getId(), 'pending'):
wftool.doActionFor(parent, 'publish')
except ConflictError:
raise
Expand All @@ -32,13 +32,13 @@ def publish_script(self, sci):
parent = aq_parent(aq_inner(object))
if IConversation.providedBy(parent):
try:
if wftool.getInfoFor(parent, 'review_state', None) in (sci.old_state.getId(), 'pending'):
if wftool.getInfoFor(parent,'review_state', None) in (sci.old_state.getId(), 'pending'):
wftool.doActionFor(parent, 'publish')
except ConflictError:
raise
except Exception:
pass
# Reindex conversation to update num_comments index
#Reindex conversation to update num_comments index
parent.reindexObject(idxs=('num_comments',))


Expand All @@ -47,7 +47,7 @@ def reject_script(self, sci):
# Dispatch to more easily customizable methods
object = sci.object
# We don't have notifyPublished method anymore
# object.notifyRetracted()
#object.notifyRetracted()

wftool = sci.getPortal().portal_workflow

Expand All @@ -56,7 +56,7 @@ def reject_script(self, sci):
parent = aq_parent(aq_inner(object))
if IConversation.providedBy(parent):
try:
if wftool.getInfoFor(parent, 'review_state', None) in (sci.old_state.getId(), 'pending'):
if wftool.getInfoFor(parent,'review_state', None) in (sci.old_state.getId(), 'pending'):
wftool.doActionFor(parent, 'reject')
except ConflictError:
raise
Expand All @@ -71,3 +71,4 @@ def lock_or_unlock(self, sci):
obj.unlock_board()
elif sci.new_state.id == 'locked':
obj.lock_board()

Loading

0 comments on commit 18168f2

Please sign in to comment.