Diff for /lise/Extensions/liseScript Kopie.py between versions 1.1 and 1.2

version 1.1, 2004/04/14 16:37:27 version 1.2, 2004/04/23 16:25:09
Line 3  import os Line 3  import os
 def liseScript(mainobj, idclicked="0"):  def liseScript(mainobj, idclicked="0"):
     """ liseScript """      """ liseScript """
                   
           
     pictid = int(idclicked) - 1      pictid = int(idclicked) - 1
     if pictid < 0:      if pictid < 0:
         pictid = 0          pictid = 0
   
     session = mainobj.REQUEST.SESSION      session = mainobj.REQUEST.SESSION
       pagelist = mainobj.pagelist
       pagelistlen = len(pagelist)
   
     openchaplist = session.get("openchaplist", [])      openchaplist = session.get("openchaplist", [])
     newopenchaplist = 0      newopenchaplist = 0
     if len(openchaplist) < 1:      if len(openchaplist) < 1:
         newopenchaplist = 1          newopenchaplist = 1
           for i in pagelist:
               if i.level == 0:
                   openchaplist.append(1)
               else:
                   openchaplist.append(0)
           
 #   openchaplist = []  #   openchaplist = []
 #   newopenchaplist = 1  #   newopenchaplist = 1
           
     pagelist = mainobj.pagelist      pagelist = mainobj.pagelist
     filelist = mainobj.filenames      filelist = mainobj.filenames
       filelistlen = len(filelist)
   #   baseurl = mainobj.baseurl
     filelistindex = 0;      filelistindex = 0;
           
     # fetch the current picture      # fetch the current picture
Line 27  def liseScript(mainobj, idclicked="0"): Line 39  def liseScript(mainobj, idclicked="0"):
         else:          else:
             if IsInt(pagelist[pictid].pictindex):              if IsInt(pagelist[pictid].pictindex):
                 filelistindex = int(pagelist[pictid].pictindex)                  filelistindex = int(pagelist[pictid].pictindex)
                   if filelistindex < filelistlen:
                 pictfile = filelist[filelistindex]                  pictfile = filelist[filelistindex]
             else:              else:
                 pictfile = 'this_is the_no_fucking_picture_error'                      pictfile = 'this_is the_no_fucking_picture_error_from_script_1'
               else:
                   pictfile = 'this_is the_no_fucking_picture_error_from_script_2'
     else:      else:
         if IsInt(pagelist[pictid].pictindex):          if IsInt(pagelist[pictid].pictindex):
             filelistindex = int(pagelist[pictid].pictindex)              filelistindex = int(pagelist[pictid].pictindex)
               if filelistindex < filelistlen:
             pictfile = filelist[filelistindex]              pictfile = filelist[filelistindex]
         else:          else:
             pictfile = 'this_is the_no_fucking_picture_error'                  pictfile = 'this_is the_no_fucking_picture_error_from_script_3'
     mainobj.currpict = pictfile          else:
               pictfile = 'this_is the_no_fucking_picture_error_from_script_4'
       mainobj.currpict = '<img src="' + pictfile + '" border="0">'
   
     thelength = len(pagelist)      thelength = len(pagelist)
     counter = 0      counter = 0
Line 45  def liseScript(mainobj, idclicked="0"): Line 63  def liseScript(mainobj, idclicked="0"):
     # build the list which is used to open / close the chapters      # build the list which is used to open / close the chapters
     if pagelist[pictid].type == 'C':      if pagelist[pictid].type == 'C':
         for i in pagelist:          for i in pagelist:
             if newopenchaplist == 1:              if newopenchaplist == 0:
                 if i.level == 0:  
                     openchaplist.append(1)  
                 else:  
                     openchaplist.append(0)  
             else:  
                 if counter == pictid:                  if counter == pictid:
                     currlevel = pagelist[counter + 1].level                      currlevel = pagelist[counter + 1].level
                     if openchaplist[counter + 1] == 0:                      if openchaplist[counter + 1] == 0:
Line 70  def liseScript(mainobj, idclicked="0"): Line 83  def liseScript(mainobj, idclicked="0"):
   
             counter = counter + 1              counter = counter + 1
                   
   #   return str(counter)
                           
     bid = session.getBrowserIdManager().getBrowserId()      bid = session.getBrowserIdManager().getBrowserId()
     outtext = ""      outtext = "pictnum" + str(pictid) + "<br>" + "pict: " + pagelist[pictid].picturelink + "<br>"
     counter = 0      counter = 0
     for i in pagelist:      for i in pagelist:
         if openchaplist[counter] == 1:          if openchaplist[counter] == 1:

Removed from v.1.1  
changed lines
  Added in v.1.2


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