cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
* [Cluster-devel] conga/luci load_site.py
@ 2006-06-19 19:31 rmccabe
  0 siblings, 0 replies; 5+ messages in thread
From: rmccabe @ 2006-06-19 19:31 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	conga
Changes by:	rmccabe at 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)



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Cluster-devel] conga/luci load_site.py
@ 2006-08-11 16:31 rmccabe
  0 siblings, 0 replies; 5+ messages in thread
From: rmccabe @ 2006-08-11 16:31 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	conga
Changes by:	rmccabe at sourceware.org	2006-08-11 16:31:36

Modified files:
	luci           : load_site.py 

Log message:
	update zope/plone paths

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

--- conga/luci/load_site.py	2006/07/24 20:17:01	1.9
+++ conga/luci/load_site.py	2006/08/11 16:31:36	1.10
@@ -1,5 +1,5 @@
 #!/usr/bin/python
-# $Id: load_site.py,v 1.9 2006/07/24 20:17:01 kupcevic Exp $
+# $Id: load_site.py,v 1.10 2006/08/11 16:31:36 rmccabe Exp $
 
 ##############################################################################
 #
@@ -38,14 +38,26 @@
 	'/usr/lib/luci/zope/lib/python/Products',
 	'/usr/lib64/luci/zope/lib/python',
 	'/usr/lib64/luci/zope/lib/python/Products',
+	'/usr/lib64/luci/zope/lib64/python',
+	'/usr/lib64/luci/zope/lib64/python/Products',
 	'/usr/lib64/zope/lib64/python',
-	'/usr/lib64/zope/lib64/python/Products',
 	'/usr/lib64/zope/lib/python',
-	'/usr/lib64/zope/lib/python/Products',
 	'/usr/lib/zope/lib/python',
+	'/usr/lib64/zope/lib/python/Products',
+	'/usr/lib64/zope/lib64/python/Products',
 	'/usr/lib/zope/lib/python/Products'
 ))
 
+from Products import __path__
+for i in ['/usr/lib/luci/zope/lib/python/Products',
+	'/usr/lib64/luci/zope/lib/python/Products',
+	'/usr/lib64/luci/zope/lib64/python/Products',
+	'/usr/lib64/zope/lib/python/Products',
+	'/usr/lib64/zope/lib64/python/Products',
+	'/usr/lib/zope/lib/python/Products']:
+	if os.path.isdir(i):
+		__path__.append(i)
+
 import ZPublisher.Client
 
 def main():



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Cluster-devel] conga/luci load_site.py
@ 2006-09-18 21:11 rmccabe
  0 siblings, 0 replies; 5+ messages in thread
From: rmccabe @ 2006-09-18 21:11 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	conga
Changes by:	rmccabe at sourceware.org	2006-09-18 21:11:26

Modified files:
	luci           : load_site.py 

Log message:
	fix a *.css.dtml naming bug, and support importing controller page templates

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

--- conga/luci/load_site.py	2006/09/15 21:25:37	1.11
+++ conga/luci/load_site.py	2006/09/18 21:11:26	1.12
@@ -1,5 +1,5 @@
 #!/usr/bin/python
-# $Id: load_site.py,v 1.11 2006/09/15 21:25:37 rmccabe Exp $
+# $Id: load_site.py,v 1.12 2006/09/18 21:11:26 rmccabe Exp $
 
 ##############################################################################
 #
@@ -143,11 +143,13 @@
 
 	try:
 		call(object.manage_addFile, id=name, file=open(f,'rb'), content_type=t)
-		if verbose: print 'Uploaded', name
+		if verbose:
+			print 'Uploaded', name
 	except:
-		if verbose: print name, 'exists trying to delete then upload again'
+		if verbose:
+			print name, 'exists trying to delete then upload again'
 		try:
-			call(object.manage_delObjects, ids=name)
+			call(object.manage_delObjects, ids=[name])
 			if verbose: print 'Uploaded', name
 			try:
 				call(object.manage_addFile, id=name, file=open(f,'rb'), content_type=t)
@@ -161,6 +163,29 @@
 def upload_js(object, f):
 	upload_txt(object, f, t='text/javascript')
 
+def upload_cpt(object, f):
+	dir, name = os.path.split(f)
+
+	nobject = object.__class__(object.url+'/manage_addProduct/CMFFormController',
+							username=object.username,
+							password=object.password)
+
+	dbid = name.split('.')[0]
+
+	try:
+		call(nobject.manage_addControllerPageTemplate, id=dbid, file=open(f,'rb'))
+		if verbose: print 'Uploaded', dbid
+	except:
+		if verbose: print name, 'exists trying to delete then upload again'
+		try:
+			call(object.manage_delObjects, ids=[dbid])
+			if verbose: print 'Deleted', dbid
+			try:
+				call(nobject.manage_addControllerPageTemplate, id=dbid, file=open(f,'rb'))
+				if verbose: print 'Uploaded', dbid
+			except: print 'Unable to upload', dbid
+		except: print 'Unable to delete', dbid
+	
 def upload_pt(object, f):
 	dir, name = os.path.split(f)
 
@@ -172,17 +197,17 @@
 
 	try:
 		call(nobject.manage_addPageTemplate, id=dbid, file=open(f,'rb'))
-		if verbose: print 'Uploaded', name
+		if verbose: print 'Uploaded', dbid
 	except:
 		if verbose: print name, 'exists trying to delete then upload again'
 		try:
-			call(object.manage_delObjects, ids=dbid)
-			if verbose: print 'Deleted', name
+			call(object.manage_delObjects, ids=[dbid])
+			if verbose: print 'Deleted', dbid
 			try:
 				call(nobject.manage_addPageTemplate, id=dbid, file=open(f,'rb'))
-				if verbose: print 'Uploaded', name
-			except: print 'Unable to upload', name
-		except: print 'Unable to delete', name
+				if verbose: print 'Uploaded', dbid
+			except: print 'Unable to upload', dbid
+		except: print 'Unable to delete', dbid
 
 from sgmllib import SGMLParser
 
@@ -300,7 +325,7 @@
 	except:
 		if verbose: print name, 'exists trying to delete then upload again'
 		try:
-			call(object.manage_delObjects, ids=name)
+			call(object.manage_delObjects, ids=[name])
 			if verbose: print 'Deleted', name
 			try:
 				call(object.manage_addDTMLDocument, id=name, title=title, file=body)
@@ -335,9 +360,9 @@
 		db_id = name.split('.')
 		db_id_len = len(db_id)
 		if db_id_len > 2 and db_id[db_id_len - 2] != 'dtml':
-			db_id = str.join(db_id[:-1])
-	except:
-		db_id = name
+			db_id = apply(lambda x,y: x + '.' + y, db_id[:-1])
+		name = db_id
+	except: pass
 
 	try:
 		call(object.manage_addDTMLMethod, id=name, file=f)
@@ -345,7 +370,7 @@
 	except:
 		if verbose: print name, 'exists trying to delete then upload again'
 		try:
-			call(object.manage_delObjects, ids=name)
+			call(object.manage_delObjects, ids=[name])
 			if verbose: print 'Deleted', name
 			try:
 				call(object.manage_addDTMLMethod, id=name, file=f)
@@ -362,7 +387,7 @@
 	except:
 		if verbose: print name, 'exists trying to delete then upload again'
 		try:
-			call(object.manage_delObjects, ids=name)
+			call(object.manage_delObjects, ids=[name])
 			if verbose: print 'Deleted', name
 			try:
 				call(object.manage_addImage, id=name, file=open(f,'rb'))



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Cluster-devel] conga/luci load_site.py
@ 2006-09-18 21:23 rmccabe
  0 siblings, 0 replies; 5+ messages in thread
From: rmccabe @ 2006-09-18 21:23 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	conga
Changes by:	rmccabe at 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



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Cluster-devel] conga/luci load_site.py
@ 2008-01-02 21:06 rmccabe
  0 siblings, 0 replies; 5+ messages in thread
From: rmccabe @ 2008-01-02 21:06 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	conga
Changes by:	rmccabe at sourceware.org	2008-01-02 21:06:31

Modified files:
	luci           : load_site.py 

Log message:
	*.vpy and *.cpt files are not properly imported, so skip them

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

--- conga/luci/load_site.py	2007/09/11 16:04:32	1.17
+++ conga/luci/load_site.py	2008/01/02 21:06:31	1.18
@@ -3,7 +3,7 @@
 ##############################################################################
 #
 # Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
-# Copyright (C) 2006-2007 Red Hat, Inc.
+# Copyright (C) 2006-2008 Red Hat, Inc.
 #
 # This software is subject to the provisions of the Zope Public License,
 # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
@@ -173,16 +173,18 @@
 	dbid = name.split('.')[0]
 
 	try:
-		call(nobject.manage_addControllerPythonScript, id=dbid, file=open(f,'rb'))
-		if verbose: print 'Uploaded', dbid
+		raise Exception, 'Not supported'
+		#call(nobject.manage_addControllerPythonScript, id=dbid, file=open(f,'rb'))
+		#if verbose: print 'Uploaded', dbid
 	except:
 		if verbose: print name, 'exists trying to delete then upload again'
 		try:
 			call(object.manage_delObjects, ids=[dbid])
 			if verbose: print 'Deleted', dbid
 			try:
-				call(nobject.manage_addControllerPythonScript, id=dbid, file=open(f,'rb'))
-				if verbose: print 'Uploaded', dbid
+				raise Exception, 'Not supported'
+				#call(nobject.manage_addControllerPythonScript, id=dbid, file=open(f,'rb'))
+				#if verbose: print 'Uploaded', dbid
 			except: print 'Unable to upload', dbid
 		except: print 'Unable to delete', dbid
 
@@ -196,17 +198,20 @@
 	dbid = name.split('.')[0]
 
 	try:
-		call(nobject.manage_addControllerPageTemplate, id=dbid, file=open(f,'rb'))
-		if verbose: print 'Uploaded', dbid
+		raise Exception, 'Not supported'
+		#call(nobject.manage_addControllerPageTemplate, id=dbid, file=open(f,'rb'))
+		#if verbose: print 'Uploaded', dbid
 	except:
 		if verbose: print name, 'exists trying to delete then upload again'
 		try:
 			call(object.manage_delObjects, ids=[dbid])
 			if verbose: print 'Deleted', dbid
 			try:
-				call(nobject.manage_addControllerPageTemplate, id=dbid, file=open(f,'rb'))
-				if verbose: print 'Uploaded', dbid
-			except: print 'Unable to upload', dbid
+				raise Exception, 'Not supported'
+				#call(nobject.manage_addControllerPageTemplate, id=dbid, file=open(f,'rb'))
+				#if verbose: print 'Uploaded', dbid
+			except:
+				print 'Unable to upload', dbid
 		except: print 'Unable to delete', dbid
 
 def upload_pt(object, f):



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-01-02 21:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-18 21:23 [Cluster-devel] conga/luci load_site.py rmccabe
  -- strict thread matches above, loose matches on Subject: below --
2008-01-02 21:06 rmccabe
2006-09-18 21:11 rmccabe
2006-08-11 16:31 rmccabe
2006-06-19 19:31 rmccabe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).