From b1ff90e0939fff67d456cd72835112d0121cb6d1 Mon Sep 17 00:00:00 2001 From: "Zheng, Lei" Date: Tue, 1 Jan 2019 08:57:01 +0800 Subject: [PATCH] Simplify object name log output --- assembly.py | 2 +- constraint.py | 3 ++- utils.py | 4 +--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/assembly.py b/assembly.py index e2e0e8c..f60a7f8 100644 --- a/assembly.py +++ b/assembly.py @@ -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) diff --git a/constraint.py b/constraint.py index 1427ce2..1777426 100644 --- a/constraint.py +++ b/constraint.py @@ -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)): diff --git a/utils.py b/utils.py index 771567b..47704f1 100644 --- a/utils.py +++ b/utils.py @@ -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 '?'