Skip to content

Commit

Permalink
Merge branch 'master' of git://github.com/nursix/eden
Browse files Browse the repository at this point in the history
  • Loading branch information
flavour committed Jul 12, 2019
2 parents 4f4acbd + 0b287f2 commit 96ab4c5
Show file tree
Hide file tree
Showing 122 changed files with 5,360 additions and 5,567 deletions.
2 changes: 0 additions & 2 deletions modules/plugins/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-

# @status: fixed for Py3

import os
import sys

Expand Down
2 changes: 0 additions & 2 deletions modules/s3/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
@status: fixed for Py3
"""
# Import all names from the S3 modules that shall be accessible
# under the s3base namespace:
Expand Down
2 changes: 0 additions & 2 deletions modules/s3/codecs/card.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
@status: fixed for Py3
"""

__all__ = ("S3PDFCard",
Expand Down
2 changes: 0 additions & 2 deletions modules/s3/codecs/pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
@status: fixed for Py3
"""

__all__ = ("S3RL_PDF",)
Expand Down
2 changes: 0 additions & 2 deletions modules/s3/codecs/shp.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
@status: fixed for Py3
"""

__all__ = ("S3SHP",)
Expand Down
2 changes: 0 additions & 2 deletions modules/s3/codecs/svg.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
@status: fixed for Py3
"""

__all__ = ("S3SVG",)
Expand Down
2 changes: 0 additions & 2 deletions modules/s3/codecs/xls.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
@status: fixed for Py3
"""

__all__ = ("S3XLS",
Expand Down
2 changes: 0 additions & 2 deletions modules/s3/s3aaa.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
@status: fixed for Py3
"""

__all__ = ("AuthS3",
Expand Down
2 changes: 0 additions & 2 deletions modules/s3/s3anonymize.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
@status: fixed for Py3
"""

import json
Expand Down
2 changes: 0 additions & 2 deletions modules/s3/s3codec.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
@status: fixed for Py3
"""

__all__ = ("S3Codec",)
Expand Down
2 changes: 0 additions & 2 deletions modules/s3/s3crud.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
@status: fixed for Py3
"""

__all__ = ("S3CRUD",)
Expand Down
1 change: 0 additions & 1 deletion modules/s3/s3dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
OTHER DEALINGS IN THE SOFTWARE.
@status: experimental, work in progress
@status: fixed for Py3
"""

__all__ = ("S3Dashboard",
Expand Down
2 changes: 0 additions & 2 deletions modules/s3/s3data.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
@group Data Views: S3DataTable,
S3DataList
@status: fixed for Py3
"""

import re
Expand Down
2 changes: 0 additions & 2 deletions modules/s3/s3datetime.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
@status: fixed for Py3
"""

__all__ = ("ISOFORMAT",
Expand Down
2 changes: 0 additions & 2 deletions modules/s3/s3delete.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
@status: fixed for Py3
"""

import json
Expand Down
2 changes: 0 additions & 2 deletions modules/s3/s3error.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
@status: fixed for Py3
"""

# =============================================================================
Expand Down
2 changes: 0 additions & 2 deletions modules/s3/s3export.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
@status: fixed for Py3
"""

__all__ = ("S3Exporter",)
Expand Down
2 changes: 0 additions & 2 deletions modules/s3/s3fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
@status: fixed for Py3
"""

import datetime
Expand Down
2 changes: 0 additions & 2 deletions modules/s3/s3filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
@status: fixed for Py3
"""

__all__ = ("S3FilterWidget",
Expand Down
2 changes: 0 additions & 2 deletions modules/s3/s3forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
@status: fixed for Py3
"""

__all__ = ("S3SQLCustomForm",
Expand Down
2 changes: 0 additions & 2 deletions modules/s3/s3grouped.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
@status: fixed for Py3
"""

__all__ = ("S3GroupedItemsReport",
Expand Down
2 changes: 0 additions & 2 deletions modules/s3/s3hierarchy.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
@status: fixed for Py3
"""

__all__ = ("S3Hierarchy", "S3HierarchyCRUD")
Expand Down
2 changes: 0 additions & 2 deletions modules/s3/s3import.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
@status: fixed for Py3
"""

# @todo: remove all interactive error reporting out of the _private methods,
Expand Down
2 changes: 0 additions & 2 deletions modules/s3/s3merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
@status: fixed for Py3
"""

from gluon import current, IS_NOT_IN_DB, \
Expand Down
6 changes: 3 additions & 3 deletions modules/s3/s3mobile.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@
OTHER DEALINGS IN THE SOFTWARE.

@todo: integrate S3XForms API

@status: fixed for Py3
"""

__all__ = ("S3MobileFormList",
Expand Down Expand Up @@ -224,6 +222,8 @@ class S3MobileSchema(object):
"boolean",
"reference",
"upload",
"list:string",
"list:integer",
)

# -------------------------------------------------------------------------
Expand Down Expand Up @@ -514,7 +514,7 @@ def get_options(field, lookup=None):
# for proper authorization, customise_* and filtering
return None

elif fieldtype in ("string", "integer"):
elif fieldtype in ("string", "integer", "list:string", "list:integer"):

# Check for IS_IN_SET, and extract the options
if isinstance(requires, IS_IN_SET):
Expand Down
54 changes: 41 additions & 13 deletions modules/s3/s3model.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

@status: fixed for Py3
"""

__all__ = ("S3Model",
Expand Down Expand Up @@ -1963,7 +1961,9 @@ def _generic_field(tablename, row):
fieldname = row.name
fieldtype = row.field_type

if row.require_unique:
multiple = fieldtype[:5] == "list:"

if row.require_unique and not multiple:
from .s3validators import IS_NOT_ONE_OF
requires = IS_NOT_ONE_OF(current.db, "%s.%s" % (tablename,
fieldname,
Expand Down Expand Up @@ -2017,6 +2017,7 @@ def _options_field(tablename, row):

from .s3utils import s3_str

multiple = fieldtype[:5] == "list:"
sort = False
zero = ""

Expand Down Expand Up @@ -2047,29 +2048,56 @@ def _options_field(tablename, row):

# Apply default value (if it is a valid option)
default = row.default_value
if default and s3_str(default) in (s3_str(k) for k in options_dict):
# No zero-option if we have a default value and
# the field must not be empty:
zero = None if row.require_not_empty else ""
else:
default = None
if default is not None:
if multiple:
if default and default[0] == "[":
# Attempt to JSON-parse the default value
import json
from .s3validators import JSONERRORS
try:
default = json.loads(default)
except JSONERRORS:
pass
if not isinstance(default, list):
default = [default]
zero = None
elif s3_str(default) in (s3_str(k) for k in options_dict):
# No zero-option if we have a default value and
# the field must not be empty:
zero = None if row.require_not_empty else ""
else:
default = None

# Widget?
#widget = settings.get("widget")
#if widget == "radio":
widget = settings.get("widget")
len_options = len(options)
if len_options < 4:
widget = lambda field, value: SQLFORM.widgets.radio.widget(field, value, cols=len_options)
if multiple:
if widget and widget == "groupedopts" or \
not widget and len_options < 8:
from .s3widgets import S3GroupedOptionsWidget
widget = S3GroupedOptionsWidget(cols=4)
else:
from .s3widgets import S3MultiSelectWidget
widget = S3MultiSelectWidget()
elif widget and widget == "radio" or \
not widget and len_options < 4:
widget = lambda field, value: \
SQLFORM.widgets.radio.widget(field,
value,
cols = len_options,
)
else:
widget = None

from .s3fields import S3Represent
field = Field(fieldname, fieldtype,
default = default,
represent = S3Represent(options = options_dict,
multiple = multiple,
translate = translate,
),
requires = IS_IN_SET(options,
multiple = multiple,
sort = sort,
zero = zero,
),
Expand Down
2 changes: 0 additions & 2 deletions modules/s3/s3msg.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

@status: fixed for Py3
"""

__all__ = ("S3Msg",
Expand Down
2 changes: 0 additions & 2 deletions modules/s3/s3navigation.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@
- add site-map generator and renderer (easy)
- rewrite action buttons/links as S3NavigationItems
- ...and any todo's in the code

@status: fixed for Py3
"""

__all__ = ("S3NavigationItem",
Expand Down
2 changes: 0 additions & 2 deletions modules/s3/s3notify.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

@status: fixed for Py3
"""

import datetime
Expand Down
2 changes: 0 additions & 2 deletions modules/s3/s3organizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

@status: fixed for Py3
"""

__all__ = ("S3Organizer",
Expand Down
2 changes: 0 additions & 2 deletions modules/s3/s3parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

@status: fixed for Py3
"""

__all__ = ("S3Parsing",)
Expand Down
2 changes: 0 additions & 2 deletions modules/s3/s3pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

@status: fixed for Py3 (just syntax, functionality broken as for Py2)
"""

__all__ = ("S3PDF",)
Expand Down
2 changes: 0 additions & 2 deletions modules/s3/s3profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

@status: fixed for Py3
"""

from gluon import current, redirect
Expand Down
Loading

0 comments on commit 96ab4c5

Please sign in to comment.