src/pyams_content/component/theme/__init__.py
changeset 501 3407e6940f6a
parent 240 0eca05146080
child 558 d9c6b1d7fefa
equal deleted inserted replaced
500:cd0c53346edc 501:3407e6940f6a
    42     thesaurus_name = FieldProperty(IThemesManager['thesaurus_name'])
    42     thesaurus_name = FieldProperty(IThemesManager['thesaurus_name'])
    43     extract_name = FieldProperty(IThemesManager['extract_name'])
    43     extract_name = FieldProperty(IThemesManager['extract_name'])
    44 
    44 
    45 
    45 
    46 @adapter_config(context=IThemesManagerTarget, provides=IThemesManager)
    46 @adapter_config(context=IThemesManagerTarget, provides=IThemesManager)
    47 def ThemesManagerFactory(target):
    47 def themes_manager_factory(target):
    48     """Themes manager factory"""
    48     """Themes manager factory"""
    49     annotations = IAnnotations(target)
    49     annotations = IAnnotations(target)
    50     manager = annotations.get(THEMES_MANAGER_KEY)
    50     manager = annotations.get(THEMES_MANAGER_KEY)
    51     if manager is None:
    51     if manager is None:
    52         manager = annotations[THEMES_MANAGER_KEY] = ThemesManager()
    52         manager = annotations[THEMES_MANAGER_KEY] = ThemesManager()
    61 
    61 
    62     themes = FieldProperty(IThemesInfo['themes'])
    62     themes = FieldProperty(IThemesInfo['themes'])
    63 
    63 
    64 
    64 
    65 @adapter_config(context=IThemesTarget, provides=IThemesInfo)
    65 @adapter_config(context=IThemesTarget, provides=IThemesInfo)
    66 def ThemesInfoFactory(target):
    66 def themes_info_factory(target):
    67     """Themes info factory"""
    67     """Themes info factory"""
    68     annotations = IAnnotations(target)
    68     annotations = IAnnotations(target)
    69     info = annotations.get(THEMES_INFO_KEY)
    69     info = annotations.get(THEMES_INFO_KEY)
    70     if info is None:
    70     if info is None:
    71         info = annotations[THEMES_INFO_KEY] = ThemesInfo()
    71         info = annotations[THEMES_INFO_KEY] = ThemesInfo()