# Path: nive_cms/app.py
# class WebsitePublisher(AlternateAppPath, ApplicationBase):
# 
# Path: nive_cms/box.py
# class box(PageElementContainerBase):
# 
#     @property
#     def page(self):
#         return self.parent.GetPage()
# 
#     def IsContainer(self):
#         #
#         return True
# 
#     def IsPage(self):
#         #
#         return False
#     
#     def GetPage(self):
#         # return the current element container
#         return self.parent.GetPage()
# 
#     def GetElementContainer(self):
#         # return the current element container
#         return self #.parent
#     
#     def GetContainer(self):
#         # return the current element container
#         return self.parent
# 
# Path: nive_cms/column.py
# class column(PageElementContainerBase):
#     implements(IColumn)
#     
#     @property
#     def page(self):
#         return self.parent
# 
#     def IsLocal(self, page):
#         return self.meta.pool_unitref == page.id
#     
#     def GetName(self):
#         return self.meta["title"]
#     
#     def IsContainer(self):
#         return True
# 
#     def IsPage(self):
#         return False
# 
#     def GetPage(self):
#         return self.parent
# 
#     def GetPages(self):
#         return []
# 
#     def GetElementContainer(self):
#         return self 
# 
#     def GetContainer(self):
#         return self.parent
# 
#     def GetColumn(self, name):
#         if name == self.meta["title"]:
#             return self
#         return self.GetPage().GetColumn(name)
# 
# Path: nive_cms/file.py
# class file(PageElementFileBase):
#     
#     def GetDownloadTitle(self):
#         # title with type and size
#         title = self.meta["title"]
#         f = self.files.get("file")
#         if not f:
#             return title
#         t = f["extension"]
#         s = f["size"]
#         if s:
#             s = FormatBytesForDisplay(s)
#         return u"%s (%s %s)" % (title, t, s)
#     
#      
#     def Init(self):
#         self.ListenEvent("commit", "FilenameToTitle")
# 
#     def FilenameToTitle(self, **kw):
#         if self.files.get("file") and not self.meta["title"]:
#             self.meta["title"] = self.files.get("file")["filename"]
# 
# Path: nive_cms/image.py
# class image(PageElementFileBase):
#     """
#     """
#     # bw 0.9.11
#     def Span(self):
#         # css class span for the css selection
#         if self.data.cssClass=="teaserl":
#             return u"span4"
#         elif self.data.cssClass=="teasers":
#             return u"span2"
#         return u"span3"    
# 
# Path: nive_cms/link.py
# class link(PageElementBase):
#     pass
# 
# Path: nive_cms/media.py
# class media(PageElementFileBase):
#     
#     def IsVideo(self):
#         return self.data.get("player")==u"video"
# 
#     def IsAudio(self):
#         return self.data.get("player")==u"audio"
# 
# Path: nive_cms/menublock.py
# class menublock(PageElementBase):
#     
#     def GetMenuPages(self, **kw):
#         """
#         """
#         menu = self.data.get("menutype")
#         if menu == u"sub":
#             return self.GetPage().GetPages(hidden=0, **kw)
#         elif menu == u"level":
#             p = self.GetPage().parent
#             if not p:
#                 #root
#                 p = self.GetPage()
#             return p.GetPages(hidden=0, **kw)
#         return []
# 
# Path: nive_cms/news.py
# class news(PageElementBase):
#     pass
# 
# Path: nive_cms/note.py
# class note(PageElementBase):
# 
#     titleLen = 20
# 
#     def Init(self):
#         self.ListenEvent("commit", "TextToTitle")
# 
#     def TextToTitle(self, **kw):
#         text = ConvertHTMLToText(self.data.get("textblock"), removeReST=True)
#         self.meta["title"] = CutText(text, self.titleLen, postfix=u"")
#         return True
# 
# Path: nive_cms/page.py
# class page(PageBase):
# 
#     extension = u"html"
# 
#     def IsLinked(self):
#         """
#         returns True if the page is redirected in public mode. 
#         """
#         return self.data["pagelink"]
# 
#     def IsPage(self):
#         return True
# 
# Path: nive_cms/root.py
# class root(PageRootBase):
# 
#     implements(IWebsiteRoot)
#     extension = u"html"
#     
#     def Init(self):
#         self.queryRestraints = {"pool_state": 1}, {}
# 
# Path: nive_cms/spacer.py
# class spacer(PageElementBase):
#     pass
# 
# Path: nive_cms/text.py
# class text(PageElementBase):
#     """
#     basic text class
#     """
#     
#     titleLen = 20
# 
#     def Init(self):
#         self.ListenEvent("commit", "TextToTitle")
# 
# 
#     def TextToTitle(self, **kw):
#         text = ConvertHTMLToText(self.data.get("textblock"), removeReST=True)
#         self.meta["title"] = CutText(text, self.titleLen, postfix=u"")
#         return True
# 
# Path: nive_cms/codeblock.py
# class code(PageElementBase):


import unittest
from nive.helper import FormatConfTestFailure
from nive_cms import app, box, column, file, image, link, media, menublock, news, note, page, root
from nive_cms import spacer, text, codeblock
# -*- coding: utf-8 -*-







class TestConf(unittest.TestCase):

    def setUp(self):
        pass

    def tearDown(self):
        pass

    def test_conf1(self):
        r=app.configuration.test()
        if not r:
            return
        print FormatConfTestFailure(r)
        self.assert_(False, "Configuration Error")


# Path: nive_cms/app.py
# class WebsitePublisher(AlternateAppPath, ApplicationBase):
# 
# Path: nive_cms/box.py
# class box(PageElementContainerBase):
# 
#     @property
#     def page(self):
#         return self.parent.GetPage()
# 
#     def IsContainer(self):
#         #
#         return True
# 
#     def IsPage(self):
#         #
#         return False
#     
#     def GetPage(self):
#         # return the current element container
#         return self.parent.GetPage()
# 
#     def GetElementContainer(self):
#         # return the current element container
#         return self #.parent
#     
#     def GetContainer(self):
#         # return the current element container
#         return self.parent
# 
# Path: nive_cms/column.py
# class column(PageElementContainerBase):
#     implements(IColumn)
#     
#     @property
#     def page(self):
#         return self.parent
# 
#     def IsLocal(self, page):
#         return self.meta.pool_unitref == page.id
#     
#     def GetName(self):
#         return self.meta["title"]
#     
#     def IsContainer(self):
#         return True
# 
#     def IsPage(self):
#         return False
# 
#     def GetPage(self):
#         return self.parent
# 
#     def GetPages(self):
#         return []
# 
#     def GetElementContainer(self):
#         return self 
# 
#     def GetContainer(self):
#         return self.parent
# 
#     def GetColumn(self, name):
#         if name == self.meta["title"]:
#             return self
#         return self.GetPage().GetColumn(name)
# 
# Path: nive_cms/file.py
# class file(PageElementFileBase):
#     
#     def GetDownloadTitle(self):
#         # title with type and size
#         title = self.meta["title"]
#         f = self.files.get("file")
#         if not f:
#             return title
#         t = f["extension"]
#         s = f["size"]
#         if s:
#             s = FormatBytesForDisplay(s)
#         return u"%s (%s %s)" % (title, t, s)
#     
#      
#     def Init(self):
#         self.ListenEvent("commit", "FilenameToTitle")
# 
#     def FilenameToTitle(self, **kw):
#         if self.files.get("file") and not self.meta["title"]:
#             self.meta["title"] = self.files.get("file")["filename"]
# 
# Path: nive_cms/image.py
# class image(PageElementFileBase):
#     """
#     """
#     # bw 0.9.11
#     def Span(self):
#         # css class span for the css selection
#         if self.data.cssClass=="teaserl":
#             return u"span4"
#         elif self.data.cssClass=="teasers":
#             return u"span2"
#         return u"span3"    
# 
# Path: nive_cms/link.py
# class link(PageElementBase):
#     pass
# 
# Path: nive_cms/media.py
# class media(PageElementFileBase):
#     
#     def IsVideo(self):
#         return self.data.get("player")==u"video"
# 
#     def IsAudio(self):
#         return self.data.get("player")==u"audio"
# 
# Path: nive_cms/menublock.py
# class menublock(PageElementBase):
#     
#     def GetMenuPages(self, **kw):
#         """
#         """
#         menu = self.data.get("menutype")
#         if menu == u"sub":
#             return self.GetPage().GetPages(hidden=0, **kw)
#         elif menu == u"level":
#             p = self.GetPage().parent
#             if not p:
#                 #root
#                 p = self.GetPage()
#             return p.GetPages(hidden=0, **kw)
#         return []
# 
# Path: nive_cms/news.py
# class news(PageElementBase):
#     pass
# 
# Path: nive_cms/note.py
# class note(PageElementBase):
# 
#     titleLen = 20
# 
#     def Init(self):
#         self.ListenEvent("commit", "TextToTitle")
# 
#     def TextToTitle(self, **kw):
#         text = ConvertHTMLToText(self.data.get("textblock"), removeReST=True)
#         self.meta["title"] = CutText(text, self.titleLen, postfix=u"")
#         return True
# 
# Path: nive_cms/page.py
# class page(PageBase):
# 
#     extension = u"html"
# 
#     def IsLinked(self):
#         """
#         returns True if the page is redirected in public mode. 
#         """
#         return self.data["pagelink"]
# 
#     def IsPage(self):
#         return True
# 
# Path: nive_cms/root.py
# class root(PageRootBase):
# 
#     implements(IWebsiteRoot)
#     extension = u"html"
#     
#     def Init(self):
#         self.queryRestraints = {"pool_state": 1}, {}
# 
# Path: nive_cms/spacer.py
# class spacer(PageElementBase):
#     pass
# 
# Path: nive_cms/text.py
# class text(PageElementBase):
#     """
#     basic text class
#     """
#     
#     titleLen = 20
# 
#     def Init(self):
#         self.ListenEvent("commit", "TextToTitle")
# 
# 
#     def TextToTitle(self, **kw):
#         text = ConvertHTMLToText(self.data.get("textblock"), removeReST=True)
#         self.meta["title"] = CutText(text, self.titleLen, postfix=u"")
#         return True
# 
# Path: nive_cms/codeblock.py
# class code(PageElementBase):


# Path: nive_cms/tests/test_configuration.py
import unittest
from nive.helper import FormatConfTestFailure
from nive_cms import app, box, column, file, image, link, media, menublock, news, note, page, root
from nive_cms import spacer, text, codeblock

# -*- coding: utf-8 -*-







class TestConf(unittest.TestCase):

    def setUp(self):
        pass

    def tearDown(self):
        pass

    def test_conf1(self):
        r=app.configuration.test()
        if not r:
            return
        print FormatConfTestFailure(r)
        self.assert_(False, "Configuration Error")


    def test_conf3(self):