~ubuntu-branches/ubuntu/lucid/cloud-init/lucid-updates

« back to all changes in this revision

Viewing changes to doc/examples/part-handler.txt

  • Committer: Bazaar Package Importer
  • Author(s): Scott Moser
  • Date: 2010-02-04 03:00:05 UTC
  • Revision ID: james.westby@ubuntu.com-20100204030005-r2y1568be8rbslxo
Tags: upstream-0.5.3
ImportĀ upstreamĀ versionĀ 0.5.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#part-handler
 
2
# vi: syntax=python ts=4
 
3
 
 
4
def list_types():
 
5
    return(["text/plain", "text/go-cubs-go"])
 
6
 
 
7
def handle_part(data,ctype,filename,payload):
 
8
    if ctype == "__end__" or ctype == "__begin__": return
 
9
 
 
10
    print "==== received ctype=%s filename=%s ====" % (ctype,filename)
 
11
    print payload
 
12
    print "==== end ctype=%s filename=%s" % (ctype, filename)