oneCInteraction 1.4.0__tar.gz → 1.4.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {onecinteraction-1.4.0/src/oneCInteraction.egg-info → onecinteraction-1.4.2}/PKG-INFO +1 -1
- {onecinteraction-1.4.0 → onecinteraction-1.4.2}/src/oneCInteraction/nomenclature.py +17 -11
- {onecinteraction-1.4.0 → onecinteraction-1.4.2/src/oneCInteraction.egg-info}/PKG-INFO +1 -1
- onecinteraction-1.4.2/src/oneCInteraction.egg-info/scm_version.json +8 -0
- onecinteraction-1.4.0/src/oneCInteraction.egg-info/scm_version.json +0 -8
- {onecinteraction-1.4.0 → onecinteraction-1.4.2}/.github/workflows/publish.yml +0 -0
- {onecinteraction-1.4.0 → onecinteraction-1.4.2}/.gitignore +0 -0
- {onecinteraction-1.4.0 → onecinteraction-1.4.2}/LICENSE +0 -0
- {onecinteraction-1.4.0 → onecinteraction-1.4.2}/README.md +0 -0
- {onecinteraction-1.4.0 → onecinteraction-1.4.2}/pyproject.toml +0 -0
- {onecinteraction-1.4.0 → onecinteraction-1.4.2}/setup.cfg +0 -0
- {onecinteraction-1.4.0 → onecinteraction-1.4.2}/src/oneCInteraction/__init__.py +0 -0
- {onecinteraction-1.4.0 → onecinteraction-1.4.2}/src/oneCInteraction/categories.py +0 -0
- {onecinteraction-1.4.0 → onecinteraction-1.4.2}/src/oneCInteraction/characteristics.py +0 -0
- {onecinteraction-1.4.0 → onecinteraction-1.4.2}/src/oneCInteraction/connection.py +0 -0
- {onecinteraction-1.4.0 → onecinteraction-1.4.2}/src/oneCInteraction/customers.py +0 -0
- {onecinteraction-1.4.0 → onecinteraction-1.4.2}/src/oneCInteraction/discounts.py +0 -0
- {onecinteraction-1.4.0 → onecinteraction-1.4.2}/src/oneCInteraction/groups.py +0 -0
- {onecinteraction-1.4.0 → onecinteraction-1.4.2}/src/oneCInteraction/log.py +0 -0
- {onecinteraction-1.4.0 → onecinteraction-1.4.2}/src/oneCInteraction/orders.py +0 -0
- {onecinteraction-1.4.0 → onecinteraction-1.4.2}/src/oneCInteraction/properties.py +0 -0
- {onecinteraction-1.4.0 → onecinteraction-1.4.2}/src/oneCInteraction/structures.py +0 -0
- {onecinteraction-1.4.0 → onecinteraction-1.4.2}/src/oneCInteraction.egg-info/SOURCES.txt +0 -0
- {onecinteraction-1.4.0 → onecinteraction-1.4.2}/src/oneCInteraction.egg-info/dependency_links.txt +0 -0
- {onecinteraction-1.4.0 → onecinteraction-1.4.2}/src/oneCInteraction.egg-info/requires.txt +0 -0
- {onecinteraction-1.4.0 → onecinteraction-1.4.2}/src/oneCInteraction.egg-info/scm_file_list.json +0 -0
- {onecinteraction-1.4.0 → onecinteraction-1.4.2}/src/oneCInteraction.egg-info/top_level.txt +0 -0
- {onecinteraction-1.4.0 → onecinteraction-1.4.2}/tests/test_lib.py +0 -0
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import os
|
|
2
|
+
import glob
|
|
3
|
+
import hashlib
|
|
2
4
|
from datetime import datetime
|
|
3
5
|
from .log import log_sys
|
|
4
6
|
from . import structures
|
|
@@ -449,7 +451,7 @@ class NomenclatureManager:
|
|
|
449
451
|
|
|
450
452
|
c_query = self.c_v8.NewObject("Query")
|
|
451
453
|
c_query.Text = """
|
|
452
|
-
SELECT Объект AS ProductRef, Ссылка AS ImageRef,
|
|
454
|
+
SELECT Объект AS ProductRef, Ссылка AS ImageRef, ХешФайла AS DataVersion, ИмяФайла AS FileName
|
|
453
455
|
FROM Справочник.ХранилищеДополнительнойИнформации
|
|
454
456
|
WHERE Объект В (&ProductRefs) AND ПометкаУдаления = ЛОЖЬ
|
|
455
457
|
ORDER BY Наименование
|
|
@@ -704,7 +706,7 @@ class NomenclatureManager:
|
|
|
704
706
|
os.makedirs(s_imageDirIn, exist_ok=True)
|
|
705
707
|
|
|
706
708
|
l_savedFilenames = []
|
|
707
|
-
l_imageUuids = getattr(c_productObjIn, 'l_images', [])
|
|
709
|
+
l_imageUuids = list(getattr(c_productObjIn, 'l_images', []))
|
|
708
710
|
|
|
709
711
|
if not l_imageUuids:
|
|
710
712
|
try:
|
|
@@ -714,7 +716,7 @@ class NomenclatureManager:
|
|
|
714
716
|
|
|
715
717
|
c_query = self.c_v8.NewObject("Query")
|
|
716
718
|
c_query.Text = """
|
|
717
|
-
SELECT Ссылка,
|
|
719
|
+
SELECT Ссылка, ХешФайла AS DataVersion, ИмяФайла AS FileName
|
|
718
720
|
FROM Справочник.ХранилищеДополнительнойИнформации
|
|
719
721
|
WHERE Объект = &ProductRef AND ПометкаУдаления = ЛОЖЬ
|
|
720
722
|
ORDER BY Наименование
|
|
@@ -743,13 +745,10 @@ class NomenclatureManager:
|
|
|
743
745
|
except Exception as e:
|
|
744
746
|
log_sys(f"Error fetching image references for {c_productObjIn.s_code}: {e}", 1)
|
|
745
747
|
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
import hashlib
|
|
750
|
-
import glob
|
|
751
|
-
|
|
752
748
|
s_cleanProductUuid = str(getattr(c_productObjIn, 's_uuid', '')).replace('{', '').replace('}', '').replace('-', '')
|
|
749
|
+
if not s_cleanProductUuid:
|
|
750
|
+
log_sys(f"Cannot save images: product '{getattr(c_productObjIn, 's_name', getattr(c_productObjIn, 's_code', '?'))}' has no UUID.", 1)
|
|
751
|
+
return []
|
|
753
752
|
|
|
754
753
|
for idx, img_info in enumerate(l_imageUuids):
|
|
755
754
|
if isinstance(img_info, dict):
|
|
@@ -785,12 +784,19 @@ class NomenclatureManager:
|
|
|
785
784
|
c_binaryData = c_valueStorage.Get()
|
|
786
785
|
|
|
787
786
|
if c_binaryData:
|
|
788
|
-
# Remove older versions matching this slot
|
|
789
|
-
for old_f in glob.glob(os.path.join(s_imageDirIn, f"{s_cleanProductUuid}_{idx}*")):
|
|
787
|
+
# Remove older versions matching this exact slot
|
|
788
|
+
for old_f in glob.glob(os.path.join(s_imageDirIn, f"{s_cleanProductUuid}_{idx}_*")):
|
|
790
789
|
try:
|
|
791
790
|
os.remove(old_f)
|
|
792
791
|
except OSError:
|
|
793
792
|
pass
|
|
793
|
+
# Also try to remove the non-hashed legacy fallback if it exists
|
|
794
|
+
legacy_f = os.path.join(s_imageDirIn, f"{s_cleanProductUuid}_{idx}.jpg")
|
|
795
|
+
if os.path.exists(legacy_f):
|
|
796
|
+
try:
|
|
797
|
+
os.remove(legacy_f)
|
|
798
|
+
except OSError:
|
|
799
|
+
pass
|
|
794
800
|
|
|
795
801
|
c_binaryData.Write(s_filePath)
|
|
796
802
|
if os.path.exists(s_filePath):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{onecinteraction-1.4.0 → onecinteraction-1.4.2}/src/oneCInteraction.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
{onecinteraction-1.4.0 → onecinteraction-1.4.2}/src/oneCInteraction.egg-info/scm_file_list.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|