개정판 11fc81ee
issue #700: license on
Change-Id: Ibc6d73d6b5bd987fe80eea5d97adb5960325640b
DTI_PID/DTI_PID/App.py | ||
---|---|---|
127 | 127 |
else: |
128 | 128 |
qtmodern.styles.darkorange(app) |
129 | 129 |
""" |
130 |
if True:# == QLicenseDialog.check_license_key():
|
|
130 |
if True == QLicenseDialog.check_license_key(): |
|
131 | 131 |
dlg = Ui_Dialog() |
132 | 132 |
selectedProject = dlg.showDialog() |
133 | 133 |
if selectedProject is not None: |
DTI_PID/DTI_PID/CodeTableDialog.py | ||
---|---|---|
491 | 491 |
|
492 | 492 |
def makeAllowable(self, code): |
493 | 493 |
''' make allowable for code ''' |
494 |
return '' |
|
495 | 494 |
from CodeTables import CodeTable |
496 | 495 |
import re |
497 | 496 |
|
498 |
allowable = '' |
|
499 |
for allowables in CodeTable: |
|
500 |
for allowable in allowables: |
|
501 |
remains = [remain for remain in remain if remain != allowable] |
|
502 |
f = '(' + '|'.join(remains) + ')' |
|
503 |
index = [] |
|
504 |
for chars in re.finditer(f, code): |
|
505 |
pass |
|
497 |
founds = [] |
|
498 |
code_ori = code |
|
499 |
for allowables in CodeTable.ALLOWABLES: |
|
500 |
f = '(' + '|'.join(allowables) + ')' |
|
501 |
for chars in re.finditer(f, code): |
|
502 |
founds.append((chars.start(), chars.end(), f)) |
|
503 |
|
|
504 |
founds = sorted(founds, key=lambda param:param[0], reverse=True) |
|
505 |
for found in founds: |
|
506 |
code = code[:found[0]] + found[2] + code[found[0] + 1:] |
|
507 |
|
|
508 |
if code_ori != code: |
|
509 |
return code |
|
510 |
else: |
|
511 |
return '' |
|
506 | 512 |
|
507 | 513 |
''' |
508 | 514 |
@brief cellValueChange event |
DTI_PID/DTI_PID/CodeTables.py | ||
---|---|---|
12 | 12 |
TABLES = {} |
13 | 13 |
DEFAULTS = ['NOMINALDIAMETER', 'FLUIDCODE', 'PIPINGMATERIALSCLASS', 'UNITNUMBER', 'INSULATIONPURPOSE', 'PNIDNUMBER', \ |
14 | 14 |
'VALVEOPERCODES', 'RESERVEDWORDS', 'DICTIONARY', 'EQPTAGNAMES'] |
15 |
ALLOWABLES = [('1', 'I', 'l'), ('0', 'O'), ('8', 'B'), ('2', 'Z')] # must sort long string first ex ('II', '"') |
|
15 |
ALLOWABLES = [('1', 'I', 'l'), ('0', 'O'), ('8', 'B'), ('2', 'Z')] # must sort long string first ex ('II', '"') for multi-chars, now possible single
|
|
16 | 16 |
|
17 | 17 |
def __init__(self, name, values): |
18 | 18 |
self.name = name |
내보내기 Unified diff