497 except AttributeError: |
497 except AttributeError: |
498 # deduce cubes from generic __xxx__ attribute |
498 # deduce cubes from generic __xxx__ attribute |
499 try: |
499 try: |
500 gendeps = getattr(pkginfo, key.replace('_cubes', '')) |
500 gendeps = getattr(pkginfo, key.replace('_cubes', '')) |
501 except AttributeError: |
501 except AttributeError: |
502 # bw compat |
502 deps = {} |
503 if hasattr(pkginfo, oldkey): |
|
504 warn('[3.8] cube %s: %s is deprecated, use %s dict' |
|
505 % (cube, oldkey, key), DeprecationWarning) |
|
506 deps = getattr(pkginfo, oldkey) |
|
507 else: |
|
508 deps = {} |
|
509 else: |
503 else: |
510 deps = dict( (x[len('cubicweb-'):], v) |
504 deps = dict( (x[len('cubicweb-'):], v) |
511 for x, v in gendeps.iteritems() |
505 for x, v in gendeps.iteritems() |
512 if x.startswith('cubicweb-')) |
506 if x.startswith('cubicweb-')) |
513 if not isinstance(deps, dict): |
|
514 deps = dict((key, None) for key in deps) |
|
515 warn('[3.8] cube %s should define %s as a dict' % (cube, key), |
|
516 DeprecationWarning) |
|
517 for depcube in deps: |
507 for depcube in deps: |
518 try: |
508 try: |
519 newname = CW_MIGRATION_MAP[depcube] |
509 newname = CW_MIGRATION_MAP[depcube] |
520 except KeyError: |
510 except KeyError: |
521 pass |
511 pass |