Skip to content

Commit

Permalink
Cleaning up contrib process.
Browse files Browse the repository at this point in the history
  • Loading branch information
miohtama committed Jun 5, 2016
1 parent b70017e commit 08a7d5c
Show file tree
Hide file tree
Showing 20 changed files with 307 additions and 192 deletions.
7 changes: 7 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ matrix:
install:
- travis_retry pip install tox

# For Selenium
# https://docs.travis-ci.com/user/gui-and-headless-browsers/
before_script:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
- sleep 3 # give xvfb some time to start

script:
- travis_retry tox

Expand Down
63 changes: 63 additions & 0 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
============
Contributing
============

.. contents:: :local:

Discuss first
-------------

For changes open an issue p on Github for discussion preferably before starting any coding. Ask the authors opinion how the issue should be approached as this will make it easier to merge the pull request later.

Unit tests
----------

All features must be covered by unit tests, so that test coverage stays in 100%.

To run tests::

pip install tox # System wide installation
tox

This will run tests for Python 2.x, Python 3.x, PyPy, functional, coverage, documentation.

Functional tests
----------------

All features must be covered by functional tests and have example use. To run functional tests only::

tox -e functional

.. to edit functional tests::
source .tox/functional/bin/activate
cd deformdefom # Checked out by tox functional
pserve demo.ini # Start web server
# Run functional test suite using Chrome
WEBDRIVER="chrome" nosetests -x
# Run functional test suite using Chrome, stop on pdb on exception
WEBDRIVER="chrome" nosetests -x --pdb
# Run one functional test case using Chrome
WEBDRIVER="chrome" nosetests -x deformdemo.test:SequenceOfDateInputs
Documentation
-------------

All features must be documented with code samples in narrative documentation, API documentation or deformdeom.

Changelog
---------

Update ``CHANGES.txt``.

Update ``CONTRIBUTORS.rst``.

Pull requests
-------------

Make pull request on github for deform, deformdemo.


2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Deform

Deform is a Python HTML form library. You can easily create forms for your application. Deform can do complex forms with JavaScript integration, like nested forms where you need add and remove subform items. Date and time picking widgets and other rich widgets are supported out of the box.

Deform comes with default `Chameleon templates <https://chameleon.readthedocs.io/en/latest/>`_ for `Bootstrap <http://getbootstrap.com>`_ based widgets. It uses `Colander <https://github.com/Pylons/colander>`_ as for form schema and validation definitions. Deform integrates well with `Pyramid web framework <https://trypyramid.com/>`_ and several other web frameworks.
Deform comes with default `Chameleon templates <https://chameleon.readthedocs.io/en/latest/>`_ for `Bootstrap <http://getbootstrap.com>`_ based widgets. It uses `Colander <https://github.com/Pylons/colander>`_ as for form schema and validation definitions. Deform integrates well with `Pyramid web framework <https://trypyramid.com/>`_ and several other web frameworks. Peppercorn library is used to convert flat HTML name value mapping form submissions to stream of name value mappings submissions, allowing building complex and nested form structure.

Please see http://docs.pylonsproject.org/projects/deform/en/latest/ for the
documentation.
Expand Down
3 changes: 0 additions & 3 deletions contributing.md

This file was deleted.

121 changes: 0 additions & 121 deletions deform/locale/deform.pot
Original file line number Diff line number Diff line change
@@ -1,121 +0,0 @@
# Translations template for deform.
# Copyright (C) 2013 ORGANIZATION
# This file is distributed under the same license as the deform project.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2013.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: deform 2.0a2\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2013-11-16 15:42+0900\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 1.3\n"

#: deform/schema.py:103
msgid "${value} is not a dictionary"
msgstr ""

#: deform/schema.py:110
msgid "${value} has no ${key} key"
msgstr ""

#: deform/widget.py:656 deform/widget.py:1662
msgid "Incomplete date"
msgstr ""

#: deform/widget.py:659
msgid "Incomplete time"
msgstr ""

#: deform/widget.py:1157
msgid "Fields did not match"
msgstr ""

#: deform/widget.py:1158
msgid "Value"
msgstr ""

#: deform/widget.py:1159
msgid "Confirm Value"
msgstr ""

#: deform/widget.py:1216
msgid "Password did not match confirm"
msgstr ""

#: deform/widget.py:1373
msgid "Add ${subitem_title}"
msgstr ""

#: deform/templates/checked_password.pt:8
msgid "Password"
msgstr ""

#: deform/templates/checked_password.pt:18
msgid "Confirm Password"
msgstr ""

#: deform/templates/dateparts.pt:10
msgid "Year"
msgstr ""

#: deform/templates/dateparts.pt:18
msgid "Month"
msgstr ""

#: deform/templates/dateparts.pt:26
msgid "Day"
msgstr ""

#: deform/templates/datetimeinput.pt:10
msgid "Date"
msgstr ""

#: deform/templates/datetimeinput.pt:17
msgid "Time"
msgstr ""

#: deform/templates/form.pt:34
msgid "There was a problem with your submission"
msgstr ""

#: deform/templates/mapping.pt:13
msgid "There was a problem with this section"
msgstr ""

#. Default: en
#: deform/templates/richtext.pt:30
msgid "language-code"
msgstr ""

#: deform/templates/sequence_item.pt:23
msgid "Reorder (via drag and drop)"
msgstr ""

#: deform/templates/sequence_item.pt:28
msgid "Remove"
msgstr ""

#: deform/templates/readonly/checkbox.pt:5
msgid "True"
msgstr ""

#: deform/templates/readonly/checkbox.pt:9
msgid "False"
msgstr ""

#: deform/templates/readonly/checked_password.pt:2
#: deform/templates/readonly/password.pt:2
msgid "Password not displayed."
msgstr ""

#: deform/tests/test_widget.py:1550
msgid "Yo ${subitem_title}"
msgstr ""

9 changes: 4 additions & 5 deletions deform/templates/dateinput.pt
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,16 @@
<input type="${type_name}"
name="date"
value="${cstruct}"

tal:attributes="class string: ${css_class or ''} form-control hasDatepicker;
style style"
id="${oid}"/>
${field.end_mapping()}
<script type="text/javascript">
deform.addCallback(
'${oid}',
function(oid) {
if (!Modernizr.inputtypes['date'] ||
"${type_name}" != "date"){
'${oid}',
function deform_cb(oid) {
if (!Modernizr.inputtypes['date'] ||"${type_name}" != "date" || window.forceDateTimePolyfill){
$('#' + oid).pickadate(${options_json});
}
}
Expand Down
4 changes: 2 additions & 2 deletions deform/templates/select.pt
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@
tal:attributes="label item.label">
<option tal:repeat="(value, description) item.options"
tal:attributes="
selected (multiple and value in list(map(str, cstruct)) or value == list(map(str, cstruct))) and 'selected';
selected (multiple and value in list(map(unicode, cstruct)) or value == list(map(unicode, cstruct))) and 'selected';
class css_class;
label field.widget.long_label_generator and description;
value value"
tal:content="field.widget.long_label_generator and field.widget.long_label_generator(item.label, description) or description"/>
</optgroup>
<option tal:condition="not isinstance(item, optgroup_class)"
tal:attributes="
selected (multiple and item[0] in list(map(str, cstruct)) or item[0] == list(map(str, cstruct))) and 'selected';
selected (multiple and item[0] in list(map(unicode, cstruct)) or item[0] == list(map(unicode, cstruct))) and 'selected';
class css_class;
value item[0]">${item[1]}</option>
</tal:loop>
Expand Down
6 changes: 3 additions & 3 deletions deform/templates/select2.pt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
}

.form-control .select2-choice .select2-arrow {
border-radius: 0 2px 2px 0;
border-radius: 0 2px 2px 0;
}

.form-control.select2-container {
Expand Down Expand Up @@ -51,15 +51,15 @@
tal:attributes="label item.label">
<option tal:repeat="(value, description) item.options"
tal:attributes="
selected (multiple and value in list(map(str, cstruct)) or value == list(map(str, cstruct))) and 'selected';
selected (multiple and value in list(map(unicode, cstruct)) or value == list(map(unicode, cstruct))) and 'selected';
class css_class;
label field.widget.long_label_generator and description;
value value"
tal:content="field.widget.long_label_generator and field.widget.long_label_generator(item.label, description) or description"/>
</optgroup>
<option tal:condition="not isinstance(item, optgroup_class)"
tal:attributes="
selected (multiple and item[0] in list(map(str, cstruct)) or item[0] == list(map(str, cstruct))) and 'selected';
selected (multiple and item[0] in list(map(unicode, cstruct)) or item[0] == list(map(unicode, cstruct))) and 'selected';
class css_class;
value item[0]">${item[1]}</option>
</tal:loop>
Expand Down
2 changes: 1 addition & 1 deletion deform/templates/timeinput.pt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
'${oid}',
function(oid) {
if (!Modernizr.inputtypes['time'] ||
"${type_name}" != "time"){
"${type_name}" != "time" || window.forceDateTimePolyfill){
$('#' + oid).pickatime(${options_json});
}
}
Expand Down
Empty file added deform/utils.py
Empty file.
1 change: 1 addition & 0 deletions deformdemo
Submodule deformdemo added at d4e91b
16 changes: 16 additions & 0 deletions docs/community.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Support and Development
=======================

To report bugs, use the `bug tracker <https://github.com/Pylons/deform/issues>`_.

To submit patches see :ref:`contributing`.

If you've got questions that aren't answered by this documentation, contact the `Pylons-discuss mailing list <http://groups.google.com/group/pylons-discuss>`_ or join the

.. only:: not latex

`#pyramid IRC channel <irc://irc.freenode.net/#pylons>`_.

.. only:: latex

#pyramid IRC channel ``irc://irc.freenode.net/#pylons``.
3 changes: 3 additions & 0 deletions docs/contributing.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.. _contributing:

.. include:: ../CONTRIBUTING.rst
39 changes: 6 additions & 33 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ system of choice and a suitable :term:`renderer` is supplied to

.. warning::

Despite the version number at the top, this documentation has not been
updated for the 2.X release line of Deform. Most of the documentation
will still apply, but where it does not, see the :ref:`changelog` for
an overview of changes between 0.9.9 and this release.
Despite the version number at the top, this documentation has not been
updated for the 2.X release line of Deform. Most of the documentation
will still apply, but where it does not, see the :ref:`changelog` for
an overview of changes between 0.9.9 and this release.
Also, please see http://deform2demo.repoze.org .

Topics
Expand All @@ -49,6 +49,8 @@ Topics
app.rst
ajax.rst
i18n.rst
contributing.rst
community.rst
api.rst
interfaces.rst
glossary.rst
Expand All @@ -62,35 +64,6 @@ application which demonstrates most of Deform's features. The source code
for this application is also available in the `deform package on GitHub
<https://github.com/Pylons/deform>`_.

Support and Development
=======================

To report bugs, use the `bug tracker
<https://github.com/Pylons/deform/issues>`_.

If you've got questions that aren't answered by this documentation, contact
the `Pylons-discuss mailing list
<http://groups.google.com/group/pylons-discuss>`_ or join the

.. only:: not latex

`#pylons IRC channel <irc://irc.freenode.net/#pylons>`_.

.. only:: latex

#pylons IRC channel ``irc://irc.freenode.net/#pylons``.


Browse and check out tagged and trunk versions of :mod:`deform` via the
`deform package on GitHub <https://github.com/Pylons/deform>`_. To check out
the trunk, use this command::

git clone git://github.com/Pylons/deform.git

To find out how to become a contributor to :mod:`deform`, please see the
`Pylons Project contributor documentation
<http://docs.pylonsproject.org/#contributing/>`_.

Index and Glossary
==================

Expand Down
15 changes: 11 additions & 4 deletions i18n.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
#!/usr/bin/env bash
#

# Say no to errors
set -e

domain="deform"
py=python
if [[ -f $INS/bin/pyramidpy ]];then
py="$INS/bin/pyramidpy"
fi
$py setup.py extract_messages
$py setup.py update_catalog -D $domain
$py setup.py compile_catalog -D $domain
# vim:set et sts=4 ts=4 tw=80:

# $py setup.py extract_messages
# $py setup.py update_catalog -D $domain
# $py setup.py compile_catalog -D $domain
pot-create -c lingua.ini deform


Loading

0 comments on commit 08a7d5c

Please sign in to comment.