[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Cluster-devel] conga/luci load_site.py



CVSROOT:	/cvs/cluster
Module name:	conga
Changes by:	rmccabe sourceware org	2006-06-19 19:31:09

Modified files:
	luci           : load_site.py 

Log message:
	fix uploading/replacing css

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/load_site.py.diff?cvsroot=cluster&r1=1.5&r2=1.6

--- conga/luci/load_site.py	2006/05/24 16:45:04	1.5
+++ conga/luci/load_site.py	2006/06/19 19:31:08	1.6
@@ -1,5 +1,5 @@
 #!/usr/bin/python
-# $Id: load_site.py,v 1.5 2006/05/24 16:45:04 rmccabe Exp $
+# $Id: load_site.py,v 1.6 2006/06/19 19:31:08 rmccabe Exp $
 
 ##############################################################################
 #
@@ -115,11 +115,11 @@
 	for n in os.listdir(f):
 		upload_file(object, os.path.join(f,n))
 
-def upload_txt(object, f):
+def upload_txt(object, f, t='text/plain'):
 	dir, name = os.path.split(f)
 
 	try:
-		call(object.manage_addFile, id=name, file=open(f,'rb'))
+		call(object.manage_addFile, id=name, file=open(f,'rb'), content_type=t)
 		if verbose: print 'Uploaded', name
 	except:
 		if verbose: print name, 'exists trying to delete then upload again'
@@ -127,12 +127,13 @@
 			call(object.manage_delObjects, ids=name)
 			if verbose: print 'Uploaded', name
 			try:
-				call(object.manage_addFile, id=name, file=open(f,'rb'))
+				call(object.manage_addFile, id=name, file=open(f,'rb'), content_type=t)
 				if verbose: print 'Uploaded', name
 			except: print 'Unable to upload', name
 		except: print 'Unable to delete', name
 
-upload_css = upload_txt;
+def upload_css(object, f):
+	upload_txt(object, f, t='text/css')
 
 def upload_pt(object, f):
 	dir, name = os.path.split(f)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]