Diff for /zogiLib/zogiLib.py between versions 1.29 and 1.30

version 1.29, 2004/06/22 17:09:13 version 1.30, 2004/06/25 16:59:45
Line 15  import urllib Line 15  import urllib
 import types  import types
 from Globals import package_home  from Globals import package_home
   
 ZOGIVERSION = "0.9.4 ROC:22.6.2004"  ZOGIVERSION = "0.9.5 ROC:25.6.2004"
   
   def cropf(f):
       """returns a float with reduced precision"""
       return float(int(f * 10000)/10000.0)
   
   
 def sendFile(self, filename, type):  def sendFile(self, filename, type):
     """sends an object or a local file (in the product) as response"""      """sends an object or a local file (in the product) as response"""
Line 57  def browserCheck(self): Line 62  def browserCheck(self):
   
     return bt      return bt
   
 def manage_addZogiLibMainTemplateForm(self):  
     """Form for adding"""  
     #FIXME:???  
     pt=PageTemplateFile(os.path.join(package_home(globals()), 'zpt/AddOSAS_thumbTemplate.zpt')).__of__(self)  
     return pt()  
   
   
   
   
 def manage_addZogiLibMainTemplate(self, id,title=None, text=None,  
                            REQUEST=None, submit=None):  
     "Add a Page Template with optional file content."  
     #FIXME:???  
     id = str(id)  
     if REQUEST is None:  
         self._setObject(id, zogiLib_mainTemplate(id, text))  
         ob = getattr(self, id)  
          
         if title:  
             ob.pt_setTitle(title)  
         return ob  
     else:  
         file = REQUEST.form.get('file')  
         headers = getattr(file, 'headers', None)  
         if headers is None or not file.filename:  
             zpt = zogiLib_mainTemplate(id)  
         else:  
             zpt = zogiLib_mainTemplate(id, file, headers.get('content_type'))  
   
         self._setObject(id, zpt)  
         ob = getattr(self, id)  
   
   
         try:  
             u = self.DestinationURL()  
         except AttributeError:  
             u = REQUEST['URL1']  
   
         if submit == " Add and Edit ":  
             u = "%s/%s" % (u, quote(id))  
         REQUEST.RESPONSE.redirect(u+'/manage_main')  
     return ''  
   
           
 class zogiImage(Image):  class zogiImage(Image):
     """einzelnes Image"""      """einzelnes Image"""
Line 756  class zogiLib(Folder): Line 718  class zogiLib(Folder):
             self.REQUEST.RESPONSE.redirect(self.REQUEST['URL1']+'?'+params)              self.REQUEST.RESPONSE.redirect(self.REQUEST['URL1']+'?'+params)
   
   
       def getDLTarget(self):
           """returns dlTarget"""
           self.checkQuery()
           s = self.dlTarget
   #         s = 'dl'
   #         if self.getDLParam('fn'):
   #             s += "_" + self.getDLParam('fn')
   #         if self.getDLParam('pn'):
   #             s += "_" + self.getDLParam('pn')
           return s
   
     def setStaticHTML(self, static=True):      def setStaticHTML(self, static=True):
         """sets the preference to static HTML"""          """sets the preference to static HTML"""
         self.checkQuery()          self.checkQuery()
Line 883  class zogiLib(Folder): Line 856  class zogiLib(Folder):
         wh2 = max(min(wh2, 1), 0)          wh2 = max(min(wh2, 1), 0)
         wx = max(min(wx, 1), 0)          wx = max(min(wx, 1), 0)
         wy = max(min(wy, 1), 0)          wy = max(min(wy, 1), 0)
         self.setDLParam('ww', ww2)          self.setDLParam('ww', cropf(ww2))
         self.setDLParam('wh', wh2)          self.setDLParam('wh', cropf(wh2))
         self.setDLParam('wx', wx)          self.setDLParam('wx', cropf(wx))
         self.setDLParam('wy', wy)          self.setDLParam('wy', cropf(wy))
         return self.display()          return self.display()
                   
     def dl_ZoomIn(self):      def dl_ZoomIn(self):
Line 909  class zogiLib(Folder): Line 882  class zogiLib(Folder):
         wy += dy * 0.5 * wh          wy += dy * 0.5 * wh
         wx = max(min(wx, 1), 0)          wx = max(min(wx, 1), 0)
         wy = max(min(wy, 1), 0)          wy = max(min(wy, 1), 0)
         self.setDLParam('wx', wx)          self.setDLParam('wx', cropf(wx))
         self.setDLParam('wy', wy)          self.setDLParam('wy', cropf(wy))
         return self.display()          return self.display()
                   
     def dl_MoveLeft(self):      def dl_MoveLeft(self):

Removed from v.1.29  
changed lines
  Added in v.1.30


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>