Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
limbra
limbra
Commits
216b7026
Commit
216b7026
authored
Nov 07, 2019
by
LE GAC Renaud
Browse files
Apply 2to3 converter to remaining modules.
parent
615dcd15
Changes
21
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
42 additions
and
60 deletions
+42
-60
modules/auth.py
modules/auth.py
+0
-1
modules/callbacks.py
modules/callbacks.py
+10
-9
modules/check_tools.py
modules/check_tools.py
+1
-2
modules/countries.py
modules/countries.py
+0
-1
modules/filters.py
modules/filters.py
+0
-1
modules/graph_tools.py
modules/graph_tools.py
+3
-4
modules/list_postprocessing.py
modules/list_postprocessing.py
+0
-1
modules/model_app.py
modules/model_app.py
+1
-2
modules/model_core.py
modules/model_core.py
+12
-13
modules/model_harvester.py
modules/model_harvester.py
+4
-5
modules/model_report.py
modules/model_report.py
+1
-2
modules/model_selector.py
modules/model_selector.py
+2
-3
modules/regex.py
modules/regex.py
+0
-1
modules/reporting_tools.py
modules/reporting_tools.py
+5
-6
modules/ui_app.py
modules/ui_app.py
+0
-1
modules/ui_auth.py
modules/ui_auth.py
+0
-1
modules/ui_core.py
modules/ui_core.py
+1
-2
modules/ui_harvester.py
modules/ui_harvester.py
+0
-1
modules/ui_report.py
modules/ui_report.py
+0
-1
modules/ui_selector.py
modules/ui_selector.py
+2
-3
No files found.
modules/auth.py
View file @
216b7026
# -*- coding: utf-8 -*-
""" auth
* Customise the authentication
...
...
modules/callbacks.py
View file @
216b7026
# -*- 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
,
duplicate_conference
,
duplicate_report
)
from
.
check_tools
import
(
duplicate_article
,
duplicate_conference
,
duplicate_report
)
from
gluon
import
current
from
plugin_dbui
import
(
CALLBACK_ERRORS
,
get_id
,
...
...
@@ -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
...
...
modules/check_tools.py
View file @
216b7026
# -*- 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
,
...
...
modules/countries.py
View file @
216b7026
# -*- coding: utf-8 -*-
""" countries
List of countries extract from the geographical database www.geonames.org:
...
...
modules/filters.py
View file @
216b7026
# -*- coding: utf-8 -*-
"""a collections of functions to correct entries in the database.
"""
...
...
modules/graph_tools.py
View file @
216b7026
# -*- 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
.
iter
items
():
for
k
,
v
in
di
.
items
():
if
k
in
(
"Graph_selectorYear_start"
,
"Graph_selectorYear_end"
):
continue
...
...
modules/list_postprocessing.py
View file @
216b7026
# -*- coding: utf-8 -*-
"""A collection of functions to polish the representation of a
publication in a list.
...
...
modules/model_app.py
View file @
216b7026
# -*- 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
...
...
modules/model_core.py
View file @
216b7026
# -*- coding: utf-8 -*-
"""Definitions of the core tables
"""
from
callbacks
import
(
INHIBIT_CASCADE_DELETE
,
INHIBIT_DUPLICATE_PUBLICATION
,
INHIBIT_PUBLICATION_DELETE_ON_OK
,
INHIBIT_PUBLICATION_UPDATE_ON_OK
)
from
.
callbacks
import
(
INHIBIT_CASCADE_DELETE
,
INHIBIT_DUPLICATE_PUBLICATION
,
INHIBIT_PUBLICATION_DELETE_ON_OK
,
INHIBIT_PUBLICATION_UPDATE_ON_OK
)
from
filters
import
(
CLEAN_COLLABORATION
,
CLEAN_COLLABORATION_SYNONYM
,
CLEAN_THESIS_DEFENSE
)
from
.
filters
import
(
CLEAN_COLLABORATION
,
CLEAN_COLLABORATION_SYNONYM
,
CLEAN_THESIS_DEFENSE
)
from
gluon
import
current
from
gluon.validators
import
(
IS_EMPTY_OR
,
...
...
@@ -28,11 +27,11 @@ from plugin_dbui import (CLEAN_COMMA,
UNDEF_ID
)
from
pydal
import
Field
from
regex
import
(
REG_COLLABORATION
,
REG_CONF_DATES
,
REG_DEFENSE
,
REG_SUBMITTED
,
REG_VALID_ORIGIN
)
from
.
regex
import
(
REG_COLLABORATION
,
REG_CONF_DATES
,
REG_DEFENSE
,
REG_SUBMITTED
,
REG_VALID_ORIGIN
)
CAT_USUAL
=
[
"article"
,
"book"
,
...
...
modules/model_harvester.py
View file @
216b7026
# -*- coding: utf-8 -*-
"""Definitions of the harveser's tables
"""
from
callbacks
import
(
INHIBIT_CASCADE_DELETE
,
INHIBIT_CONTROLLER_INSERT
,
INHIBIT_CONTROLLER_UPDATE
,
INHIBIT_HARVESTER
)
from
.
callbacks
import
(
INHIBIT_CASCADE_DELETE
,
INHIBIT_CONTROLLER_INSERT
,
INHIBIT_CONTROLLER_UPDATE
,
INHIBIT_HARVESTER
)
from
gluon
import
current
...
...
modules/model_report.py
View file @
216b7026
# -*- 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
,
...
...
modules/model_selector.py
View file @
216b7026
# -*- 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
...
...
modules/regex.py
View file @
216b7026
# *-* coding: utf-8 *-*
""" A collections of regular expression defining rules validating
fields content.
...
...
modules/reporting_tools.py
View file @
216b7026
# -*- coding: utf-8 -*-
"""A collection of tools to build reports in controllers.
"""
import
re
from
list_postprocessing
import
(
clean
,
highlight_my_authors
,
highlight_my_speaker
,
remove_undef
)
from
.
list_postprocessing
import
(
clean
,
highlight_my_authors
,
highlight_my_speaker
,
remove_undef
)
from
gluon.storage
import
Storage
from
pydal.helpers.methods
import
smart_query
...
...
@@ -178,7 +177,7 @@ def ref_url(name="List"):
"""
li
=
[]
for
(
k
,
v
)
in
request
.
vars
.
iter
items
():
for
k
,
v
in
request
.
vars
.
items
():
if
k
.
startswith
(
name
)
and
len
(
v
):
li
.
append
(
"%s=%s"
%
(
k
,
v
))
pass
...
...
modules/ui_app.py
View file @
216b7026
# -*- coding: utf-8 -*-
"""User Interface for the App tables
"""
...
...
modules/ui_auth.py
View file @
216b7026
# -*- coding: utf-8 -*-
"""User Interface for the authentication tables
"""
...
...
modules/ui_core.py
View file @
216b7026
# -*- 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
,
...
...
modules/ui_harvester.py
View file @
216b7026
# -*- coding: utf-8 -*-
"""User Interface for the harvester tables
"""
...
...
modules/ui_report.py
View file @
216b7026
# -*- coding: utf-8 -*-
"""User Interface for the report tables
"""
...
...
modules/ui_selector.py
View file @
216b7026
# -*- 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
)
...
...
Prev
1
2
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment