Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
LabelsTower
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MaitresNageurs
README
LabelsTower
Commits
752b3616
Commit
752b3616
authored
5 years ago
by
erichard
Browse files
Options
Downloads
Patches
Plain Diff
Change import workflow with new package "labels_system"
parent
aec83afd
No related branches found
No related tags found
2 merge requests
!61
Packager labelstower
,
!60
WIP: Implement sqlalchemy
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
app/__init__.py
+4
-2
4 additions, 2 deletions
app/__init__.py
app/labels_system/__init__.py
+6
-0
6 additions, 0 deletions
app/labels_system/__init__.py
app/labels_system/routes.py
+4
-5
4 additions, 5 deletions
app/labels_system/routes.py
with
14 additions
and
7 deletions
app/__init__.py
+
4
−
2
View file @
752b3616
import
os
from
flask
import
Flask
,
render_template
from
app.labels_system.label_system
import
sort
class
CustomFlask
(
Flask
):
jinja_options
=
Flask
.
jinja_options
.
copy
()
...
...
@@ -18,11 +17,14 @@ def create_app():
app
.
config
.
from_object
(
os
.
environ
[
'
LABELSTOWER_ENV
'
])
from
app.labels_system
import
bp
app
.
register_blueprint
(
bp
,
url_prefix
=
'
/sort
'
)
@app.route
(
'
/
'
)
@app.route
(
'
/browse
'
)
def
home
():
return
render_template
(
'
browse.html
'
,
txt
=
text_component
)
app
.
register_blueprint
(
sort
,
url_prefix
=
'
/sort
'
)
return
app
...
...
This diff is collapsed.
Click to expand it.
app/labels_system/__init__.py
0 → 100644
+
6
−
0
View file @
752b3616
from
flask
import
Blueprint
bp
=
Blueprint
(
'
sort
'
,
__name__
)
from
app.labels_system
import
routes
This diff is collapsed.
Click to expand it.
app/labels_system/
label_sys
te
m
.py
→
app/labels_system/
rou
te
s
.py
+
4
−
5
View file @
752b3616
from
typing
import
Dict
,
List
import
json
from
flask
import
Blueprint
from
app.labels_system.getter
import
get_selected_elements
,
get_discriminating_labels
,
get_high_discriminating_labels
from
app.labels_system
import
bp
sort
=
Blueprint
(
'
sort
'
,
__name__
)
#URLs call to update labels and elements along researchs
@
sort
.route
(
'
/search/<int:number_of_mandatory_labels>
'
,
defaults
=
{
'
optional1
'
:
''
,
'
optional2
'
:
''
})
@
sort
.route
(
'
/search/<int:number_of_mandatory_labels>/<string:optional1>
'
,
defaults
=
{
'
optional2
'
:
''
})
@
sort
.route
(
'
/search/<int:number_of_mandatory_labels>/<string:optional1>/<string:optional2>
'
)
@
bp
.route
(
'
/search/<int:number_of_mandatory_labels>
'
,
defaults
=
{
'
optional1
'
:
''
,
'
optional2
'
:
''
})
@
bp
.route
(
'
/search/<int:number_of_mandatory_labels>/<string:optional1>
'
,
defaults
=
{
'
optional2
'
:
''
})
@
bp
.route
(
'
/search/<int:number_of_mandatory_labels>/<string:optional1>/<string:optional2>
'
)
def
search
(
number_of_mandatory_labels
:
int
,
optional1
:
str
,
optional2
:
str
)
->
List
[
List
[
Dict
[
int
,
str
]]]
:
'''
Return updated lists of selected elements and high discriminating labels useful to continu research
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment