From bbda3cbe46802c9d66142c61aec3a0d9bf5e7b5a Mon Sep 17 00:00:00 2001 From: Konstantin Baranovskiy Date: Fri, 17 Apr 2020 15:21:51 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B0=20=D0=BE=D0=B1=D1=80=D0=B0=D0=B1=D0=BE=D1=82?= =?UTF-8?q?=D0=BA=D0=B0=20=D0=BC=D0=BD=D0=BE=D0=B6=D0=B8=D1=82=D0=B5=D0=BB?= =?UTF-8?q?=D0=B5=D0=B9=20=D0=B2=20=D0=B7=D0=BD=D0=B0=D1=87=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D1=8F=D1=85=20R/L/C.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bom/Scripts/python/doc/help.adoc | 2 +- bom/Scripts/python/doc/help.html | 6 +++--- bom/Scripts/python/pythonpath/schematic.py | 12 +++++++++--- gbom/Scripts/python/doc/help.adoc | 2 +- gbom/Scripts/python/doc/help.html | 6 +++--- gbom/Scripts/python/pythonpath/schematic.py | 12 +++++++++--- gspec/Scripts/python/doc/help.adoc | 2 +- gspec/Scripts/python/doc/help.html | 6 +++--- gspec/Scripts/python/pythonpath/schematic.py | 12 +++++++++--- index/Scripts/python/doc/help.adoc | 2 +- index/Scripts/python/doc/help.html | 6 +++--- index/Scripts/python/pythonpath/schematic.py | 7 ++++++- manual/Scripts/python/doc/help.adoc | 2 +- manual/Scripts/python/doc/help.html | 6 +++--- spec/Scripts/python/doc/help.adoc | 2 +- spec/Scripts/python/doc/help.html | 6 +++--- spec/Scripts/python/pythonpath/schematic.py | 12 +++++++++--- 17 files changed, 66 insertions(+), 37 deletions(-) diff --git a/bom/Scripts/python/doc/help.adoc b/bom/Scripts/python/doc/help.adoc index 0875a7e..00f281c 100644 --- a/bom/Scripts/python/doc/help.adoc +++ b/bom/Scripts/python/doc/help.adoc @@ -12,7 +12,7 @@ = Ведомость покупных изделий :author: Барановский Константин :email: baranovskiykonstantin@gmail.com -:revnumber: 1.1 +:revnumber: 1.2 Справочное руководство diff --git a/bom/Scripts/python/doc/help.html b/bom/Scripts/python/doc/help.html index 090d958..1138d13 100644 --- a/bom/Scripts/python/doc/help.html +++ b/bom/Scripts/python/doc/help.html @@ -443,7 +443,7 @@

Ведомость покупных изделий

Барановский Константин

-версия 1.1 +версия 1.2
Содержание
@@ -1465,8 +1465,8 @@

Номера строк

diff --git a/bom/Scripts/python/pythonpath/schematic.py b/bom/Scripts/python/pythonpath/schematic.py index 52a3c13..1481d8f 100644 --- a/bom/Scripts/python/pythonpath/schematic.py +++ b/bom/Scripts/python/pythonpath/schematic.py @@ -205,6 +205,8 @@ def getValueWithUnits(self): # Перевести множитель на русский if multiplier in Component.multipliersDict: multiplier = Component.multipliersDict[multiplier] + elif multiplier is None: + multiplier = '' numValue = numValue.replace('.', ',') return numValue + separator + multiplier + units return self.value @@ -363,7 +365,10 @@ def getBomValue(self, name, singular=False, plural=False): value = self.getFieldValue(fieldName) value = self._convertSingularPlural(value, singular, plural) if name == "name" and not value: - value = self.value + if config.getboolean("bom", "add units"): + value = self.getValueWithUnits() + else: + value = self.value if value is None: value = "" return value @@ -399,7 +404,8 @@ def getExpandedValue(self): 'n': 1e-9, 'н': 1e-9, 'p': 1e-12, - 'п': 1e-12 + 'п': 1e-12, + None: 1 } if self.getRefType().startswith('C'): value = self.value @@ -425,7 +431,7 @@ def getExpandedValue(self): value = value.rstrip('H') value = value.replace("Гн", "") value = value.strip() - if re.match(r"^\d+[\.,]\d+$", value): + if re.match(r"^\d+(?:[\.,]\d+)?$", value): extValue = float(value.replace(',', '.')) * 1e-6 elif re.match(Component.regexpr1, value): searchRes = re.search(Component.regexpr1, value).groups() diff --git a/gbom/Scripts/python/doc/help.adoc b/gbom/Scripts/python/doc/help.adoc index fbd4f39..222805f 100644 --- a/gbom/Scripts/python/doc/help.adoc +++ b/gbom/Scripts/python/doc/help.adoc @@ -12,7 +12,7 @@ = Групповая ведомость покупных изделий :author: Барановский Константин :email: baranovskiykonstantin@gmail.com -:revnumber: 1.1 +:revnumber: 1.2 Справочное руководство diff --git a/gbom/Scripts/python/doc/help.html b/gbom/Scripts/python/doc/help.html index 7225dff..d8a1092 100644 --- a/gbom/Scripts/python/doc/help.html +++ b/gbom/Scripts/python/doc/help.html @@ -443,7 +443,7 @@

Групповая ведомость покупных изделий

Барановский Константин

-версия 1.1 +версия 1.2
Содержание
@@ -1456,8 +1456,8 @@

Номера строк

diff --git a/gbom/Scripts/python/pythonpath/schematic.py b/gbom/Scripts/python/pythonpath/schematic.py index c307667..c5663c3 100644 --- a/gbom/Scripts/python/pythonpath/schematic.py +++ b/gbom/Scripts/python/pythonpath/schematic.py @@ -205,6 +205,8 @@ def getValueWithUnits(self): # Перевести множитель на русский if multiplier in Component.multipliersDict: multiplier = Component.multipliersDict[multiplier] + elif multiplier is None: + multiplier = '' numValue = numValue.replace('.', ',') return numValue + separator + multiplier + units return self.value @@ -363,7 +365,10 @@ def getBomValue(self, name, singular=False, plural=False): value = self.getFieldValue(fieldName) value = self._convertSingularPlural(value, singular, plural) if name == "name" and not value: - value = self.value + if config.getboolean("bom", "add units"): + value = self.getValueWithUnits() + else: + value = self.value if value is None: value = "" return value @@ -399,7 +404,8 @@ def getExpandedValue(self): 'n': 1e-9, 'н': 1e-9, 'p': 1e-12, - 'п': 1e-12 + 'п': 1e-12, + None: 1 } if self.getRefType().startswith('C'): value = self.value @@ -425,7 +431,7 @@ def getExpandedValue(self): value = value.rstrip('H') value = value.replace("Гн", "") value = value.strip() - if re.match(r"^\d+[\.,]\d+$", value): + if re.match(r"^\d+(?:[\.,]\d+)?$", value): extValue = float(value.replace(',', '.')) * 1e-6 elif re.match(Component.regexpr1, value): searchRes = re.search(Component.regexpr1, value).groups() diff --git a/gspec/Scripts/python/doc/help.adoc b/gspec/Scripts/python/doc/help.adoc index 1d17d51..cb9cfe0 100644 --- a/gspec/Scripts/python/doc/help.adoc +++ b/gspec/Scripts/python/doc/help.adoc @@ -12,7 +12,7 @@ = Групповая спецификация :author: Барановский Константин :email: baranovskiykonstantin@gmail.com -:revnumber: 1.1 +:revnumber: 1.2 Справочное руководство diff --git a/gspec/Scripts/python/doc/help.html b/gspec/Scripts/python/doc/help.html index 7268ab0..da1b79c 100644 --- a/gspec/Scripts/python/doc/help.html +++ b/gspec/Scripts/python/doc/help.html @@ -443,7 +443,7 @@

Групповая спецификация

Барановский Константин

-версия 1.1 +версия 1.2
Содержание
@@ -1581,8 +1581,8 @@

Номера позиций

diff --git a/gspec/Scripts/python/pythonpath/schematic.py b/gspec/Scripts/python/pythonpath/schematic.py index 399f019..75a0a19 100644 --- a/gspec/Scripts/python/pythonpath/schematic.py +++ b/gspec/Scripts/python/pythonpath/schematic.py @@ -205,6 +205,8 @@ def getValueWithUnits(self): # Перевести множитель на русский if multiplier in Component.multipliersDict: multiplier = Component.multipliersDict[multiplier] + elif multiplier is None: + multiplier = '' numValue = numValue.replace('.', ',') return numValue + separator + multiplier + units return self.value @@ -363,7 +365,10 @@ def getSpecValue(self, name, singular=False, plural=False): value = self.getFieldValue(fieldName) value = self._convertSingularPlural(value, singular, plural) if name == "name" and not value: - value = self.value + if config.getboolean("spec", "add units"): + value = self.getValueWithUnits() + else: + value = self.value if value is None: value = "" return value @@ -399,7 +404,8 @@ def getExpandedValue(self): 'n': 1e-9, 'н': 1e-9, 'p': 1e-12, - 'п': 1e-12 + 'п': 1e-12, + None: 1 } if self.getRefType().startswith('C'): value = self.value @@ -425,7 +431,7 @@ def getExpandedValue(self): value = value.rstrip('H') value = value.replace("Гн", "") value = value.strip() - if re.match(r"^\d+[\.,]\d+$", value): + if re.match(r"^\d+(?:[\.,]\d+)?$", value): extValue = float(value.replace(',', '.')) * 1e-6 elif re.match(Component.regexpr1, value): searchRes = re.search(Component.regexpr1, value).groups() diff --git a/index/Scripts/python/doc/help.adoc b/index/Scripts/python/doc/help.adoc index 7d757ca..14e863d 100644 --- a/index/Scripts/python/doc/help.adoc +++ b/index/Scripts/python/doc/help.adoc @@ -12,7 +12,7 @@ = Перечень элементов :author: Барановский Константин :email: baranovskiykonstantin@gmail.com -:revnumber: 1.1 +:revnumber: 1.2 Справочное руководство diff --git a/index/Scripts/python/doc/help.html b/index/Scripts/python/doc/help.html index 286f17c..643690f 100644 --- a/index/Scripts/python/doc/help.html +++ b/index/Scripts/python/doc/help.html @@ -443,7 +443,7 @@

Перечень элементов

Барановский Константин

-версия 1.1 +версия 1.2
Содержание
@@ -1440,8 +1440,8 @@

Размер шрифта т

diff --git a/index/Scripts/python/pythonpath/schematic.py b/index/Scripts/python/pythonpath/schematic.py index da8aeb9..e85ebf3 100644 --- a/index/Scripts/python/pythonpath/schematic.py +++ b/index/Scripts/python/pythonpath/schematic.py @@ -204,6 +204,8 @@ def getValueWithUnits(self): # Перевести множитель на русский if multiplier in multipliersDict: multiplier = multipliersDict[multiplier] + elif multiplier is None: + multiplier = '' numValue = numValue.replace('.', ',') return numValue + separator + multiplier + units return self.value @@ -362,7 +364,10 @@ def getIndexValue(self, name, singular=False, plural=False): value = self.getFieldValue(fieldName) value = self._convertSingularPlural(value, singular, plural) if name == "name" and not value: - value = self.value + if config.getboolean("index", "add units"): + value = self.getValueWithUnits() + else: + value = self.value if value is None: value = "" return value diff --git a/manual/Scripts/python/doc/help.adoc b/manual/Scripts/python/doc/help.adoc index 7998756..abc8bf5 100644 --- a/manual/Scripts/python/doc/help.adoc +++ b/manual/Scripts/python/doc/help.adoc @@ -12,7 +12,7 @@ = Пояснительная записка :author: Барановский Константин :email: baranovskiykonstantin@gmail.com -:revnumber: 1.1 +:revnumber: 1.2 Справочное руководство diff --git a/manual/Scripts/python/doc/help.html b/manual/Scripts/python/doc/help.html index 954a433..893edcd 100644 --- a/manual/Scripts/python/doc/help.html +++ b/manual/Scripts/python/doc/help.html @@ -443,7 +443,7 @@

Пояснительная записка

Барановский Константин

-версия 1.1 +версия 1.2
Содержание
@@ -788,8 +788,8 @@

Размер шрифта

diff --git a/spec/Scripts/python/doc/help.adoc b/spec/Scripts/python/doc/help.adoc index 8e3866d..6ccf4f6 100644 --- a/spec/Scripts/python/doc/help.adoc +++ b/spec/Scripts/python/doc/help.adoc @@ -12,7 +12,7 @@ = Спецификация :author: Барановский Константин :email: baranovskiykonstantin@gmail.com -:revnumber: 1.1 +:revnumber: 1.2 Справочное руководство diff --git a/spec/Scripts/python/doc/help.html b/spec/Scripts/python/doc/help.html index 6b435a3..c3e2d75 100644 --- a/spec/Scripts/python/doc/help.html +++ b/spec/Scripts/python/doc/help.html @@ -443,7 +443,7 @@

Спецификация

Барановский Константин

-версия 1.1 +версия 1.2
Содержание
@@ -1550,8 +1550,8 @@

Номера позиций

diff --git a/spec/Scripts/python/pythonpath/schematic.py b/spec/Scripts/python/pythonpath/schematic.py index 399f019..75a0a19 100644 --- a/spec/Scripts/python/pythonpath/schematic.py +++ b/spec/Scripts/python/pythonpath/schematic.py @@ -205,6 +205,8 @@ def getValueWithUnits(self): # Перевести множитель на русский if multiplier in Component.multipliersDict: multiplier = Component.multipliersDict[multiplier] + elif multiplier is None: + multiplier = '' numValue = numValue.replace('.', ',') return numValue + separator + multiplier + units return self.value @@ -363,7 +365,10 @@ def getSpecValue(self, name, singular=False, plural=False): value = self.getFieldValue(fieldName) value = self._convertSingularPlural(value, singular, plural) if name == "name" and not value: - value = self.value + if config.getboolean("spec", "add units"): + value = self.getValueWithUnits() + else: + value = self.value if value is None: value = "" return value @@ -399,7 +404,8 @@ def getExpandedValue(self): 'n': 1e-9, 'н': 1e-9, 'p': 1e-12, - 'п': 1e-12 + 'п': 1e-12, + None: 1 } if self.getRefType().startswith('C'): value = self.value @@ -425,7 +431,7 @@ def getExpandedValue(self): value = value.rstrip('H') value = value.replace("Гн", "") value = value.strip() - if re.match(r"^\d+[\.,]\d+$", value): + if re.match(r"^\d+(?:[\.,]\d+)?$", value): extValue = float(value.replace(',', '.')) * 1e-6 elif re.match(Component.regexpr1, value): searchRes = re.search(Component.regexpr1, value).groups()