[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-09-18 21:23:45

Modified files:
	luci           : load_site.py 

Log message:
	more dtml fixes

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

--- conga/luci/load_site.py	2006/09/18 21:11:26	1.12
+++ conga/luci/load_site.py	2006/09/18 21:23:45	1.13
@@ -1,5 +1,5 @@
 #!/usr/bin/python
-# $Id: load_site.py,v 1.12 2006/09/18 21:11:26 rmccabe Exp $
+# $Id: load_site.py,v 1.13 2006/09/18 21:23:45 rmccabe Exp $
 
 ##############################################################################
 #
@@ -354,7 +354,7 @@
 
 def upload_dtml(object, f):
 	dir, name = os.path.split(f)
-	f=open(f)
+	f=open(f, 'rb')
 
 	try:
 		db_id = name.split('.')
@@ -363,9 +363,10 @@
 			db_id = apply(lambda x,y: x + '.' + y, db_id[:-1])
 		name = db_id
 	except: pass
+	contents = f.read()
 
 	try:
-		call(object.manage_addDTMLMethod, id=name, file=f)
+		call(object.manage_addDTMLMethod, id=name, file=contents)
 		if verbose: print 'Uploaded', name
 	except:
 		if verbose: print name, 'exists trying to delete then upload again'
@@ -373,7 +374,7 @@
 			call(object.manage_delObjects, ids=[name])
 			if verbose: print 'Deleted', name
 			try:
-				call(object.manage_addDTMLMethod, id=name, file=f)
+				call(object.manage_addDTMLMethod, id=name, file=contents)
 				if verbose: print 'Uploaded', name
 			except: print 'Unable to upload', name
 		except: print 'Unable to delete', name


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