Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Cherokee: commits

[4210] CTK/trunk: Pass the target directory to the handling function, so dynamic

 

 

Cherokee commits RSS feed   Index | Next | Previous | View Threaded


cherokee at cherokee-project

Feb 8, 2010, 4:45 AM

Post #1 of 1 (92 views)
Permalink
[4210] CTK/trunk: Pass the target directory to the handling function, so dynamic

Revision: 4210
http://svn.cherokee-project.com/changeset/4210
Author: alo
Date: 2010-02-08 13:45:10 +0100 (Mon, 08 Feb 2010)

Log Message:
-----------
Pass the target directory to the handling function, so dynamic
directories can be used as target locations.

Modified Paths:
--------------
CTK/trunk/CTK/Uploader.py
CTK/trunk/tests/test5.py

Modified: CTK/trunk/CTK/Uploader.py
===================================================================
--- CTK/trunk/CTK/Uploader.py 2010-02-08 11:34:26 UTC (rev 4209)
+++ CTK/trunk/CTK/Uploader.py 2010-02-08 12:45:10 UTC (rev 4210)
@@ -93,7 +93,7 @@
MyFieldStorage.target_dir = target_dir
form = MyFieldStorage (fp=scgi.rfile, environ=scgi.env, keep_blank_values=1)

- return handler (form['file'].filename)
+ return handler (form['file'].filename, target_dir)

class Uploader (Widget):
def __init__ (self, props=None):

Modified: CTK/trunk/tests/test5.py
===================================================================
--- CTK/trunk/tests/test5.py 2010-02-08 11:34:26 UTC (rev 4209)
+++ CTK/trunk/tests/test5.py 2010-02-08 12:45:10 UTC (rev 4210)
@@ -3,9 +3,9 @@

UPLOAD_DIR = "/tmp"

-def ok (filename):
+def ok (filename, target_dir):
txt = "<h1>It worked!</h1>"
- txt += "<pre>%s</pre>" %(os.popen("ls -l '%s/%s'"%(UPLOAD_DIR, filename)).read())
+ txt += "<pre>%s</pre>" %(os.popen("ls -l " + os.path.join(target_dir, filename)).read())
return txt

class default:

Cherokee commits RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.