Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-advanced-user-tools
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue 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
caosdb
Software
caosdb-advanced-user-tools
Commits
731829a9
Commit
731829a9
authored
5 years ago
by
Henrik tom Wörden
Browse files
Options
Downloads
Patches
Plain Diff
change order of iterating
parent
666abfa2
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.docker/Dockerfile
+2
-2
2 additions, 2 deletions
.docker/Dockerfile
src/caosadvancedtools/crawler.py
+17
-13
17 additions, 13 deletions
src/caosadvancedtools/crawler.py
with
19 additions
and
15 deletions
.docker/Dockerfile
+
2
−
2
View file @
731829a9
...
...
@@ -7,9 +7,9 @@ RUN git clone https://gitlab.com/caosdb/caosdb-pylib.git && \
cd
caosdb-pylib
&&
pip3
install
.
RUN
git clone https://gitlab.com/caosdb/caosdb-models.git
&&
\
cd
caosdb-models
&&
pip3
install
.
ADD
https://gitlab.com/api/v4/projects/13601752/repository/branches/
project_cfood
\
ADD
https://gitlab.com/api/v4/projects/13601752/repository/branches/
master
\
scifolder_version.json
RUN
git clone
-b
project_cfood
\
RUN
git clone
\
https://gitlab.com/henrik_indiscale/scifolder.git
&&
\
cd
scifolder
&&
pip3
install
.
COPY
. /git
...
...
This diff is collapsed.
Click to expand it.
src/caosadvancedtools/crawler.py
+
17
−
13
View file @
731829a9
...
...
@@ -79,22 +79,21 @@ class Crawler(object):
print
(
"
-
"
*
60
)
print
(
"
Matching files against CFoods
"
)
for
crawled_file
in
files
:
for
Cfood
in
self
.
food
:
if
self
.
verbosity
>=
VERBOSE
:
print
(
"
Matching {}...
"
.
format
(
crawled_file
.
path
))
# if crawled_file.size == 0:
# crawled_file.add_message(
# type="Warning", description="This file is empty. Shouldn't we delete it?")
# self.report.append(crawled_file)
print
(
"
Matching against {}...
"
.
format
(
Cfood
.
__name__
))
# continue
for
crawled_file
in
files
:
if
self
.
verbosity
>=
DEBUG
:
print
(
"
Matching {}...
"
.
format
(
crawled_file
.
path
))
for
Cfood
in
self
.
food
:
if
Cfood
.
match
(
crawled_file
.
path
)
is
not
None
:
matches
[
crawled_file
.
path
]
+=
1
if
self
.
verbosity
>=
VERBOSE
:
print
(
"
{} matched.
"
.
format
(
Cfood
.
__name__
))
print
(
"
{} matched
\n
{}.
"
.
format
(
Cfood
.
__class__
.
__name__
,
crawled_file
.
path
))
try
:
cfoods
.
append
(
Cfood
(
crawled_file
,
access
=
self
.
access
,
verbosity
=
self
.
verbosity
))
...
...
@@ -106,14 +105,19 @@ class Crawler(object):
print
(
"
-
"
*
60
)
print
(
"
Trying to attach files to created CFoods
"
)
for
c
rawled_file
in
file
s
:
for
c
food
in
cfood
s
:
if
self
.
verbosity
>=
VERBOSE
:
print
(
"
Matching {}...
"
.
format
(
crawled_file
.
path
))
print
(
"
Matching against {}...
"
.
format
(
Cfood
.
__name__
))
for
crawled_file
in
files
:
if
self
.
verbosity
>=
DEBUG
:
print
(
"
Matching {}...
"
.
format
(
crawled_file
.
path
))
for
cfood
in
cfoods
:
if
cfood
.
looking_for
(
crawled_file
):
if
self
.
verbosity
>=
VERBOSE
:
print
(
"
{} matched.
"
.
format
(
cfood
.
__class__
.
__name__
))
print
(
"
{} matched
\n
{}.
"
.
format
(
Cfood
.
__class__
.
__name__
,
crawled_file
.
path
))
cfood
.
attach
(
crawled_file
)
matches
[
crawled_file
.
path
]
+=
1
...
...
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