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

« back to all changes in this revision

Viewing changes to services/serveservice

  • Committer: Matt Giuca
  • Date: 2009-04-22 04:56:58 UTC
  • Revision ID: matt.giuca@gmail.com-20090422045658-nnfepg0902n3mwtq
ivle.makeuser: Fixed odd code which would create the home directory, then
    immediately clobber it by restoring the backup.
    This broke in Python 2.6 because the behaviour of shutil.move changed.
    (Commented).

Show diffs side-by-side

added added

removed removed

Lines of Context:
113
113
           determine_file_type(filename) in ivle.conf.app.server.interpreters:
114
114
            throw_error('is-executable', {'path': filename})
115
115
 
116
 
        if (ivle.conf.app.server.blacklist_served_filetypes and \
 
116
        if not download and (
 
117
            (ivle.conf.app.server.blacklist_served_filetypes and \
117
118
                determine_file_type(filename) in \
118
119
                ivle.conf.app.server.served_filetypes_blacklist) or \
119
120
            (ivle.conf.app.server.served_filetypes_whitelist and \
120
121
                determine_file_type(filename) not in \
121
 
                ivle.conf.app.server.served_filetypes_whitelist):
 
122
                ivle.conf.app.server.served_filetypes_whitelist)):
122
123
            throw_error('forbidden')
123
124
 
124
125
if zipmode:
138
139
 
139
140
    print cjson.encode({'type': zip_mimetype,
140
141
                        'name': zipfilename})
141
 
    print zipfile.getvalue()
 
142
 
 
143
    stream = zipfile
 
144
    stream.seek(0)
142
145
else:
 
146
 
143
147
    print cjson.encode({'type': determine_file_type(filename),
144
148
                        'name': os.path.basename(filename)})
145
 
    print open(filename).read()
 
149
    stream = open(filename)
 
150
    
 
151
next = stream.read(1024)
 
152
while next:
 
153
    sys.stdout.write(next)
 
154
    next = stream.read(1024)