Adios’ Notes

Adios’ Notes

Adios Tsai  //  

Nov 2 / 10:36pm

Google Wave Robots: Python Tutorial - Google Wave API - Google Code

Robot Versioning

Robots within the Wave API are versioned. This allows the Wave system to detect when robots have changed and/or their capabilities have been altered. If you modify a robot's capabilities (by adding or removing monitored events, for example), you should also modify the version identifier in the Robot's constructor.

When deploying a robot, the Wave system will check if the robot identifer is different than what it has cached. (The robot identifier is simply a text string.) If so, Wave will refresh the robot and alter the system to generate any new events you've indicated interest in.

app.yaml 的 version 是應用程式的版本,每個版本的檔案會被 GAE 給記起來,所以可以輕易回復到之前的版本。

而 robot 的 version 這個參數則是指定 robot 的 capabilities.xml 是否有變更,若你為這個 robot 新增了一些 event handler,對應的 capabilities.xml 也會更新,就要告訴 GAE 你要重新 cache 新的。

Loading mentions Retweet
Filed under  //  gae   google   google wave   python  

Comments (0)

Nov 2 / 7:57am

An Introduction to Python - pass Statements

4.5 pass Statements

The pass statement does nothing. It can be used when a statement is required syntactically but the program requires no action. For example:

    >>> while True:
    ...       pass # Busy-wait for keyboard interrupt
    ... 

I don't like this style...

Loading mentions Retweet
Filed under  //  python  

Comments (0)

Nov 2 / 7:52am

What is __init__.py used for?

Files named __init__.py are used to mark directories on disk as a Python package directories. If you have the files

mydir/spam/__init__.py
mydir/spam/module.py

and mydir is on your path, you can import the code in module.py as:

import spam.module

or

from spam import module

Loading mentions Retweet
Filed under  //  python  

Comments (0)