Prechádzať zdrojové kódy

Add new changes, frst beta deploy.

Cixo Develop 5 mesiacov pred
rodič
commit
ae0fa4e367

+ 61 - 0
application/scripts/downloader.js

@@ -0,0 +1,61 @@
+export class downloader {
+    #name;
+    #content;
+    #type;
+    #encode;
+
+    constructor() {
+        this.#name = "download.json";
+        this.#content = "";
+        this.#type = "text/plain";
+        this.#encode = "utf-8";
+    }
+
+    name(target) {
+        this.#name = target;
+        return this;
+    }
+
+    content(target) {
+        this.#content = target;
+        return this;
+    }
+
+    type(target) {
+        this.#type = target;
+        return this;
+    }
+
+    encode(target) {
+        this.#encode = target;
+        return this;
+    }
+
+    get #href() {
+        return (
+            "data:" + this.#type 
+            + ";charset=" + this.#encode + "," 
+            + encodeURIComponent(this.#content)
+        );
+    }
+
+    get #link() {
+        const link = document.createElement("a");
+        link.style.display = "none";
+        link.href = this.#href;
+        link.download = this.#name;
+
+        return link;
+    }
+
+    process() {
+        const link = this.#link;
+        const body = document.querySelector("body");
+
+        body.appendChild(link);
+        link.click();
+        body.removeChild(link);
+
+        return this;
+    }
+}

+ 52 - 0
application/scripts/import_log.js

@@ -0,0 +1,52 @@
+import { import_process_fail } from "./import_process_fail";
+
+export class import_log {
+    #log;
+ 
+    constructor() {
+        this.#log = new Array();
+    }
+
+    #append(target) {
+        this.#log.push(target);
+    }
+
+    #error_dump(error) {
+        return (
+            "Error: "
+            + new String(error) + "."
+        );
+    }
+
+    #product_dump(product) {
+        return (
+            "Product: "
+            + "barcode: \"" + product.barcode + "\", " 
+            + "title: \"" + product.title + "\"."
+        );
+    }
+
+    fail(target) {
+        this.#append(
+            "Fail when processing item. "
+            + this.#product_dump(target.product) + " "
+            + this.#error_dump(target.error)
+        );
+    }
+
+    skip(target) {
+        this.#append(
+            "Skipping not ready item. "
+            + this.#product_dump(target.product) + " "
+            + this.#error_dump(target.error)
+        );
+    }
+
+    get length() {
+        return this.#log.length;
+    }
+
+    content() {
+        return this.#log.join("\n");
+    }
+}

+ 6 - 9
application/scripts/import_loop.js

@@ -1,10 +1,10 @@
 import { autocomplete_request } from "./autocomplete_request";
 import { create_request } from "./create_request";
+import { import_process_fail } from "./import_process_fail.js";
 import { product_get_request } from "./product_get_request.js";
 
 export class import_loop {
     #content;
-    #failed;
     #on_autocomplete;
     #on_create;
     #on_single_fail;
@@ -44,7 +44,6 @@ export class import_loop {
 
     constructor(dataset) {
         this.#content = dataset;
-        this.#failed = new Array();
         this.#on_autocomplete = null;
         this.#on_create = null;
         this.#on_single_fail = null;
@@ -84,23 +83,20 @@ export class import_loop {
             try {
                 await this.#create(count);
             } catch(error) {
-                console.log(error);
-
                 if (this.#on_single_fail !== null) {
                     try {
-                        this.#on_single_fail(count);
+                        const fail = new import_process_fail(count, error);
+                        this.#on_single_fail(fail);
                     } catch (error) {
                         console.log(error);
                     }
                 }
-
-                this.#failed.push(count);
             }
         }
 
         if (this.#finally !== null) {
             try {
-                this.#finally(this.#failed);
+                this.#finally();
             } catch (error) {
                 console.log(error);
             }
@@ -119,7 +115,8 @@ export class import_loop {
     async #create(target) {
         if (await this.#exists(target)) {
             try {
-                this.#on_skip(target);
+                const result = new import_process_fail(target, null);
+                this.#on_skip(result);
             } catch (error) {
                 console.log(error);
             }

+ 18 - 7
application/scripts/import_products.js

@@ -3,6 +3,8 @@ import { database } from "./database.js";
 import { autocomplete_database } from "./autocomplete_database.js";
 import { import_loop } from "./import_loop.js";
 import { searcher } from "./searcher.js";
+import { import_log } from "./import_log.js";
+import { downloader } from "./downloader.js";
 
 export class import_products extends formscreen {
     #file;
@@ -35,12 +37,14 @@ export class import_products extends formscreen {
         try {
             this._info = "Loading file...";
             this.#content = await this.#load_file();
-            
             this._info = "Parsing file to dataset...";
             
+            const result = new import_log();
+
             const dataset = new database(this.#content)
             .on_skip((fail) => {
                 this._info = "Skipping " + fail.product.barcode + "...";
+                result.skip(fail);
             })
             .process()
             .results();
@@ -53,31 +57,38 @@ export class import_products extends formscreen {
                 this._info = "Creating " + target.barcode + "...";
             })
             .on_single_fail((target) => {
-                this._info = "Can not add " + target.barcode + "...";
+                this._info = "Can not add " + target.product.barcode + "...";
+                result.fail(target);
             })
             .on_skip((target) => {
-                this._info = "Skipping " + target.barcode + "...";
+                this._info = "Skipping " + target.product.barcode + "...";
+                result.skip(target);
             })
             .on_single_success((target) => {
                 this._info = "Created " + target.barcode + " success.";
             })
-            .finally((broken) => {
+            .finally(() => {
                 searcher.reload();
+
+                const log = new downloader()
+                .content(result.content())
+                .type("text/plain")
+                .encode("utf-8")
+                .name("import-json.log")
+                .process();
                 
-                if (broken.length === 0) {
+                if (result.length === 0) {
                     this._success = "All items imported.";
 
                     setTimeout(() => {
                         this.hide();
                     });
                 } else {
-                    console.log(broken);
                     this._success = "Not all items imported...";
                 }
             })
             .process();
         } catch (error) {
-            console.log(error);
             this._error = new String(error);
         }        
     }

+ 64 - 30
assets/autoadder.py

@@ -1,36 +1,41 @@
 import json
 import base64
 import requests
-import googlesearch
-import google_images_search
+import duckduckgo_search
+import typing
 
 from .validator import barcode_validator
 from .exception import bad_request_exception
 from .exception import autoadder_exception
+from .gemini_search import gemini_search
 
 class autoadder:
     def __init__(self, apikey: str, engine: str) -> None:
         self.__apikey = apikey
         self.__engine = engine
+        self.__gemini = gemini_search(apikey)
 
-    def __images(self) -> object:
-        return google_images_search.GoogleImagesSearch(
-            self.__apikey,
-            self.__engine
-        )
+    def __ddg(self) -> duckduckgo_search.DDGS:
+        return duckduckgo_search.DDGS()
 
-    def __search(self, phrase: str) -> object:
-        for count in googlesearch.search(phrase, advanced= True):
-            return count
+    def __search(self, phrase: str) -> str:
+        for count in self.__ddg().text(phrase, max_results = 1):
+            return count["title"]
         
         return phrase
 
+    def __search_images(self, phrase: str) -> typing.Iterable[str]:
+        for count in self.__ddg().images(phrase, max_results = 10):
+            yield count["image"]
+
+        yield phrase
+
     def __check_barcode(self, barcode: str) -> None:
         if barcode_validator(barcode).invalid:
             raise bad_request_exception("Invalid barcode")
 
-    def __image_request(self, source: str) -> str:
-        request = requests.get(source)
+    def __image_request(self, source: str) -> [str, str]:
+        request = requests.get(source, timeout = 3)
 
         if not request.ok or not "Content-Type" in request.headers:
             raise bad_request_exception("Can nor fetch image")
@@ -41,29 +46,48 @@ class autoadder:
 
         return encoded, extension
 
-    def find(self, barcode: str) -> dict:
+    def __try_images(self, images: list) -> [str, str]:
+        for count in images:
+            try:
+                return self.__image_request(count)
+            except:
+                continue
+
+    def __gemini_find(self, barcode: str) -> dict:
+        result = self.__gemini.search(barcode)
+        
+        title = result["title"]
+        description = result["description"]
+        author = result["author"]
+
+        images_url = self.__search_images(title)
+        image, image_type = self.__try_images(images_url)
+
+        splited = title.split(" ")
+
+        if len(splited) > 3:
+            title = " ".join(splited[0:3])
+
+        return {
+            "title": title,
+            "description": description,
+            "author": author,
+            "barcode": barcode,
+            "image": image,
+            "image_type": image_type,
+            "from": "gemini"
+        }
+
+    def __duck_duck_find(self, barcode: str) -> dict:
         self.__check_barcode(barcode)
 
-        title = self.__search(barcode).title
+        title = self.__search(barcode)
         description = title
         author = "Somebody"
         image = ""
         image_type = ""
-
-        try:
-            image_search = self.__images()
-            image_search.search(search_params = {
-                "q": barcode,
-                "num": 1,
-                "filetype": "jpg"
-            })
-
-            images = image_search.results()
-        except Exception as error:
-            raise autoadder_exception("Google API not work. Check API key.")
-
-        if len(images) > 0:
-            image, image_type = self.__image_request(images[0].url)
+        images_url = self.__search_images(barcode)
+        image, image_type = self.__try_images(images_url)
 
         splited = title.split(" ")
 
@@ -76,5 +100,15 @@ class autoadder:
             "author": author,
             "barcode": barcode,
             "image": image,
-            "image_type": image_type
+            "image_type": image_type,
+            "from": "duckduckgo"
         }
+
+    def find(self, barcode: str) -> dict:
+        try:
+            return self.__gemini_find(barcode)
+        except Exception as error:
+            duck_duck_go = self.__duck_duck_find(barcode)
+            duck_duck_go["cause"] = str(error)
+
+            return duck_duck_go

+ 126 - 0
assets/gemini_search.py

@@ -0,0 +1,126 @@
+import json
+import google
+import google.genai
+
+class gemini_search:
+    def __init__(self, apikey: str) -> None:
+        self.__apikey = apikey
+
+    @property
+    def __client(self) -> google.genai.Client:
+        return google.genai.Client(api_key = self.__apikey)
+
+    @property
+    def __model(self) -> str:
+        return "gemini-2.5-flash-preview-05-20"
+
+    def __user(self, barcode: str) -> google.genai.types.Content:
+        return google.genai.types.Content(
+            role = "user",
+            parts = [
+                google.genai.types.Part.from_text(
+                    text = barcode
+                )
+            ]
+        )
+
+    @property
+    def __instructions(self) -> str:
+        return (
+            "Find a product with the given EAN code. Write a short " \
+            + "description of this product (about 200 characters) in " \
+            + "the native language of the country where the product " \
+            + "comes from. Write only the truth."
+        )
+
+    @property
+    def __research(self) -> google.genai.types.GenerateContentConfig:
+        return google.genai.types.GenerateContentConfig(
+            response_mime_type = "text/plain",
+            thinking_config = google.genai.types.ThinkingConfig(
+                thinking_budget = 0,
+            ),
+            tools = [
+                google.genai.types.Tool(
+                    google_search = google.genai.types.GoogleSearch()
+                )
+            ],
+            system_instruction = [
+                google.genai.types.Part.from_text(
+                    text = self.__instructions
+                )
+            ]
+        )
+
+    @property
+    def __process(self) -> google.genai.types.GenerateContentConfig:
+        return google.genai.types.GenerateContentConfig(
+            thinking_config = google.genai.types.ThinkingConfig(
+                thinking_budget = 0,
+            ),
+            response_mime_type = "application/json",
+            response_schema = google.genai.types.Schema(
+                type = google.genai.types.Type.OBJECT,
+                required = ["title", "description", "author"],
+                properties = {
+                    "title": google.genai.types.Schema(
+                        type = google.genai.types.Type.STRING,
+                    ),
+                    "description": google.genai.types.Schema(
+                        type = google.genai.types.Type.STRING,
+                    ),
+                    "author": google.genai.types.Schema(
+                        type = google.genai.types.Type.STRING,
+                    ),
+                },
+            ),
+            system_instruction = [
+                google.genai.types.Part.from_text(
+                    text = self.__instructions
+                )
+            ],
+        )
+
+    def __request(
+        self, 
+        barcode: str,
+        conf: google.genai.types.GenerateContentConfig,
+        addon: str | None = None
+    ) -> str:
+        content = ""
+        contents = [
+            self.__user(barcode)
+        ]
+
+        if addon is not None:
+            contents.append(
+                google.genai.types.Content(
+                    role = "model",
+                    parts = [
+                        google.genai.types.Part.from_text(
+                            text = addon
+                        )
+                    ]
+                )
+            )
+
+            contents.append(
+                self.__user(barcode)
+            )
+
+        for count in self.__client.models.generate_content_stream(
+            model = self.__model,
+            contents = contents,
+            config = conf
+        ):
+            content = content + count.text
+
+        return content
+
+    def search(self, barcode: str) -> dict:
+        research = self.__request(barcode, self.__research)
+        model = self.__request(barcode, self.__process, research)
+
+        return json.loads(model)
+    
+

+ 26 - 26
assets/server.py

@@ -45,7 +45,7 @@ class server(fastapi.FastAPI):
 
     def __static(self) -> None:
         @self.get("/")
-        async def root() -> str:
+        def root() -> str:
             with pathlib.Path("static/core.html").open() as core:
                 return fastapi.responses.HTMLResponse(
                     content = core.read(),
@@ -74,7 +74,7 @@ class server(fastapi.FastAPI):
 
     def __route_autoadder(self) -> None:
         @self.post("/complete/barcode/{barcode}")
-        async def autoadder_complete_barcode(
+        def autoadder_complete_barcode(
             barcode: str,
             request: apikey_request
         ) -> dict:
@@ -85,7 +85,7 @@ class server(fastapi.FastAPI):
 
     def __route_reservations(self) -> None:
         @self.post("/reservations/user/email/{email}")
-        async def reservations_email(
+        def reservations_email(
             email: str,
             reservation: reservation_request
         ) -> dict:
@@ -95,7 +95,7 @@ class server(fastapi.FastAPI):
             return self.reservation_app.get_by_user(body)
 
         @self.post("/reservations/user/phone_number/{phone_number}")
-        async def reservations_email(
+        def reservations_email(
             phone_number: str,
             reservation: reservation_request
         ) -> dict:
@@ -105,7 +105,7 @@ class server(fastapi.FastAPI):
             return self.reservation_app.get_by_user(body)
 
         @self.post("/reservations/product/barcode/{barcode}")
-        async def reservations_barcode(
+        def reservations_barcode(
             barcode: str,
             reservation: reservation_request
         ) -> dict:
@@ -115,7 +115,7 @@ class server(fastapi.FastAPI):
             return self.reservation_app.get_by_product(body)
 
         @self.post("/reservations/product/name/{name}")
-        async def reservations_name(
+        def reservations_name(
             name: str,
             reservation: reservation_request
         ) -> dict:
@@ -125,7 +125,7 @@ class server(fastapi.FastAPI):
             return self.reservation_app.get_by_product(body)
 
         @self.post("/rent/product/barcode/{barcode}")
-        async def rent_barcode(
+        def rent_barcode(
             barcode: str,
             reservation: reservation_request
         ) -> dict:
@@ -135,7 +135,7 @@ class server(fastapi.FastAPI):
             return self.reservation_app.rent_product(body)
 
         @self.post("/rent/product/name/{name}")
-        async def rent_name(
+        def rent_name(
             name: str,
             reservation: reservation_request
         ) -> dict:
@@ -145,7 +145,7 @@ class server(fastapi.FastAPI):
             return self.reservation_app.rent_product(body)
 
         @self.post("/give_back/product/barcode/{barcode}")
-        async def give_back_barcode(
+        def give_back_barcode(
             barcode: str,
             reservation: reservation_request
         ) -> dict:
@@ -155,7 +155,7 @@ class server(fastapi.FastAPI):
             return self.reservation_app.give_back_product(body)
 
         @self.post("/give_back/product/name/{name}")
-        async def give_back_barcode(
+        def give_back_barcode(
             name: str,
             reservation: reservation_request
         ) -> dict:
@@ -166,35 +166,35 @@ class server(fastapi.FastAPI):
 
     def __route_product(self) -> None:
         @self.get("/products")
-        async def products() -> dict:
+        def products() -> dict:
             return self.product_app.all()
 
         @self.get("/product/get/barcode/{barcode}")
-        async def product_get_barcode(barcode: str) -> dict:
+        def product_get_barcode(barcode: str) -> dict:
             return self.product_app.get_barcode(str(barcode))
 
         @self.get("/product/get/name/{name}")
-        async def product_get_name(name: str) -> dict:
+        def product_get_name(name: str) -> dict:
             return self.product_app.get_name(name)
 
         @self.get("/product/search/name/{name}")
-        async def product_search_name(name: str) -> dict:
+        def product_search_name(name: str) -> dict:
             return self.product_app.search_name(name)
 
         @self.get("/product/search/author/{author}")
-        async def product_search_author(author: str) -> dict:
+        def product_search_author(author: str) -> dict:
             return self.product_app.search_author(author)
 
         @self.get("/product/check/barcode/{barcode}")
-        async def product_check_barcode(barcode: str) -> dict:
+        def product_check_barcode(barcode: str) -> dict:
             return self.product_app.check_barcode(str(barcode))
 
         @self.get("/product/check/name/{name}")
-        async def product_check_name(name: str) -> dict:
+        def product_check_name(name: str) -> dict:
             return self.product_app.check_name(name)
 
         @self.post("/product/update/barcode/{barcode}")
-        async def product_barcode_update(
+        def product_barcode_update(
             barcode: str, 
             product: product_update_request
         ) -> dict:
@@ -204,7 +204,7 @@ class server(fastapi.FastAPI):
             return self.product_app.update(body)
 
         @self.post("/product/update/name/{name}")
-        async def product_name_update(
+        def product_name_update(
             name: str, 
             product: product_update_request
         ) -> dict:
@@ -214,7 +214,7 @@ class server(fastapi.FastAPI):
             return self.product_app.update(body)
 
         @self.post("/product/update/image/barcode/{barcode}")
-        async def product_image_barcode_update(
+        def product_image_barcode_update(
             barcode: str,
             product_image: product_update_image_request
         ) -> dict:
@@ -224,7 +224,7 @@ class server(fastapi.FastAPI):
             return self.product_app.update_image(body)
     
         @self.post("/product/update/image/name/{name}")
-        async def product_image_barcode_update(
+        def product_image_barcode_update(
             name: str,
             product_image: product_update_image_request
         ) -> dict:
@@ -234,7 +234,7 @@ class server(fastapi.FastAPI):
             return self.product_app.update_image(body)
 
         @self.delete("/product/barcode/{barcode}")
-        async def product_barcode_delete(
+        def product_barcode_delete(
             barcode: str,
             request: apikey_request
         ) -> dict:
@@ -244,7 +244,7 @@ class server(fastapi.FastAPI):
             return self.product_app.delete(body)
 
         @self.delete("/product/name/{name}")
-        async def product_name_delete(
+        def product_name_delete(
             name: str,
             request: apikey_request
         ) -> dict:
@@ -254,16 +254,16 @@ class server(fastapi.FastAPI):
             return self.product_app.delete(body)
 
         @self.post("/product/create")
-        async def product_create(product: product_create_request) -> dict:
+        def product_create(product: product_create_request) -> dict:
             return self.product_app.create(product.dict())
 
     def __route_users(self) -> None:    
         @self.post("/user/login")
-        async def user_login(user: user_login_request) -> dict:
+        def user_login(user: user_login_request) -> dict:
             return self.users_app.login(user.nick, user.password)
         
         @self.post("/user")
-        async def user_get(body: user_get_request) -> dict:
+        def user_get(body: user_get_request) -> dict:
             return self.users_app.get(body.apikey)
         
 

+ 2 - 2
requirements.txt

@@ -4,6 +4,6 @@ typer-slim
 uvicorn
 pillow
 beautifulsoup4
-googlesearch-python
-Google-Images-Search
 requests
+google-genai
+duckduckgo-search

+ 95 - 13
static/bundle/app.js

@@ -2030,7 +2030,6 @@
   // application/scripts/import_loop.js
   var import_loop = class {
     #content;
-    #failed;
     #on_autocomplete;
     #on_create;
     #on_single_fail;
@@ -2063,7 +2062,6 @@
     }
     constructor(dataset) {
       this.#content = dataset;
-      this.#failed = new Array();
       this.#on_autocomplete = null;
       this.#on_create = null;
       this.#on_single_fail = null;
@@ -2096,20 +2094,19 @@
         try {
           await this.#create(count);
         } catch (error) {
-          console.log(error);
           if (this.#on_single_fail !== null) {
             try {
-              this.#on_single_fail(count);
+              const fail = new import_process_fail(count, error);
+              this.#on_single_fail(fail);
             } catch (error2) {
               console.log(error2);
             }
           }
-          this.#failed.push(count);
         }
       }
       if (this.#finally !== null) {
         try {
-          this.#finally(this.#failed);
+          this.#finally();
         } catch (error) {
           console.log(error);
         }
@@ -2124,7 +2121,8 @@
     async #create(target) {
       if (await this.#exists(target)) {
         try {
-          this.#on_skip(target);
+          const result = new import_process_fail(target, null);
+          this.#on_skip(result);
         } catch (error) {
           console.log(error);
         }
@@ -2152,6 +2150,87 @@
     }
   };
 
+  // application/scripts/import_log.js
+  var import_log = class {
+    #log;
+    constructor() {
+      this.#log = new Array();
+    }
+    #append(target) {
+      this.#log.push(target);
+    }
+    #error_dump(error) {
+      return "Error: " + new String(error) + ".";
+    }
+    #product_dump(product2) {
+      return 'Product: barcode: "' + product2.barcode + '", title: "' + product2.title + '".';
+    }
+    fail(target) {
+      this.#append(
+        "Fail when processing item. " + this.#product_dump(target.product) + " " + this.#error_dump(target.error)
+      );
+    }
+    skip(target) {
+      this.#append(
+        "Skipping not ready item. " + this.#product_dump(target.product) + " " + this.#error_dump(target.error)
+      );
+    }
+    get length() {
+      return this.#log.length;
+    }
+    content() {
+      return this.#log.join("\n");
+    }
+  };
+
+  // application/scripts/downloader.js
+  var downloader = class {
+    #name;
+    #content;
+    #type;
+    #encode;
+    constructor() {
+      this.#name = "download.json";
+      this.#content = "";
+      this.#type = "text/plain";
+      this.#encode = "utf-8";
+    }
+    name(target) {
+      this.#name = target;
+      return this;
+    }
+    content(target) {
+      this.#content = target;
+      return this;
+    }
+    type(target) {
+      this.#type = target;
+      return this;
+    }
+    encode(target) {
+      this.#encode = target;
+      return this;
+    }
+    get #href() {
+      return "data:" + this.#type + ";charset=" + this.#encode + "," + encodeURIComponent(this.#content);
+    }
+    get #link() {
+      const link = document.createElement("a");
+      link.style.display = "none";
+      link.href = this.#href;
+      link.download = this.#name;
+      return link;
+    }
+    process() {
+      const link = this.#link;
+      const body = document.querySelector("body");
+      body.appendChild(link);
+      link.click();
+      body.removeChild(link);
+      return this;
+    }
+  };
+
   // application/scripts/import_products.js
   var import_products = class extends formscreen {
     #file;
@@ -2179,33 +2258,36 @@
         this._info = "Loading file...";
         this.#content = await this.#load_file();
         this._info = "Parsing file to dataset...";
+        const result = new import_log();
         const dataset = new database(this.#content).on_skip((fail) => {
           this._info = "Skipping " + fail.product.barcode + "...";
+          result.skip(fail);
         }).process().results();
         const loop = new import_loop(dataset).on_autocomplete((target) => {
           this._info = "Searching for " + target.barcode + "...";
         }).on_create((target) => {
           this._info = "Creating " + target.barcode + "...";
         }).on_single_fail((target) => {
-          this._info = "Can not add " + target.barcode + "...";
+          this._info = "Can not add " + target.product.barcode + "...";
+          result.fail(target);
         }).on_skip((target) => {
-          this._info = "Skipping " + target.barcode + "...";
+          this._info = "Skipping " + target.product.barcode + "...";
+          result.skip(target);
         }).on_single_success((target) => {
           this._info = "Created " + target.barcode + " success.";
-        }).finally((broken) => {
+        }).finally(() => {
           searcher.reload();
-          if (broken.length === 0) {
+          const log = new downloader().content(result.content()).type("text/plain").encode("utf-8").name("import-json.log").process();
+          if (result.length === 0) {
             this._success = "All items imported.";
             setTimeout(() => {
               this.hide();
             });
           } else {
-            console.log(broken);
             this._success = "Not all items imported...";
           }
         }).process();
       } catch (error) {
-        console.log(error);
         this._error = new String(error);
       }
     }

+ 4 - 4
tests/012-autoadder.py

@@ -15,8 +15,8 @@ location = root / pathlib.Path("config.json")
 resources = assets.config_loader(assets.app_config).load(location).resources
 autoadder = resources.autoadder
 
-print("Questing 9788382752656...")
-print(autoadder.find("9788382752656"))
+print("Questing 5907608646584...")
+print(autoadder.find("5907608646584"))
 print()
 
 print("Testing app:")
@@ -31,9 +31,9 @@ collection.add(user)
 
 app = assets.autoadder_app(collection, resources.autoadder)
 
-print("Questing 9788382752656...")
+print("Questing 5907608646584...")
 print(app.find({
     "apikey": user.apikey,
-    "barcode": "9788382752656"
+    "barcode": "5907608646584"
 }))
 print()