logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

EduploneWebdidactics/Extensions Install.py,1.1,1.2: msg#00020

Subject: EduploneWebdidactics/Extensions Install.py,1.1,1.2
Update of /cvsroot/eduplone/EduploneWebdidactics/Extensions
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27590/Extensions

Modified Files:
        Install.py 
Log Message:
reduced Install code, works now


Index: Install.py
===================================================================
RCS file: /cvsroot/eduplone/EduploneWebdidactics/Extensions/Install.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Install.py  20 Jun 2004 10:31:25 -0000      1.1
--- Install.py  20 Jun 2004 11:12:33 -0000      1.2
***************
*** 3,70 ****
  
  This file is an installation script for this skin.  
- It is meant to be used as an External Method.  
- 
- To use, either use Plone 2.0+ to install, or add an external 
- method to the root of the Plone Site that you want the skin registered 
- in with the configuration:
  
!  id: install_skin
!  title: Install Skin *optional*
!  module name: ExampleFileSystemSkin.Install
!  function name: install
! 
! Then go to the management screen for the newly added external method
! and click the 'Try it' tab.  
  """
! 
! from Products.CMFCore.TypesTool import ContentFactoryMetadata
! from Products.CMFCore.DirectoryView import addDirectoryViews
! from Products.CMFCore.utils import getToolByName
! from Products.CMFCore.CMFCorePermissions import ManagePortal
! 
! from cStringIO import StringIO
! import string
! 
! from Products.EduploneWebdidactics import skin_globals
! 
! skin_names = ('EduploneWebdidactics',)
! 
! def setupSkin(self, out):
!     skinsTool = getToolByName(self, 'portal_skins')
!     
!     # Add directory views
!     try:  
!         addDirectoryViews(skinsTool, 'skins', skin_globals)
!         out.write( "Added directory views to portal_skins.\n" )
!     except:
!         out.write( '*** Unable to add directory views to portal_skins.\n')
! 
!     # Go through the skin configurations and insert the skin
!     skins = skinsTool.getSkinSelections()
!     for skin in skins:
!         path = skinsTool.getSkinPath(skin)
!         path = map(string.strip, string.split(path,','))
!         changed = 0
!         for skin_name in skin_names:
!             if skin_name not in path:
!                 try: 
!                     path.insert(path.index('custom')+1, skin_name)
!                     changed = 1
!                 except ValueError:
!                     path.append(skin_name)
!                     changed = 1
! 
!         if changed:        
!             path = string.join(path, ', ')
!             # addSkinSelection will replace existing skins as well.
!             skinsTool.addSkinSelection(skin, path)
!             out.write("Added %s to %s skin\n" % (', '.join(skin_names),skin))
!         else:
!             out.write("Skipping %s skin, %s already set up\n" % (skin, ', 
'.join(skin_names)))
  
  def install(self):
      out=StringIO()
! 
!     setupSkin(self, out)
!     out.write('Installation completed.\n')
      return out.getvalue()
--- 3,17 ----
  
  This file is an installation script for this skin.  
  
! use portal_quickinstaller or plone setup to install
  """
! from Products.Archetypes.Extensions.utils import install_subskin
! from Products.EduploneWebdidactics import product_globals
  
  def install(self):
      out=StringIO()
!     
!     install_subskin(self, out, product_globals)
!     
!     out.write('EduploneWebdidactics skins installation completed.\n')
      return out.getvalue()



-------------------------------------------------------
This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference
Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer
Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA
REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND


<Prev in Thread] Current Thread [Next in Thread>