Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
api
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
webNIST
api
Commits
807cfbf9
Commit
807cfbf9
authored
7 years ago
by
Marco De Donno
Browse files
Options
Downloads
Patches
Plain Diff
Call the process function by default when a file is uploaded
parent
ca788009
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
functions.py
+14
-0
14 additions, 0 deletions
functions.py
module.py
+5
-0
5 additions, 0 deletions
module.py
with
19 additions
and
0 deletions
functions.py
0 → 100644
+
14
−
0
View file @
807cfbf9
#!/usr/bin/python
# -*- coding: UTF-8 -*-
from
NIST.fingerprint
import
NISTf_auto
def
process
(
wd
,
filename
):
n
=
NISTf_auto
(
wd
+
"
/
"
+
filename
)
############################################################################
# Data export
with
open
(
wd
+
"
/data.txt
"
,
"
w+
"
)
as
fp
:
fp
.
write
(
str
(
n
)
)
This diff is collapsed.
Click to expand it.
module.py
+
5
−
0
View file @
807cfbf9
...
...
@@ -3,12 +3,15 @@
from
flask
import
*
from
flask_compress
import
Compress
from
threading
import
Thread
from
werkzeug
import
*
import
logging
import
os
import
tempfile
from
functions
import
*
################################################################################
logging
.
getLogger
().
setLevel
(
logging
.
INFO
)
...
...
@@ -63,6 +66,8 @@ def upload_file():
filename
=
secure_filename
(
file
.
filename
)
file
.
save
(
os
.
path
.
join
(
UPLOAD_FOLDER
,
filename
)
)
Thread
(
target
=
process
,
args
=
(
UPLOAD_FOLDER
,
filename
)
).
start
()
return
jsonify
(
{
'
error
'
:
False
,
'
file
'
:
filename
}
)
################################################################################
...
...
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