News
Home Home Contact us Contact
home News Projects Tests Files Follow manatlan on Twitter Sign in
2008/05/29 07:22

GAE announcing open signups !

Google open its GAE to the public, and announce the prices, but it will stay free under some quotas. It comes with a new images api, a new cache api, developped by the guy of memcached. The so waited, image api is a little poor, it can only do what picasaweb do : crop, resize, transform (rotate/flip), ... as long as it seems to reuse picasaweb api on serverside (and PIL on dev side). No way to combine images, or create some pixels arts ;-(

The only thing which really miss now : it's a cron system. But, like I said in the past, I really see some neat entries in the yaml config to be a able to cron a script.

Google make a big jump in the web cloud computing. And brings python to the lights. Big news !

Comments (View) Tags: gae
2008/05/23 21:15

It takes forms

My newly website takes forms. A lot of new features are in place (rss by tags, kind of wiki to edit pages ...). Sure, I reinvent the wheel since I decided to code all myself : but It lets me dive into GAE and bigtable. It's really amazing how it's easy and quick to code that. But now, I'm pretty sure I will migrate all my web pages here. It will be easier for me !

Sure, there are some details to review. But The last thing I'd like to add, for prime time : it's a simple comment system for posts and pages. It should take 15 minutes ;-)

Thanks Google (for gae), thanks Aaron (for webpy), thanks Guido (for python)

Comments (View)
2008/05/13 07:19

Tricks and tips ...

Another interesting post not from me ;-). Here are some tricks and tips, I store it here, for the future. http://popcnt.org/2008/05/google-app-engine-tips.html

It's going to make 2 weeks without touching GAE. I'll need to upgrade to 1.0.2, and continue my investigations.

Comments (View) Tags: gae
2008/05/05 20:50

Using a Captcha on gae

Just a little post to store this somewhere ... (and why not here ?)

http://daily.profeth.de/2008/04/using-recaptcha-with-google-app-engine.html

Comments (View) Tags: gae
2008/04/29 17:06

Cron my gae account

At this time, cron is not available on GAE. But in the future I see well a new kind of yaml entry which will permit to use a cron system ;-)

Currently, it's possible to make a cron job, by fetching an url of its own account, by using webcron.org. I test it since some days, and it works well with my GAE account. Don't expect to make heavy job, due to gae limitations. But for simple job ; it works well.

Edit 23/05/08 : It seems that webcron has got some real trouble since some days. I found onlinecron which works like a charm.

Comments (View) Tags: gae
2008/04/29 15:51

UtilityMill to do what is impossible to do on GAE

UtilityMill is another powerfull python web based service which allow you to create python web services, by providing a lot of powered python librairies, including PIL !

The interesting thing is that it provides restull api. So it can be possible to do some things which are not available on gae, by using the gae fetch function. It's better than nothing.

This one provides a thumbnailer service. I hadn't done an implementation of this one. But here is a stupid implementation for using the rot13 web service of UtilityMill:

from google.appengine.api import urlfetch
from xml.etree import ElementTree
import urllib

def getRot13(txt):
    service="rot13"
    version=13
    url="http://utilitymill.com/api/xml/utility/%s/%d/run?textIn=%s" % (
                service, version, urllib.quote_plus(txt) )

    result = urlfetch.fetch(url)
    if result.status_code==200:
        dom=ElementTree.fromstring(result.content)
        return dom.find("output").text
    else:
        return None

print getRot13("Hello from rot13 !")

Comments (View) Tags: gae
2008/04/22 16:28

ZipMe : Download sources of your GAE website, as a zip file

This is just a simple app script, called "zipme", you must put into your account, at the root of the folder. Just add this lines in your app.yaml :

- url: /zipme
  script: zipme.py

And with your favorite browser, go to your gae account http:// your_host/zipme, and it will download all your source in a zip file. Of course, you'll need to be logged in as an admin, to be able to get the download.

This source is released in the Public domain :

#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
##########################################################################
ZipMe : GAE Content Downloader
##########################################################################
Just add this lines in your app.yaml :

- url: /zipme
  script: zipme.py

##########################################################################
"""                                                             # manatlan

from google.appengine.ext import webapp
from google.appengine.api import users

import wsgiref.handlers
import zipfile
import os,re,sys,stat
from cStringIO import StringIO

def createZip(path):

    def walktree (top = ".", depthfirst = True):
        names = os.listdir(top)
        if not depthfirst:
            yield top, names
        for name in names:
            try:
                st = os.lstat(os.path.join(top, name))
            except os.error:
                continue
            if stat.S_ISDIR(st.st_mode):
                for (newtop, children) in walktree (os.path.join(top, name),
                                                    depthfirst):
                    yield newtop, children
        if depthfirst:
            yield top, names

    list=[]
    for (basepath, children) in walktree(path,False):
          for child in children:
              f=os.path.join(basepath,child)
              if os.path.isfile(f):
                    f = f.encode(sys.getfilesystemencoding())
                    list.append( f )

    f=StringIO()
    file = zipfile.ZipFile(f, "w")
    for fname in list:
        nfname=os.path.join(os.path.basename(path),fname[len(path)+1:])
        file.write(fname, nfname , zipfile.ZIP_DEFLATED)
    file.close()

    f.seek(0)
    return f


class ZipMaker(webapp.RequestHandler):
    def get(self):
        if users.is_current_user_admin():
            folder = os.path.dirname(__file__)
            self.response.headers['Content-Type'] = 'application/zip'
            self.response.headers['Content-Disposition'] = \
                    'attachment; filename="%s.zip"' % os.path.basename(folder)
            fid=createZip(folder)
            while True:
                buf=fid.read(2048)
                if buf=="": break
                self.response.out.write(buf)
            fid.close()
        else:
            self.response.headers['Content-Type'] = 'text/html'
            self.response.out.write("<a href=\"%s\">You must be admin</a>." %
                                    users.create_login_url("/zipme"))

def main():
    application = webapp.WSGIApplication(
                                       [('/zipme', ZipMaker)],
                                       debug=False)
    wsgiref.handlers.CGIHandler().run(application)

if __name__ == "__main__":
    main()

Note :

  • it seems it's not able to zip static content (which seems to layout somewhere else)

Comments (View) Tags: gae
2008/04/22 11:00

Gae openid sample

Here is an example of a GAE OpenID example, browse the source under trunk :

http://code.google.com/p/google-app-engine-samples/

Comments (View) Tags: gae
newest >>

Tags

RSS Python Powered Get Ubuntu
©opyleft 2008-2019 - manatlan