Simplify object name log output

This commit is contained in:
Zheng, Lei 2019-01-01 08:57:01 +08:00
parent b72cc2c86d
commit b1ff90e093
3 changed files with 4 additions and 5 deletions

View File

@ -358,7 +358,7 @@ class AsmElement(AsmBase):
if not isinstance(link,tuple):
return
if isTypeOf(link[0],AsmPartGroup):
logger.debug('migrate {}'.format(objName(obj)))
logger.debug('migrate {}',objName(obj))
sub = link[1]
dot = sub.find('.')
sobj = link[0].getSubObject(sub[:dot+1],1)

View File

@ -636,7 +636,8 @@ _makeProp('AtEnd','App::PropertyBool',
_ordinal = ('1st', '2nd', '3rd', '4th', '5th', '6th', '7th')
def cstrName(obj):
return '{}<{}>'.format(objName(obj),Constraint.getTypeName(obj))
# return '{}<{}>'.format(objName(obj),Constraint.getTypeName(obj))
return objName(obj)
class Base(with_metaclass(Constraint, object)):

View File

@ -53,9 +53,7 @@ def addIconToFCAD(iconFile,path=None):
def objName(obj):
try:
if obj.Label == obj.Name:
return '"{}#{}"'.format(obj.Document.Name,obj.Name)
return '"{}#{}({})"'.format(obj.Document.Name,obj.Name,obj.Label)
return getattr(obj,'FullName',obj.Name)
except Exception:
return '?'