[LDTP-Dev] [Bug 547091] ooldtp support for ldtpeditor

LDTP (bugzilla.gnome.org) bugzilla-daemon at bugzilla.gnome.org
Tue Aug 12 05:14:19 PDT 2008


If you have any questions why you received this email, please see the text at
the end of this email. Replies to this email are NOT read, please see the text
at the end of this email. You can add comments to this bug at:
  http://bugzilla.gnome.org/show_bug.cgi?id=547091

  LDTP | editor | Ver: 1.2.0




------- Comment #5 from shreyankg at gmail.com  2008-08-12 12:14 UTC -------
(From update of attachment 116417)
diff --git a/python/ChangeLog b/python/ChangeLog
index 4bc36fb..beca898 100644
--- a/python/ChangeLog
+++ b/python/ChangeLog
@@ -1,3 +1,8 @@
+2008-08-12  Shreyank Gupta  <shreyankg at gmail.com>
+
+       * ldtpeditor (LdtpEditorGui): resolved ooldtp issues regarding
+       waittillguiexist() and Generate Data XML
+
 2008-08-10  Shreyank Gupta  <shreyankg at gmail.com>

        * ldtpeditor (LdtpEditorGui): Added code to generate OO LDTP
diff --git a/python/ldtpeditor b/python/ldtpeditor
index 7c49e39..14e92a9 100755
--- a/python/ldtpeditor
+++ b/python/ldtpeditor
@@ -342,11 +342,16 @@ class LdtpEditorGui (gnome.Program):
                             data = code [2][re.search ('\w+', code [2]).start
() : len (code [2]) - 2]
                             lines = '%s\t%s = xmlParser.gettagvalue
(\"%s\")\n' \
                                     % (lines, component, component)
+                            if self.chkGenerateOoldtp == True and line.strip()
!= '' \
+                                    and re.match ('wait\s', line) == None:
+                                lines = '%s\t%s\"%s\", %s [0])\n' \
+                                        % (lines,
ldtplib.libldtpcodegen.objectOrient (code [0]), component, component)
+                            else:
                             lines = '%s\t%s, \"%s\", %s [0])\n' \
                                     % (lines, code [0], component, component) 
                             xml = '%s<%s>%s</%s>\n' % (xml, component,
saxutils.escape (data), component)
                             continue
-                    if self.chkGenerateOoldtp == True and line.strip() != ''
and re.match ('wait', line) == None:
+                    if self.chkGenerateOoldtp == True and line.strip() != ''
and re.match ('wait\s', line) == None:
                         line = ldtplib.libldtpcodegen.objectOrient (line)
                     lines = '%s\t%s\n' % (lines, line)
                 #lines += '\n\tlog (\"test script\", \"pass\")\n'
diff --git a/python/ldtplib/ChangeLog b/python/ldtplib/ChangeLog
index 01136c8..6490aa7 100644
--- a/python/ldtplib/ChangeLog
+++ b/python/ldtplib/ChangeLog
@@ -1,3 +1,7 @@
+2008-08-12  Shreyank Gupta  <shreyankg at gmail.com>
+       * ldtpeditor (LdtpEditorGui): resolved ooldtp issues regarding 
+       real context names
+
 2008-08-10  Shreyank Gupta  <shreyankg at gmail.com>

        * libldtpcodegen.py (objectOrient): Function to generate OO LDTP
diff --git a/python/ldtplib/libldtpcodegen.py
b/python/ldtplib/libldtpcodegen.py
index 5616150..35b61c9 100644
--- a/python/ldtplib/libldtpcodegen.py
+++ b/python/ldtplib/libldtpcodegen.py
@@ -48,7 +48,7 @@ APPHOME = "%s/.ldtp" % os.environ['HOME']
 APPROOT = "/usr/share/ldtp"

 #ooldtp support Global
-context = []
+contextList = []

 # Let us not register our application under at-spi application list
 os.environ ['GTK_MODULES'] = ''
@@ -668,7 +668,6 @@ def getapps ():
 def wildcard (str):
     global appList
     if len (appList) == 0:
-        print "Reading Data from file"
         appList = getapps ()
     for item in appList:
         regex= '\"\S*?%s\S*?\"' % item
@@ -691,24 +690,29 @@ def saveAppList (newAppList):

 #oldtp support specific function... initContext
 def initContext():
-    global context
-    context = []
+    global contextList
+    contextList = []

 #ooldtp support specific function... objectOrient
 def objectOrient (line):
-    global context
+    global contextList
     re1 = re.compile ('\".*?\"')
-    shrink = re1.findall(line)[0]
+    shrink = re1.findall (line)[0]
+    re3 = re.compile ('\W|^\d*')
+    context = re3.sub ('', shrink)
     re2 = re.compile ('\".*?\"\,\s')
+    if re2.search (line) != None:
     parts = re2.split (line, 1)
-    for all in context:
-        if all == shrink:
-            line = 'context%d.%s%s' % (context.index(all), parts[0], parts[1])
+    else:
+        parts = re1.split (line, 1)
+    for all in contextList:
+        if all == context:
+            line = '%s.%s%s' % (context, parts[0], parts[1])
             return line
-    context.append (shrink)
-    last = len(context) - 1
-    line = 'context%d = context(%s)\n\t' % (last, shrink)
-    line = '%scontext%d.%s%s' % (line, last, parts[0], parts[1])
+    contextList.append (context)
+    #last = len(context) - 1
+    line = '%s = context(%s)\n\t' % (context, shrink)
+    line = '%s%s.%s%s' % (line, context, parts[0], parts[1])
     return line

 def callback (guiCallbackFunc, data, timeElapsed = None):


-- 
See http://bugzilla.gnome.org/page.cgi?id=email.html for more info about why you received
this email, why you can't respond via email, how to stop receiving
emails (or reduce the number you receive), and how to contact someone
if you are having problems with the system.

You can add comments to this bug at http://bugzilla.gnome.org/show_bug.cgi?id=547091.


More information about the LDTP-dev mailing list