~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to services/serveservice

  • Committer: William Grant
  • Date: 2009-02-17 00:27:47 UTC
  • mto: (1099.1.143 new-dispatch)
  • mto: This revision was merged to the branch mainline in revision 1100.
  • Revision ID: grantw@unimelb.edu.au-20090217002747-ne1it7ht7kczonoq
Make serveservice return types and possibly filenames as well.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
import os
24
24
import sys
25
25
import StringIO
26
 
import urlparse
27
26
from optparse import OptionParser
28
27
 
29
28
import cjson
128
127
    zipfile = StringIO.StringIO()
129
128
    zipmod.make_zip(zipbasepath, paths, zipfile)
130
129
        
131
 
    print cjson.encode({'content': zipfile.getvalue(), 'type': zip_mimetype})
 
130
    print cjson.encode({'content': zipfile.getvalue(),
 
131
                        'type': zip_mimetype,
 
132
                        'name': zipfilename})
132
133
else:
133
 
    print cjson.encode({'content': open(filename).read()})
 
134
    print cjson.encode({'content': open(filename).read(),
 
135
                        'type': determine_file_type(filename)})