Drop usage of future and past module

FC Windows distribution doesn't have these modules
This commit is contained in:
Zheng, Lei 2017-11-22 01:13:42 +08:00
parent 5d277485ce
commit 15babab61d
6 changed files with 15 additions and 14 deletions

View File

@ -1,4 +1,3 @@
from future.utils import with_metaclass
from collections import namedtuple
import FreeCAD, FreeCADGui
import asm3
@ -310,7 +309,8 @@ def cstrName(obj):
return '{}<{}>'.format(objName(obj),Constraint.getTypeName(obj))
class Base(with_metaclass(Constraint,object)):
class Base(object):
__metaclass__ = Constraint
_id = -1
_entityDef = ()
_workplane = False

4
gui.py
View File

@ -1,4 +1,3 @@
from future.utils import with_metaclass
from collections import OrderedDict
import FreeCAD, FreeCADGui
import asm3
@ -101,7 +100,8 @@ class AsmCmdManager(ProxyType):
def onClearSelection(cls):
pass
class AsmCmdBase(with_metaclass(AsmCmdManager,object)):
class AsmCmdBase(object):
__metaclass__ = AsmCmdManager
_id = -1
_active = None
_toolbarName = 'Assembly3'

View File

@ -1,4 +1,3 @@
import past.builtins as pb
from collections import namedtuple
from asm3.utils import proxylogger as logger, objName
@ -60,7 +59,7 @@ class ProxyType(type):
@classmethod
def getType(mcs,tp):
if isinstance(tp,pb.basestring):
if isinstance(tp,basestring):
return mcs.getInfo().TypeNameMap[tp]
if not isinstance(tp,int):
tp = mcs.getTypeID(tp)

View File

@ -1,9 +1,9 @@
from future.utils import with_metaclass
from asm3.system import System, SystemBase, SystemExtension
from asm3.utils import syslogger as logger, objName
import asm3.py_slvs.slvs as slvs
class SystemSlvs(with_metaclass(System,SystemBase)):
class SystemSlvs(SystemBase):
__metaclass__ = System
_id = 1
def __init__(self,obj):

View File

@ -1,5 +1,4 @@
from collections import namedtuple
from future.utils import with_metaclass, iteritems
import pprint
from asm3.proxy import ProxyType, PropertyInfo
from asm3.system import System, SystemBase, SystemExtension
@ -25,7 +24,8 @@ def _makeProp(name,doc='',tp='App::PropertyFloat',group=None):
_makeProp('Tolerance','','App::PropertyPrecision','Solver')
class _AlgoBase(with_metaclass(_AlgoType,object)):
class _AlgoBase(object):
__metaclass__ = _AlgoType
_id = -2
_common_options = [_makeProp('maxiter',
'Maximum number of function evaluations','App::PropertyInteger')]
@ -201,7 +201,8 @@ class _Algodogleg(_AlgoNeedHessian):
class _Algotrust_ncg(_Algodogleg):
_id = 10
class SystemSymPy(with_metaclass(System,SystemBase)):
class SystemSymPy(SystemBase):
__metaclass__ = System
_id = 2
def __init__(self,obj):
@ -297,7 +298,8 @@ class _MetaType(type):
return issubclass(cls,_Constraint)
class _MetaBase(with_metaclass(_MetaType,_Base)):
class _MetaBase(_Base):
__metaclass__ = _MetaType
_args = ()
_opts = ()
_vargs = ()

View File

@ -1,5 +1,4 @@
import os
from future.utils import with_metaclass
import asm3.utils as utils
from asm3.utils import syslogger as logger, objName
from asm3.proxy import ProxyType, PropertyInfo
@ -70,7 +69,8 @@ def _makePropInfo(name,tp,doc=''):
_makePropInfo('Verbose','App::PropertyBool')
class SystemBase(with_metaclass(System,object)):
class SystemBase(object):
__metaclass__ = System
_id = 0
_props = ['Verbose']