Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2019
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.56 KB | None | 0 0
  1. >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> traceback >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
  2.  
  3. self = <pyramid.config.actions.ActionState object at 0x7ffb08bc6940>, clear = True
  4. introspector = <pyramid.registry.Introspector object at 0x7ffb08bc6320>
  5.  
  6. def execute_actions(self, clear=True, introspector=None):
  7. """Execute the configuration actions
  8.  
  9. This calls the action callables after resolving conflicts
  10.  
  11. For example:
  12.  
  13. >>> output = []
  14. >>> def f(*a, **k):
  15. ... output.append(('f', a, k))
  16. >>> context = ActionState()
  17. >>> context.actions = [
  18. ... (1, f, (1,)),
  19. ... (1, f, (11,), {}, ('x', )),
  20. ... (2, f, (2,)),
  21. ... ]
  22. >>> context.execute_actions()
  23. >>> output
  24. [('f', (1,), {}), ('f', (2,), {})]
  25.  
  26. If the action raises an error, we convert it to a
  27. ConfigurationExecutionError.
  28.  
  29. >>> output = []
  30. >>> def bad():
  31. ... bad.xxx
  32. >>> context.actions = [
  33. ... (1, f, (1,)),
  34. ... (1, f, (11,), {}, ('x', )),
  35. ... (2, f, (2,)),
  36. ... (3, bad, (), {}, (), 'oops')
  37. ... ]
  38. >>> try:
  39. ... v = context.execute_actions()
  40. ... except ConfigurationExecutionError, v:
  41. ... pass
  42. >>> print(v)
  43. exceptions.AttributeError: 'function' object has no attribute 'xxx'
  44. in:
  45. oops
  46.  
  47. Note that actions executed before the error still have an effect:
  48.  
  49. >>> output
  50. [('f', (1,), {}), ('f', (2,), {})]
  51.  
  52. The execution is re-entrant such that actions may be added by other
  53. actions with the one caveat that the order of any added actions must
  54. be equal to or larger than the current action.
  55.  
  56. >>> output = []
  57. >>> def f(*a, **k):
  58. ... output.append(('f', a, k))
  59. ... context.actions.append((3, g, (8,), {}))
  60. >>> def g(*a, **k):
  61. ... output.append(('g', a, k))
  62. >>> context.actions = [
  63. ... (1, f, (1,)),
  64. ... ]
  65. >>> context.execute_actions()
  66. >>> output
  67. [('f', (1,), {}), ('g', (8,), {})]
  68.  
  69. """
  70. try:
  71. all_actions = []
  72. executed_actions = []
  73. action_iter = iter([])
  74. conflict_state = ConflictResolverState()
  75.  
  76. while True:
  77. # We clear the actions list prior to execution so if there
  78. # are some new actions then we add them to the mix and resolve
  79. # conflicts again. This orders the new actions as well as
  80. # ensures that the previously executed actions have no new
  81. # conflicts.
  82. if self.actions:
  83. all_actions.extend(self.actions)
  84. action_iter = resolveConflicts(
  85. self.actions, state=conflict_state
  86. )
  87. self.actions = []
  88.  
  89. action = next(action_iter, None)
  90. if action is None:
  91. # we are done!
  92. break
  93.  
  94. callable = action['callable']
  95. args = action['args']
  96. kw = action['kw']
  97. info = action['info']
  98. # we use "get" below in case an action was added via a ZCML
  99. # directive that did not know about introspectables
  100. introspectables = action.get('introspectables', ())
  101.  
  102. try:
  103. if callable is not None:
  104. > callable(*args, **kw)
  105.  
  106. .tox/py36/lib/python3.6/site-packages/pyramid/config/actions.py:308:
  107. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  108.  
  109. def register():
  110. directories = []
  111. resolver = AssetResolver(self.package_name)
  112.  
  113. # defer spec resolution until register to allow for asset
  114. # overrides to take place in an earlier config phase
  115. for spec in specs:
  116. # the trailing slash helps match asset overrides for folders
  117. if not spec.endswith('/'):
  118. spec += '/'
  119. asset = resolver.resolve(spec)
  120. directory = asset.abspath()
  121. > if not asset.isdir():
  122.  
  123. .tox/py36/lib/python3.6/site-packages/pyramid/config/i18n.py:102:
  124. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  125.  
  126. self = <pyramid.path.PkgResourcesAssetDescriptor object at 0x7ffb08aca198>
  127.  
  128. def isdir(self):
  129. > return self.pkg_resources.resource_isdir(self.pkg_name, self.path)
  130.  
  131. .tox/py36/lib/python3.6/site-packages/pyramid/path.py:423:
  132. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  133.  
  134. self = <pkg_resources.ResourceManager object at 0x7ffb0f01c208>, package_or_requirement = 'kotti', resource_name = 'locale/'
  135.  
  136. def resource_isdir(self, package_or_requirement, resource_name):
  137. """Is the named resource an existing directory?"""
  138. return get_provider(package_or_requirement).resource_isdir(
  139. > resource_name
  140. )
  141.  
  142. .tox/py36/lib/python3.6/site-packages/pkg_resources/__init__.py:1131:
  143. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  144.  
  145. self = <pkg_resources.NullProvider object at 0x7ffb08aca1d0>, resource_name = 'locale/'
  146.  
  147. def resource_isdir(self, resource_name):
  148. > return self._isdir(self._fn(self.module_path, resource_name))
  149.  
  150. .tox/py36/lib/python3.6/site-packages/pkg_resources/__init__.py:1411:
  151. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  152.  
  153. self = <pkg_resources.NullProvider object at 0x7ffb08aca1d0>
  154. path = '/home/davide/workspaces/bddplay/src/bddplay/.tox/py36/lib/python3.6/site-packages/kotti/locale/'
  155.  
  156. def _isdir(self, path):
  157. raise NotImplementedError(
  158. > "Can't perform this operation for unregistered loader type"
  159. )
  160. E NotImplementedError: Can't perform this operation for unregistered loader type
  161.  
  162. .tox/py36/lib/python3.6/site-packages/pkg_resources/__init__.py:1454: NotImplementedError
  163.  
  164. During handling of the above exception, another exception occurred:
  165.  
  166. unresolved_settings = {'kotti.alembic_dirs': 'kotti:alembic', 'kotti.asset_overrides': '', 'kotti.authn_policy_factory': 'kotti.authtkt_factory', 'kotti.authz_policy_factory': 'kotti.acl_factory', ...}
  167. filedepot = <class 'depot.manager.DepotManager'>
  168.  
  169. @fixture
  170. def setup_app(unresolved_settings, filedepot):
  171. from kotti import base_configure
  172.  
  173. > config = base_configure({}, **unresolved_settings)
  174.  
  175. .tox/py36/lib/python3.6/site-packages/kotti/tests/__init__.py:252:
  176. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  177. .tox/py36/lib/python3.6/site-packages/kotti/__init__.py:240: in base_configure
  178. config.commit()
  179. .tox/py36/lib/python3.6/site-packages/pyramid/config/actions.py:152: in commit
  180. self.action_state.execute_actions(introspector=self.introspector)
  181. .tox/py36/lib/python3.6/site-packages/pyramid/config/actions.py:315: in execute_actions
  182. tb,
  183. .tox/py36/lib/python3.6/site-packages/pyramid/compat.py:178: in reraise
  184. raise value.with_traceback(tb)
  185. .tox/py36/lib/python3.6/site-packages/pyramid/config/actions.py:308: in execute_actions
  186. callable(*args, **kw)
  187. .tox/py36/lib/python3.6/site-packages/pyramid/config/i18n.py:102: in register
  188. if not asset.isdir():
  189. .tox/py36/lib/python3.6/site-packages/pyramid/path.py:423: in isdir
  190. return self.pkg_resources.resource_isdir(self.pkg_name, self.path)
  191. .tox/py36/lib/python3.6/site-packages/pkg_resources/__init__.py:1131: in resource_isdir
  192. resource_name
  193. .tox/py36/lib/python3.6/site-packages/pkg_resources/__init__.py:1411: in resource_isdir
  194. return self._isdir(self._fn(self.module_path, resource_name))
  195. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  196.  
  197. self = <pkg_resources.NullProvider object at 0x7ffb08aca1d0>
  198. path = '/home/davide/workspaces/bddplay/src/bddplay/.tox/py36/lib/python3.6/site-packages/kotti/locale/'
  199.  
  200. def _isdir(self, path):
  201. raise NotImplementedError(
  202. > "Can't perform this operation for unregistered loader type"
  203. )
  204. E pyramid.exceptions.ConfigurationExecutionError: <class 'NotImplementedError'>: Can't perform this operation for unregistered loader type
  205. E in:
  206. E Line 285 of file /home/davide/workspaces/bddplay/src/bddplay/.tox/py36/lib/python3.6/site-packages/kotti/__init__.py:
  207. E config.add_translation_dirs("kotti:locale")
  208.  
  209. .tox/py36/lib/python3.6/site-packages/pkg_resources/__init__.py:1454: ConfigurationExecutionError
  210. >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> entering PDB >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
  211.  
  212. >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> PDB post_mortem >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
  213. > /home/davide/workspaces/bddplay/src/bddplay/.tox/py36/lib/python3.6/site-packages/pkg_resources/__init__.py(1454)_isdir()
  214. -> "Can't perform this operation for unregistered loader type"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement