Commit 216b7026 authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Apply 2to3 converter to remaining modules.

parent 615dcd15
# -*- coding: utf-8 -*-
""" auth
* Customise the authentication
......
# -*- coding: utf-8 -*-
"""a collections of functions to be used in _before_delete, before_insert
and _before_update callbacks.
"""
from check_tools import (duplicate_article,
from .check_tools import (duplicate_article,
duplicate_conference,
duplicate_report)
from gluon import current
......@@ -26,14 +25,16 @@ def INHIBIT_CASCADE_DELETE(set_records):
bool: ``True`` when the delete is inhibited
"""
db, T = current.db, current.T
field = set_records.query.first
setquery = set_records.query
# protection
# the query of the set should be "table.id == 45"
if field._db._adapter.EQ != set_records.query.op:
if setquery.op.__name__ != "eq":
return False
db = current.db
field = setquery.first
# protection
# check that the table is ones of the publication reference tables
tables = (db.authors_roles,
......@@ -51,10 +52,10 @@ def INHIBIT_CASCADE_DELETE(set_records):
# inhibit the delete if publications use the reference field
query = get_where_query(db.publications)
query = (query) & (set_records.query)
query = (query) & (setquery)
if db(query).count():
field._table[CALLBACK_ERRORS] = T(MSG_DUPLICATE)
field._table[CALLBACK_ERRORS] = current.T(MSG_DUPLICATE)
return True
return False
......
# -*- coding: utf-8 -*-
"""a collection of tools to check rows.
"""
import re
import regex
from . import regex
from gluon import current
from plugin_dbui import (UNDEF,
UNDEF_ID,
......
# -*- coding: utf-8 -*-
""" countries
List of countries extract from the geographical database www.geonames.org:
......
# -*- coding: utf-8 -*-
"""a collections of functions to correct entries in the database.
"""
......
# -*- coding: utf-8 -*-
"""A collection of tools to build graphs in controllers.
"""
......@@ -7,9 +6,9 @@ import pandas as pd
from gluon import current
from model_selector import MONTH_SUBMIT, YEAR_PUBLISH
from io import StringIO
from .model_selector import MONTH_SUBMIT, YEAR_PUBLISH
from pandas import DataFrame, DatetimeIndex, to_datetime
from StringIO import StringIO
DATE_PUB = "Publication date"
......@@ -345,7 +344,7 @@ def query_publications(db, is_publish, **kwargs):
elif year_end and not year_start:
query = publications.submitted[0:4] <= year_end
for k, v in di.iteritems():
for k, v in di.items():
if k in ("Graph_selectorYear_start", "Graph_selectorYear_end"):
continue
......
# -*- coding: utf-8 -*-
"""A collection of functions to polish the representation of a
publication in a list.
......
# -*- coding: utf-8 -*-
"""Definitions of the App tables
"""
from callbacks import INHIBIT_CASCADE_DELETE
from .callbacks import INHIBIT_CASCADE_DELETE
from gluon import current
from gluon.storage import Storage
......
# -*- coding: utf-8 -*-
"""Definitions of the core tables
"""
from callbacks import (INHIBIT_CASCADE_DELETE,
from .callbacks import (INHIBIT_CASCADE_DELETE,
INHIBIT_DUPLICATE_PUBLICATION,
INHIBIT_PUBLICATION_DELETE_ON_OK,
INHIBIT_PUBLICATION_UPDATE_ON_OK)
from filters import (CLEAN_COLLABORATION,
from .filters import (CLEAN_COLLABORATION,
CLEAN_COLLABORATION_SYNONYM,
CLEAN_THESIS_DEFENSE)
......@@ -28,7 +27,7 @@ from plugin_dbui import (CLEAN_COMMA,
UNDEF_ID)
from pydal import Field
from regex import (REG_COLLABORATION,
from .regex import (REG_COLLABORATION,
REG_CONF_DATES,
REG_DEFENSE,
REG_SUBMITTED,
......
# -*- coding: utf-8 -*-
"""Definitions of the harveser's tables
"""
from callbacks import (INHIBIT_CASCADE_DELETE,
from .callbacks import (INHIBIT_CASCADE_DELETE,
INHIBIT_CONTROLLER_INSERT,
INHIBIT_CONTROLLER_UPDATE,
INHIBIT_HARVESTER)
......
# -*- coding: utf-8 -*-
"""Definitions of the report's tables
"""
from callbacks import INHIBIT_CASCADE_DELETE
from .callbacks import INHIBIT_CASCADE_DELETE
from gluon.validators import IS_IN_DB, IS_IN_SET
from plugin_dbui import (CLEAN_SPACES,
......
# -*- coding: utf-8 -*-
"""Definitions of the selector(s)
"""
......@@ -10,8 +9,8 @@ from gluon.validators import (IS_IN_DB,
IS_IN_SET,
IS_MATCH)
from harvest_tools import DRY_RUN
from model_harvester import CONTROLLERS, STORES
from .harvest_tools import DRY_RUN
from .model_harvester import CONTROLLERS, STORES
from pydal import Field
......
# *-* coding: utf-8 *-*
""" A collections of regular expression defining rules validating
fields content.
......
# -*- coding: utf-8 -*-
"""A collection of tools to build reports in controllers.
"""
import re
from list_postprocessing import (clean,
from .list_postprocessing import (clean,
highlight_my_authors,
highlight_my_speaker,
remove_undef)
......@@ -178,7 +177,7 @@ def ref_url(name="List"):
"""
li = []
for (k, v) in request.vars.iteritems():
for k, v in request.vars.items():
if k.startswith(name) and len(v):
li.append("%s=%s" % (k, v))
pass
......
# -*- coding: utf-8 -*-
"""User Interface for the App tables
"""
......
# -*- coding: utf-8 -*-
"""User Interface for the authentication tables
"""
......
# -*- coding: utf-8 -*-
"""User Interface for the core tables
"""
from auth import USER
from .auth import USER
from gluon import current
from plugin_dbui import (FieldsModifier,
FormModifier,
......
# -*- coding: utf-8 -*-
"""User Interface for the harvester tables
"""
......
# -*- coding: utf-8 -*-
"""User Interface for the report tables
"""
......
# -*- coding: utf-8 -*-
"""User Interface for the selector tables
"""
from auth import ADMIN
from .auth import ADMIN
from gluon import current
from harvest_tools import DRY_RUN
from .harvest_tools import DRY_RUN
from plugin_dbui import (FieldsModifier,
FormModifier)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment