File: __init__.py

package info (click to toggle)
squishdot 1.3.0-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 896 kB
  • ctags: 349
  • sloc: python: 2,313; makefile: 56; sh: 54
file content (66 lines) | stat: -rw-r--r-- 2,536 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
##############################################################################  
#   
# This software is released under the Zope Public License (ZPL) Version 1.0
#
# Copyright (c) Digital Creations.  All rights reserved.  
# Portions Copyright (c) 1999 by Butch Landingin.
# Portions Copyright (c) 2000-2001 by Chris Withers.
#   
##############################################################################  

from Products.Squishdot.Squishdot import SquishSite,__doc__
from Globals import HTMLFile
from ImageFile import ImageFile  

__version__='$Revision: 1.5 $'[11:-2]  
    
# Register the Squishdot Site class
def initialize(context):

        context.registerClass(
            SquishSite,
            meta_type='Squishdot Site',
            constructors = (
                manage_addSquishdotForm,
                manage_addSquishdot
            )
        )            
        
# Load addSquishdotForm from disk
manage_addSquishdotForm = HTMLFile('addSquishdotForm', globals())

# method to construct a Squishdot Site
def manage_addSquishdot(self,id,title='',mailhost='',exp=0,expire='0',     
                              moderated=0, max_itemlist=30, default_doc='',
			mail_articles=0, mail_replies=0, REQUEST=None):     
    """Create Squishdot Site"""     
    if exp:     
        try:    expire=atoi(expire)     
        except: expire=0     
    else:   expire=0     
    if mailhost:     
        try:    v=getattr(self, mailhost)     
        except: return MessageDialog(title='Invalid Mail Host',     
                                     message='Cannot find the named mail host!',     
                                     action=REQUEST['URL1']+'/manage_main'     
                                    )     
    ob=SquishSite(id, title, mailhost, expire, moderated,
				       max_itemlist, default_doc,mail_articles,
				       mail_replies, parent=self)         
    self._setObject(id, ob)     
     
    if REQUEST: return self.manage_main(self,REQUEST,update_menu=1)  

# Load images from disk and make them accessible
misc_={'squishdot_img':  ImageFile('squishdot.gif',globals()),  
       'posting_img':    ImageFile('posting.gif',globals()),  
       'comment_img':    ImageFile('comment.gif',globals()),  
       'squishfile_img': ImageFile('squishfile.gif',globals()),  
       'squishlogo':     ImageFile('squishlogo.gif',globals())  
      }  

# make the mailhost_list method accessible
# does this need to be changed to the new system?
methods={ 'mailhost_list': SquishSite.mailhost_list }