[GRASS-SVN] r61168 - sandbox/krejcmat/src

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Jul 7 07:07:29 PDT 2014


Author: krejcmat
Date: 2014-07-07 07:07:29 -0700 (Mon, 07 Jul 2014)
New Revision: 61168

Modified:
   sandbox/krejcmat/src/editor2.py
Log:
add editor2.py

Modified: sandbox/krejcmat/src/editor2.py
===================================================================
--- sandbox/krejcmat/src/editor2.py	2014-07-07 14:02:43 UTC (rev 61167)
+++ sandbox/krejcmat/src/editor2.py	2014-07-07 14:07:29 UTC (rev 61168)
@@ -1,4 +1,3 @@
-
 import wx 
 from wx import ID_ANY
 from wx import EVT_BUTTON
@@ -8,9 +7,8 @@
 from jinjainfo  import JinjaTemplateInfo as jt
 
 from lxml import etree as ET
-import contextlib
-from audioop import lin2adpcm
 
+
 #===============================================================================
 #EDITOR                               
 #===============================================================================
@@ -252,33 +250,12 @@
         lstruct=self.mdOWSTagStrList
         linfo=self.mdDescription
         
-        #print lstruct
-        #print len (lstruct)
-        #print len (linfo)
         self.c=0
         self.stop=False
         self.max=len(linfo)      ##TODO why -1? :-(
         
-
-        def isMultiLoop():
-            tmp=self.c
-            while '\t' in lstruct[self.c] and self.stop is False:
-                if '\t\t' in lstruct[self.c]:
-                    self.c=tmp
-                    self.stop=False
-                    return True
-                
-                self.plusC()
-                
-            self.c=tmp
-            self.stop=False 
-            return False
-
-         
         def inBox2():
             self.k=0
-            print '-'*30
-            
             loop = lstruct[self.c-1]
             str2=loop.replace(' md.',' self.md.')+':\n'
             str2+='\t' +'self.addBox(linfo[' + str(self.c) + '].inbox)\n'
@@ -307,33 +284,11 @@
                         self.plusC()
                         
                 self.plusC()
-
+            print '--'*80    
             str1+= '\tself.k+=1\n'
             self.executeStr(str1,linfo)
             self.c+=self.k - 1
-         
-            
-        def inBox():
-            self.k=0
-            print '-'*30
-            loop = lstruct[self.c-1]
-            str2=loop.replace(' md.',' self.md.')+':\n'
-            str2+='\tself.addBox(linfo[' + str(self.c) + '].inbox)\n'
 
-            str1=str2
-            while '\t' in lstruct[self.c] and self.stop is False:
-                value= str(self.mdOWSTagStrList[self.c])
-                str1+= '\tself.mdDescription['+str(self.c)+'].value='+str(value)+'\n'
-                str1+= '\tself.idDict[self.currWXid]=' + 'linfo[' + str(self.c) + ']\n'
-                str1+= '\tself.cTmp='+str(self.c)+'\n'                         #save wx id
-                str1+= '\tself.addItem(linfo[' + str(self.c) + '], True)\n'
-                
-                self.plusC()
-
-            str1+= '\tself.k+=1\n'
-            self.executeStr(str1,linfo)
-            self.c+=self.k - 1
-            
         while self.stop is False:
             group=linfo[self.c].group
             if group not in markgroup:          #if group is not created
@@ -341,21 +296,14 @@
                 self.addNotebookPage(linfo[self.c].group)
 
             if '\t' in lstruct[self.c]and self.stop is False:
-                
-                if isMultiLoop():
-                    print '2loops'
                     inBox2()
-                else:
-                    print '1loops'
-                    inBox()
-               
+
             elif not 'for' in str(lstruct[self.c]).split() or 'if' in str(lstruct[self.c]).split():
                     value= 'self.'+str(self.mdOWSTagStrList[self.c]).replace('\n','')
                     addStr='self.mdDescription['+str(self.c)+'].value='+str(value)
                     print '--'*80
                     print addStr
                     self.executeStr(addStr,False)
-                    print '--'*80
                     self.cTmp=self.c
                     self.addItem(linfo[self.c], False)
                     self.plusC()



More information about the grass-commit mailing list