Mailinglist Archive: yast-commit (819 mails)

< Previous Next >
[yast-commit] r54467 - /trunk/libyui-bindings/swig/python/examples/table.py
  • From: kkaempf@xxxxxxxxxxxxxxxx
  • Date: Thu, 08 Jan 2009 13:00:57 -0000
  • Message-id: <E1LKuVN-00030d-B4@xxxxxxxxxxxxxxxx>
Author: kkaempf
Date: Thu Jan 8 14:00:57 2009
New Revision: 54467

URL: http://svn.opensuse.org/viewcvs/yast?rev=54467&view=rev
Log:
testcase for https://bugzilla.novell.com/show_bug.cgi?id=427372

Added:
trunk/libyui-bindings/swig/python/examples/table.py

Added: trunk/libyui-bindings/swig/python/examples/table.py
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/libyui-bindings/swig/python/examples/table.py?rev=54467&view=auto
==============================================================================
--- trunk/libyui-bindings/swig/python/examples/table.py (added)
+++ trunk/libyui-bindings/swig/python/examples/table.py Thu Jan 8 14:00:57 2009
@@ -0,0 +1,57 @@
+#
+# Table example
+# taken from https://bugzilla.novell.com/show_bug.cgi?id=449842#c10
+#
+
+# ensure we're using the latest build, if called from our build environment
+import sys
+sys.path.insert(0,'../../../build/swig/python')
+
+import yui
+
+# enable logging for debug
+log = yui.YUILog.instance()
+log.setLogFileName("debug.log")
+log.enableDebugLogging( True )
+
+factory = yui.YUI.widgetFactory()
+dialog = factory.createMainDialog()
+
+VBox = factory.createVBox(dialog)
+
+yTableHeader = yui.YTableHeader()
+yTableHeader.addColumn("aaaaa")
+yTableHeader.addColumn("bbbbb")
+yTableHeader.addColumn("ccccc")
+yTableHeader.addColumn("ddddd")
+
+myTableMinSize = factory.createMinSize(VBox, 50, 12)
+myTable = factory.createTable(myTableMinSize, yTableHeader)
+
+myOK = factory.createPushButton(VBox, "OK")
+
+# note YItemCollection seems unavailable !
+myItem = yui.YTableItem("X", "foo", "1.2.1", "qwertz")
+myTable.addItem(myItem)
+myItem2 = yui.YTableItem("", "bar", "1.3.1", "asdasdasd")
+myTable.addItem(myItem2)
+
+event1 = dialog.waitForEvent()
+print 1
+myTable.deleteAllItems()
+print 2 #crashes now.
+del myItem
+del myItem2
+print 3 # if not "del" before, crashes here.
+myItem = yui.YTableItem("X3", "foo3", "1.2.13", "qwertz3")
+print 4
+myTable.addItem(myItem)
+print 5
+myItem2 = yui.YTableItem("4", "bar4", "1.3.14", "asdasdasd4")
+print 6
+myTable.addItem(myItem2)
+
+# should already have crashed
+event2 = dialog.waitForEvent()
+dialog.destroy()
+

--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages