diff --git a/.docker/Dockerfile b/.docker/Dockerfile index 65b05d3e52ab0016948a6ff8ba77cad31ee9126b..c686793999e9ca7b1cf2f3bb58c77792dd810af2 100644 --- a/.docker/Dockerfile +++ b/.docker/Dockerfile @@ -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 diff --git a/src/caosadvancedtools/crawler.py b/src/caosadvancedtools/crawler.py index 04b941d99619a88bd4cdfdd9b846188e91027f16..0a580592a05af5b7eb10a60f25a49a3e73bc3835 100644 --- a/src/caosadvancedtools/crawler.py +++ b/src/caosadvancedtools/crawler.py @@ -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 crawled_file in files: + for cfood in cfoods: 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