Beispiel #1
0
    def __call__ (self):
        tarball_refs = Downloads.get_latest_tarball()
        tar_local, tar_web = tarball_refs

        # Automatic
        content = CTK.Container()
        content += CTK.RawHTML ("<h3>%s</h3>" %(_("Option 1: Automatic installation")))

        box  = CTK.Box()
        box += CTK.RawHTML ('<p>%s</p>' %(_('Open a terminal and enter:')))
        box += CTK.RawHTML ('<pre class="terminal">wget http://cherokee-project.com/install && python install</pre>')
        box += CTK.RawHTML ('<p>%s</p>' %(_('or')))
        box += CTK.RawHTML ('<pre class="terminal">curl -LO http://cherokee-project.com/install && python install</pre>')
        box += CTK.RawHTML ('<p>%s</p>' %(_('This will download and install Cherokee under /opt/cherokee')))
        content += box

        # By hand
        content += CTK.RawHTML ("<h3>%s</h2>" %(_("Option 2: Compile it by hand")))

        sources  = CTK.Box()
        sources += CTK.RawHTML ('%s '%(_("Download")))
        sources += CTK.Link (tar_web, CTK.RawHTML (_("latest source code package")))
        sources += CTK.RawHTML (', and install it by hand doing the <i>./configure, make, make install</i> dance.')
        sources += CTK.RawHTML ('<pre class="terminal">configure --prefix=/usr --localstatedir=/var --sysconfdir=/etc<br/>make && sudo make install</pre>')
        sources += CTK.RawHTML ('Older releases are also available at our <a href="/download/">Downloads archive</a>.')

        content += sources

        return CTK.HTTP_Cacheable (60, body=content.Render().toStr())
Beispiel #2
0
    def __call__ (self):
        # Find the DMG file
        dmg_refs = Downloads.get_latest_macosx_dmg()
        # no macos package found
        if not dmg_refs:
            content = CTK.Container()
            content += CTK.RawHTML ("<h3>%s</h3>" %(_("We can't find now packaged version...")))
            content += CTK.RawHTML ("<p>%s</p>" %(_("We recommend to use git and compile cherokee.")))
            return CTK.HTTP_Cacheable (60, body = content.Render().toStr())
        dmg_local, dmg_web = dmg_refs
        dmg_url = "http://www.cherokee-project.com%s"%(dmg_web)

        if os.path.exists (dmg_local):
            mbs = os.path.getsize (dmg_local) / (1024**2)
        else:
            mbs = 0
        ver = re.findall (r'(\d+\.\d+\.\d+)', dmg_web)[0]

        download_button = CTK.Button ('Get Cherokee %s DMG'%(ver)) # — %sMb'%(mbs))
        download_button.bind ('click', CTK.DruidContent__JS_to_goto (download_button.id, URL_MACOSX_2))

        content = CTK.Container()
        content += CTK.RawHTML ('<h3>Binary Package</h3>')
        content += CTK.RawHTML ('<p>%s</p>'%(_("A binary package for MacOS X (Intel) is available for download: %sMb"%(mbs))))
        content += download_button

        return CTK.HTTP_Cacheable (60, body=content.Render().toStr())
Beispiel #3
0
    def __call__ (self):
        tarball_refs = Downloads.get_latest_tarball()
        tar_local, tar_web = tarball_refs

        # Automatic
        content = CTK.Container()
        content += CTK.RawHTML ("<h3>%s</h3>" %(_("Option 1: Automatic installation")))

        box  = CTK.Box()
        box += CTK.RawHTML ('<p>%s</p>' %(_('Open a terminal and enter:')))
        box += CTK.RawHTML ('<pre class="terminal">wget http://cherokee-project.com/install && python install</pre>')
        box += CTK.RawHTML ('<p>%s</p>' %(_('or')))
        box += CTK.RawHTML ('<pre class="terminal">curl -LO http://cherokee-project.com/install && python install</pre>')
        box += CTK.RawHTML ('<p>%s</p>' %(_('This will download and install Cherokee under /opt/cherokee')))
        content += box

        # By hand
        content += CTK.RawHTML ("<h3>%s</h2>" %(_("Option 2: Compile it by hand")))

        sources  = CTK.Box()
        sources += CTK.RawHTML ('%s '%(_("Download")))
        sources += CTK.Link (tar_web, CTK.RawHTML (_("latest source code package")))
        sources += CTK.RawHTML (', and install it by hand doing the <i>./configure, make, make install</i> dance.')
        sources += CTK.RawHTML ('<pre class="terminal">configure --prefix=/usr --localstatedir=/var --sysconfdir=/etc<br/>make && sudo make install</pre>')
        sources += CTK.RawHTML ('Older releases are also available at our <a href="/download/">Downloads archive</a>.')

        content += sources

        return CTK.HTTP_Cacheable (60, body=content.Render().toStr())
Beispiel #4
0
    def __call__ (self):
        # Find the DMG file
        dmg_refs = Downloads.get_latest_macosx_dmg()

        # No MacOS package found
        if not dmg_refs:
            content = CTK.Container()
            content += CTK.RawHTML ("<h3>%s</h3>" %(_("Could not find the MacOS X package")))
            content += CTK.RawHTML ("<p>%s</p>" %(_("It seems that the MacOS X package for the latest version has not been compiled yet.")))
            content += CTK.RawHTML ("<p>%s</p>" %(_("Due the circunstances, we encourage you to download the source code and compile it by hand.")))
            return CTK.HTTP_Cacheable (60, body = content.Render().toStr())

        dmg_local, dmg_web = dmg_refs
        dmg_url = "http://www.cherokee-project.com%s"%(dmg_web)

        if os.path.exists (dmg_local):
            mbs = os.path.getsize (dmg_local) / (1024**2)
        else:
            mbs = 0
        ver = re.findall (r'(\d+\.\d+\.\d+)', dmg_web)[0]

        download_button = CTK.Button ('Get Cherokee %s DMG'%(ver)) # — %sMb'%(mbs))
        download_button.bind ('click', CTK.DruidContent__JS_to_goto (download_button.id, URL_MACOSX_2))

        content = CTK.Container()
        content += CTK.RawHTML ('<h3>Binary Package</h3>')
        content += CTK.RawHTML ('<p>%s</p>'%(_("A binary package for MacOS X (Intel) is available for download: %sMb"%(mbs))))
        content += download_button

        return CTK.HTTP_Cacheable (60, body=content.Render().toStr())
Beispiel #5
0
    def __call__ (self):
        # Find the DMG file
        dmg_refs = Downloads.get_latest_macosx_dmg()

        # No MacOS package found
        if not dmg_refs:
            content = CTK.Container()
            content += CTK.RawHTML ("<h3>%s</h3>" %(_("Could not find the MacOS X package")))
            content += CTK.RawHTML ("<p>%s</p>" %(_("It seems that the MacOS X package for the latest version has not been compiled yet.")))
            content += CTK.RawHTML ("<p>%s</p>" %(_("Due the circunstances, we encourage you to download the source code and compile it by hand.")))
            return CTK.HTTP_Cacheable (60, body = content.Render().toStr())

        dmg_local, dmg_web = dmg_refs
        dmg_url = "http://www.cherokee-project.com%s"%(dmg_web)

        if os.path.exists (dmg_local):
            mbs = os.path.getsize (dmg_local) / (1024**2)
        else:
            mbs = 0
        ver = re.findall (r'(\d+\.\d+\.\d+)', dmg_web)[0]

        download_button = CTK.Button ('Get Cherokee %s DMG'%(ver)) # ??? %sMb'%(mbs))
        download_button.bind ('click', CTK.DruidContent__JS_to_goto (download_button.id, URL_MACOSX_2))

        content = CTK.Container()
        content += CTK.RawHTML ('<h3>Binary Package</h3>')
        content += CTK.RawHTML ('<p>%s</p>'%(_("A binary package for MacOS X (Intel) is available for download: %sMb"%(mbs))))
        content += download_button

        return CTK.HTTP_Cacheable (60, body=content.Render().toStr())
Beispiel #6
0
class Sidebox(CTK.Container):
    ELEMENTS = {
        'download': {
            'icon': '/static/images/download.png',
            'url': '/downloads.html',
            'title': 'Download Cherokee %s' % (Downloads.get_latest_version()),
            'hint': 'Fetch the latest version of Cherokee'
        },
        'documentation': {
            'icon': '/static/images/documentation.png',
            'url': '/doc/index.html',
            'title': 'Read the Documentation',
            'hint': 'Tutorials, recipes, etc'
        },
        'contribute': {
            'icon': '/static/images/contribute.png',
            'url': '/contribute.html',
            'title': 'Contribute to the project',
            'hint': 'Help us to develop a better server!'
        }
    }

    class Element(CTK.Container):
        def __init__(self, url, icon, title, hint):
            CTK.Container.__init__(self)
            self += CTK.RawHTML(
                '<img src="%(icon)s" title="%(title)s"><a href="%(url)s">%(title)s</a><br/><span>%(hint)s</span>'
                % (locals()))

    def __init__(self):
        CTK.Container.__init__(self)

        l = CTK.List()
        for k in self.ELEMENTS:
            url = self.ELEMENTS[k]['url']
            icon = self.ELEMENTS[k]['icon']
            title = self.ELEMENTS[k]['title']
            hint = self.ELEMENTS[k]['hint']
            l += self.Element(url, icon, title, hint)

        box = CTK.Box({'id': 'main-links'})
        box += l
        self += box
Beispiel #7
0
    def __call__ (self):
        content = CTK.Box({'id': 'macosx-steps'})
        content += CTK.RawHTML ('<h3>MacOS X (Intel)</h3>')

        # Find the DMG file
        dmg_refs = Downloads.get_latest_macosx_dmg()
        dmg_local, dmg_web = dmg_refs
        dmg_url = "http://www.cherokee-project.com%s"%(dmg_web)
        content += CTK.RawHTML (js='setTimeout(function(){ %s }, 2000);' %(CTK.JS.GotoURL(dmg_url)))

        # Step 1
        box = CTK.Box({'class': 'macosx-step'})
        box += CTK.Image({'src': "/static/images/dmg1.png"})
        box += CTK.RawHTML ('<strong>%s</strong>' %(_("Step 1")))
        box += CTK.RawHTML ('<span>%s</span>' %(_("Save and Open the Cherokee installer")))
        content += box

        # Step 2
        box = CTK.Box({'class': 'macosx-step'})
        box += CTK.Image({'src': "/static/images/dmg2.png"})
        box += CTK.RawHTML ('<strong>%s</strong>' %(_("Step 2")))
        box += CTK.RawHTML ('<span>%s</span>' %(_("Install the package")))
        content += box

        # Step 3
        box = CTK.Box({'class': 'macosx-step'})
        box += CTK.Image({'src': "/static/images/dmg3.png"})
        box += CTK.RawHTML ('<strong>%s</strong>' %(_("Step 3")))
        box += CTK.RawHTML ('<span>%s</span>' %(_("Drag Cherokee Admin to your application folder")))
        content += box

        # Step 4
        box = CTK.Box({'class': 'macosx-step'})
        box += CTK.Image({'src': "/static/images/dmg4.png"})
        box += CTK.RawHTML ('<strong>%s</strong>' %(_("Step 4")))
        box += CTK.RawHTML ('<span>%s</span>' %(_("Open Cherokee Admin")))
        content += box

        return CTK.HTTP_Cacheable (60, body=content.Render().toStr())
Beispiel #8
0
    def __call__ (self):
        content = CTK.Box({'id': 'macosx-steps'})
        content += CTK.RawHTML ('<h3>MacOS X (Intel)</h3>')

        # Find the DMG file
        dmg_refs = Downloads.get_latest_macosx_dmg()
        dmg_local, dmg_web = dmg_refs
        dmg_url = "http://www.cherokee-project.com%s"%(dmg_web)
        content += CTK.RawHTML (js='setTimeout(function(){ %s }, 2000);' %(CTK.JS.GotoURL(dmg_url)))

        # Step 1
        box = CTK.Box({'class': 'macosx-step'})
        box += CTK.Image({'src': "/static/images/dmg1.png"})
        box += CTK.RawHTML ('<strong>%s</strong>' %(_("Step 1")))
        box += CTK.RawHTML ('<span>%s</span>' %(_("Save and Open the Cherokee installer")))
        content += box

        # Step 2
        box = CTK.Box({'class': 'macosx-step'})
        box += CTK.Image({'src': "/static/images/dmg2.png"})
        box += CTK.RawHTML ('<strong>%s</strong>' %(_("Step 2")))
        box += CTK.RawHTML ('<span>%s</span>' %(_("Install the package")))
        content += box

        # Step 3
        box = CTK.Box({'class': 'macosx-step'})
        box += CTK.Image({'src': "/static/images/dmg3.png"})
        box += CTK.RawHTML ('<strong>%s</strong>' %(_("Step 3")))
        box += CTK.RawHTML ('<span>%s</span>' %(_("Drag Cherokee Admin to your application folder")))
        content += box

        # Step 4
        box = CTK.Box({'class': 'macosx-step'})
        box += CTK.Image({'src': "/static/images/dmg4.png"})
        box += CTK.RawHTML ('<strong>%s</strong>' %(_("Step 4")))
        box += CTK.RawHTML ('<span>%s</span>' %(_("Open Cherokee Admin")))
        content += box

        return CTK.HTTP_Cacheable (60, body=content.Render().toStr())
Beispiel #9
0
 def __call__ (self):
     tarball_refs = Downloads.get_latest_tarball()
     tar_local, tar_web = tarball_refs
     return CTK.HTTP_Redir (tar_web)
Beispiel #10
0
def download_ep(epInfo):
    downLoad = Downloads.Download(epInfo)
    downLoad.down_load()
 def __call__(self):
     tarball_refs = Downloads.get_latest_tarball()
     tar_local, tar_web = tarball_refs
     return CTK.HTTP_Redir(tar_web)