cubicweb/migration.py
changeset 12752 3cf37ec616ad
parent 12745 cc681b6fcffa
equal deleted inserted replaced
12751:30b205676182 12752:3cf37ec616ad
    21 import os
    21 import os
    22 import string
    22 import string
    23 import logging
    23 import logging
    24 import tempfile
    24 import tempfile
    25 import itertools
    25 import itertools
       
    26 import traceback
    26 from os.path import exists, join, basename, splitext
    27 from os.path import exists, join, basename, splitext
    27 from itertools import chain
    28 from itertools import chain
    28 
    29 
    29 from logilab.common import IGNORED_EXTENSIONS
    30 from logilab.common import IGNORED_EXTENSIONS
    30 from logilab.common.decorators import cached
    31 from logilab.common.decorators import cached
   131         except AttributeError:
   132         except AttributeError:
   132             cmd = 'cmd_%s' % name
   133             cmd = 'cmd_%s' % name
   133             # search self.__class__ to avoid infinite recursion
   134             # search self.__class__ to avoid infinite recursion
   134             if hasattr(self.__class__, cmd):
   135             if hasattr(self.__class__, cmd):
   135                 meth = getattr(self, cmd)
   136                 meth = getattr(self, cmd)
   136                 return lambda *args, **kwargs: self.interact(args, kwargs,
   137                 try:
   137                                                              meth=meth)
   138                     return lambda *args, **kwargs: self.interact(args, kwargs,
       
   139                                                                  meth=meth)
       
   140                 except:
       
   141                     _, ex, traceback_ = sys.exc_info()
       
   142                     traceback.print_exc()
       
   143                     if self.confirm('abort?', pdb=True, traceback=traceback_):
       
   144                         raise
   138             raise
   145             raise
   139         raise AttributeError(name)
   146         raise AttributeError(name)
   140 
   147 
   141     def migrate(self, vcconf, toupgrade, options):
   148     def migrate(self, vcconf, toupgrade, options):
   142         """upgrade the given set of cubes
   149         """upgrade the given set of cubes