diff --git a/wxPython/wx/__init__.py b/wxPython/wx/__init__.py new file mode 100644 index 0000000000..4a85ad6143 --- /dev/null +++ b/wxPython/wx/__init__.py @@ -0,0 +1,41 @@ +"""wx package + +Provides a way to drop the wx prefix from wxPython objects.""" + +__author__ = "Patrick K. O'Brien " +__cvsid__ = "$Id$" +__revision__ = "$Revision$"[11:-2] + +from wxPython import wx + +import types + +d_new = globals() +d_old = wx.__dict__ + +for old, obj in d_old.iteritems(): + if type(obj) is types.ModuleType or old.startswith('_'): + # Skip modules and private names. + continue + new = old + if old.startswith('EVT_'): + # Leave name unmodified; add to the new wx namespace. + d_new[new] = obj + elif old.startswith('wxEVT_'): + # Leave name unmodified; add to the new wx namespace. + d_new[new] = obj + else: + if old.startswith('wx'): + # Remove the 'wx' prefix. + new = old[2:] + # Add to the new wx package namespace. + d_new[new] = obj + +del d_new +del d_old +del new +del obj +del old +del types + +del wx diff --git a/wxPython/wx/calendar.py b/wxPython/wx/calendar.py new file mode 100644 index 0000000000..ed4e5bde25 --- /dev/null +++ b/wxPython/wx/calendar.py @@ -0,0 +1,15 @@ +"""Provides a way to drop the wx prefix from wxPython objects.""" + +__author__ = "Patrick K. O'Brien " +__cvsid__ = "$Id$" +__revision__ = "$Revision$"[11:-2] + +import wx +from wx import prefix + +from wxPython import calendar +prefix.rename(d_new=globals(), d_old=calendar.__dict__) +del calendar + +del prefix +del wx diff --git a/wxPython/wx/default.css b/wxPython/wx/default.css new file mode 100644 index 0000000000..7343b12bc9 --- /dev/null +++ b/wxPython/wx/default.css @@ -0,0 +1,208 @@ +/* +:Author: David Goodger +:Contact: goodger@users.sourceforge.net +:date: $Date$ +:version: $Revision$ +:copyright: This stylesheet has been placed in the public domain. + +Default cascading style sheet for the HTML output of Docutils. +*/ + +.first { + margin-top: 0 } + +.last { + margin-bottom: 0 } + +a.toc-backref { + text-decoration: none ; + color: black } + +dd { + margin-bottom: 0.5em } + +div.abstract { + margin: 2em 5em } + +div.abstract p.topic-title { + font-weight: bold ; + text-align: center } + +div.attention, div.caution, div.danger, div.error, div.hint, +div.important, div.note, div.tip, div.warning { + margin: 2em ; + border: medium outset ; + padding: 1em } + +div.attention p.admonition-title, div.caution p.admonition-title, +div.danger p.admonition-title, div.error p.admonition-title, +div.warning p.admonition-title { + color: red ; + font-weight: bold ; + font-family: sans-serif } + +div.hint p.admonition-title, div.important p.admonition-title, +div.note p.admonition-title, div.tip p.admonition-title { + font-weight: bold ; + font-family: sans-serif } + +div.dedication { + margin: 2em 5em ; + text-align: center ; + font-style: italic } + +div.dedication p.topic-title { + font-weight: bold ; + font-style: normal } + +div.figure { + margin-left: 2em } + +div.footer, div.header { + font-size: smaller } + +div.sidebar { + margin-left: 1em ; + border: medium outset ; + padding: 0em 1em ; + background-color: #ffffee ; + width: 40% ; + float: right } + +div.system-messages { + margin: 5em } + +div.system-messages h1 { + color: red } + +div.system-message { + border: medium outset ; + padding: 1em } + +div.system-message p.system-message-title { + color: red ; + font-weight: bold } + +div.topic { + margin: 2em } + +h1.title { + text-align: center } + +h2.subtitle { + text-align: center } + +hr { + width: 75% } + +ol.simple, ul.simple { + margin-bottom: 1em } + +ol.arabic { + list-style: decimal } + +ol.loweralpha { + list-style: lower-alpha } + +ol.upperalpha { + list-style: upper-alpha } + +ol.lowerroman { + list-style: lower-roman } + +ol.upperroman { + list-style: upper-roman } + +p.caption { + font-style: italic } + +p.credits { + font-style: italic ; + font-size: smaller } + +p.label { + white-space: nowrap } + +p.sidebar-title { + font-family: sans-serif ; + font-weight: bold ; + font-size: larger } + +p.sidebar-subtitle { + font-family: sans-serif ; + font-weight: bold } + +p.topic-title { + font-weight: bold } + +pre.address { + margin-bottom: 0 ; + margin-top: 0 ; + font-family: serif ; + font-size: 100% } + +pre.line-block { + font-family: serif ; + font-size: 100% } + +pre.literal-block, pre.doctest-block { + margin-left: 2em ; + margin-right: 2em ; + background-color: #eeeeee } + +span.classifier { + font-family: sans-serif ; + font-style: oblique } + +span.classifier-delimiter { + font-family: sans-serif ; + font-weight: bold } + +span.interpreted { + font-family: sans-serif } + +span.option { + white-space: nowrap } + +span.option-argument { + font-style: italic } + +span.pre { + white-space: pre } + +span.problematic { + color: red } + +table { + margin-top: 0.5em ; + margin-bottom: 0.5em } + +table.citation { + border-left: solid thin gray ; + padding-left: 0.5ex } + +table.docinfo { + margin: 2em 4em } + +table.footnote { + border-left: solid thin black ; + padding-left: 0.5ex } + +td, th { + padding-left: 0.5em ; + padding-right: 0.5em ; + vertical-align: top } + +th.docinfo-name, th.field-name { + font-weight: bold ; + text-align: left ; + white-space: nowrap } + +h1 tt, h2 tt, h3 tt, h4 tt, h5 tt, h6 tt { + font-size: 100% } + +tt { + background-color: #eeeeee } + +ul.auto-toc { + list-style-type: none } diff --git a/wxPython/wx/examples/__init__.py b/wxPython/wx/examples/__init__.py new file mode 100644 index 0000000000..b929a7db76 --- /dev/null +++ b/wxPython/wx/examples/__init__.py @@ -0,0 +1 @@ +# Python package. diff --git a/wxPython/wx/examples/basic/__init__.py b/wxPython/wx/examples/basic/__init__.py new file mode 100644 index 0000000000..b929a7db76 --- /dev/null +++ b/wxPython/wx/examples/basic/__init__.py @@ -0,0 +1 @@ +# Python package. diff --git a/wxPython/wx/examples/basic/app.py b/wxPython/wx/examples/basic/app.py new file mode 100755 index 0000000000..09013ed834 --- /dev/null +++ b/wxPython/wx/examples/basic/app.py @@ -0,0 +1,27 @@ +#!/usr/bin/env python + +"""Basic application class.""" + +__author__ = "Patrick K. O'Brien " +__cvsid__ = "$Id$" +__revision__ = "$Revision$"[11:-2] + +import wx + +from frame import Frame + +class App(wx.App): + """Application class.""" + + def OnInit(self): + self.frame = Frame() + self.frame.Show() + self.SetTopWindow(self.frame) + return True + +def main(): + app = App() + app.MainLoop() + +if __name__ == '__main__': + main() diff --git a/wxPython/wx/examples/basic/frame.py b/wxPython/wx/examples/basic/frame.py new file mode 100755 index 0000000000..3bcecb9f75 --- /dev/null +++ b/wxPython/wx/examples/basic/frame.py @@ -0,0 +1,33 @@ +#!/usr/bin/env python + +"""Basic frame class, with App for testing.""" + +__author__ = "Patrick K. O'Brien " +__cvsid__ = "$Id$" +__revision__ = "$Revision$"[11:-2] + +import wx + +class Frame(wx.Frame): + """Frame class.""" + + def __init__(self, parent=None, id=-1, title='Title', + pos=wx.DefaultPosition, size=(400, 200)): + """Create a Frame instance.""" + wx.Frame.__init__(self, parent, id, title, pos, size) + +class App(wx.App): + """Application class.""" + + def OnInit(self): + self.frame = Frame() + self.frame.Show() + self.SetTopWindow(self.frame) + return True + +def main(): + app = App() + app.MainLoop() + +if __name__ == '__main__': + main() diff --git a/wxPython/wx/examples/default.css b/wxPython/wx/examples/default.css new file mode 100644 index 0000000000..7343b12bc9 --- /dev/null +++ b/wxPython/wx/examples/default.css @@ -0,0 +1,208 @@ +/* +:Author: David Goodger +:Contact: goodger@users.sourceforge.net +:date: $Date$ +:version: $Revision$ +:copyright: This stylesheet has been placed in the public domain. + +Default cascading style sheet for the HTML output of Docutils. +*/ + +.first { + margin-top: 0 } + +.last { + margin-bottom: 0 } + +a.toc-backref { + text-decoration: none ; + color: black } + +dd { + margin-bottom: 0.5em } + +div.abstract { + margin: 2em 5em } + +div.abstract p.topic-title { + font-weight: bold ; + text-align: center } + +div.attention, div.caution, div.danger, div.error, div.hint, +div.important, div.note, div.tip, div.warning { + margin: 2em ; + border: medium outset ; + padding: 1em } + +div.attention p.admonition-title, div.caution p.admonition-title, +div.danger p.admonition-title, div.error p.admonition-title, +div.warning p.admonition-title { + color: red ; + font-weight: bold ; + font-family: sans-serif } + +div.hint p.admonition-title, div.important p.admonition-title, +div.note p.admonition-title, div.tip p.admonition-title { + font-weight: bold ; + font-family: sans-serif } + +div.dedication { + margin: 2em 5em ; + text-align: center ; + font-style: italic } + +div.dedication p.topic-title { + font-weight: bold ; + font-style: normal } + +div.figure { + margin-left: 2em } + +div.footer, div.header { + font-size: smaller } + +div.sidebar { + margin-left: 1em ; + border: medium outset ; + padding: 0em 1em ; + background-color: #ffffee ; + width: 40% ; + float: right } + +div.system-messages { + margin: 5em } + +div.system-messages h1 { + color: red } + +div.system-message { + border: medium outset ; + padding: 1em } + +div.system-message p.system-message-title { + color: red ; + font-weight: bold } + +div.topic { + margin: 2em } + +h1.title { + text-align: center } + +h2.subtitle { + text-align: center } + +hr { + width: 75% } + +ol.simple, ul.simple { + margin-bottom: 1em } + +ol.arabic { + list-style: decimal } + +ol.loweralpha { + list-style: lower-alpha } + +ol.upperalpha { + list-style: upper-alpha } + +ol.lowerroman { + list-style: lower-roman } + +ol.upperroman { + list-style: upper-roman } + +p.caption { + font-style: italic } + +p.credits { + font-style: italic ; + font-size: smaller } + +p.label { + white-space: nowrap } + +p.sidebar-title { + font-family: sans-serif ; + font-weight: bold ; + font-size: larger } + +p.sidebar-subtitle { + font-family: sans-serif ; + font-weight: bold } + +p.topic-title { + font-weight: bold } + +pre.address { + margin-bottom: 0 ; + margin-top: 0 ; + font-family: serif ; + font-size: 100% } + +pre.line-block { + font-family: serif ; + font-size: 100% } + +pre.literal-block, pre.doctest-block { + margin-left: 2em ; + margin-right: 2em ; + background-color: #eeeeee } + +span.classifier { + font-family: sans-serif ; + font-style: oblique } + +span.classifier-delimiter { + font-family: sans-serif ; + font-weight: bold } + +span.interpreted { + font-family: sans-serif } + +span.option { + white-space: nowrap } + +span.option-argument { + font-style: italic } + +span.pre { + white-space: pre } + +span.problematic { + color: red } + +table { + margin-top: 0.5em ; + margin-bottom: 0.5em } + +table.citation { + border-left: solid thin gray ; + padding-left: 0.5ex } + +table.docinfo { + margin: 2em 4em } + +table.footnote { + border-left: solid thin black ; + padding-left: 0.5ex } + +td, th { + padding-left: 0.5em ; + padding-right: 0.5em ; + vertical-align: top } + +th.docinfo-name, th.field-name { + font-weight: bold ; + text-align: left ; + white-space: nowrap } + +h1 tt, h2 tt, h3 tt, h4 tt, h5 tt, h6 tt { + font-size: 100% } + +tt { + background-color: #eeeeee } + +ul.auto-toc { + list-style-type: none } diff --git a/wxPython/wx/examples/examples.html b/wxPython/wx/examples/examples.html new file mode 100644 index 0000000000..e85bb765c6 --- /dev/null +++ b/wxPython/wx/examples/examples.html @@ -0,0 +1,207 @@ + + + + + + +Example Programs Using wxPython + + + + + +
+

Example Programs Using wxPython

+

A survival guide for the post-wx-prefixed world.

+ +++ + + + + + + + + + +
Author:Patrick K. O'Brien
Contact:pobrien@orbtech.com
Date:2003-03-21
Revision:1.1
+ +
+

Introduction

+

If something hits you on the head, don't run around screaming that the +sky is falling. Instead, take a close look and see if it wasn't a +"wx" prefix that hit you. Apparently, they're dropping off wxPython +class names like flies dropping dead in the scorching heat of a +summer's day.

+

Yes, the world is changing, and even our little wxPython world must +change with it. Then again, I'm not fond of pesky summertime flies, +and I'm not too upset that the "wx" prefixes are going to bite the +dust. I think it's for the best. But, being the kind, considerate +person that I am, I decided to write this guide to make the wx +namespace transition easier for everyone, even Chicken Little.

+ +

Rather than simply tell you that everything will be okay, I +decided to show you that everything will be okay. To do that, +I've created a bunch of example programs using the new wx package. I +hope you like them.

+
+
+

Basic

+

It doesn't get much simpler than this. Every wxPython program needs +an application and a frame. To encourage good coding habits, I've +split them into separate modules. They don't do much, but they're a +good starting point.

+

I include a simple App class in the frame module because the PyCrust +"wrapper" utility (wrap.py) only works with modules that contain +an application class. So including a simple one in each of your frame +modules allows you to use the PyCrust runtime wrapper and debug your +frames independent of your full application.

+

Here is the module (frame.py) that defines the frame class:

+
+#!/usr/bin/env python
+
+"""Basic frame class, with App for testing."""
+
+__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
+__cvsid__ = "$Id$"
+__revision__ = "$Revision$"[11:-2]
+
+import wx
+
+class Frame(wx.Frame):
+    """Frame class."""
+
+    def __init__(self, parent=None, id=-1, title='Title',
+                 pos=wx.DefaultPosition, size=(400, 200)):
+        """Create a Frame instance."""
+        wx.Frame.__init__(self, parent, id, title, pos, size)
+
+class App(wx.App):
+    """Application class."""
+
+    def OnInit(self):
+        self.frame = Frame()
+        self.frame.Show()
+        self.SetTopWindow(self.frame)
+        return True
+
+def main():
+    app = App()
+    app.MainLoop()
+
+if __name__ == '__main__':
+    main()
+
+
+

And here is the module (app.py) that defines the application class +and imports the frame from frame.py:

+
+#!/usr/bin/env python
+
+"""Basic application class."""
+
+__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
+__cvsid__ = "$Id$"
+__revision__ = "$Revision$"[11:-2]
+
+import wx
+
+from frame import Frame
+
+class App(wx.App):
+    """Application class."""
+
+    def OnInit(self):
+        self.frame = Frame()
+        self.frame.Show()
+        self.SetTopWindow(self.frame)
+        return True
+
+def main():
+    app = App()
+    app.MainLoop()
+
+if __name__ == '__main__':
+    main()
+
+
+
+
+

Hello

+

This program displays an image file (wxPython.jpg) inside a frame +sized to match the graphic.

+
+

screenshots/hello-win98.png

+

Running hello.py on Windows.

+
+
+

screenshots/hello-linux.png

+

Running hello.py on Linux.

+
+
+

screenshots/hello-mac.png

+

Running hello.py on Mac OS X.

+
+

Here is the source code for hello.py:

+
+#!/usr/bin/env python
+
+"""Hello, wxPython! program."""
+
+__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
+__cvsid__ = "$Id$"
+__revision__ = "$Revision$"[11:-2]
+
+import wx
+
+class Frame(wx.Frame):
+    """Frame class that displays an image."""
+
+    def __init__(self, image, parent=None, id=-1,
+                 pos=wx.DefaultPosition, title='Hello, wxPython!'):
+        """Create a Frame instance and display image."""
+        temp = image.ConvertToBitmap()
+        size = temp.GetWidth(), temp.GetHeight()
+        wx.Frame.__init__(self, parent, id, title, pos, size)
+        self.bmp = wx.StaticBitmap(parent=self, id=-1, bitmap=temp)
+
+class App(wx.App):
+    """Application class."""
+
+    def OnInit(self):
+        wx.InitAllImageHandlers()
+        image = wx.Image('wxPython.jpg', wx.BITMAP_TYPE_JPEG)
+        self.frame = Frame(image)
+        self.frame.Show()
+        self.SetTopWindow(self.frame)
+        return True
+
+def main():
+    app = App()
+    app.MainLoop()
+
+if __name__ == '__main__':
+    main()
+
+
+
+
+ + diff --git a/wxPython/wx/examples/examples.txt b/wxPython/wx/examples/examples.txt new file mode 100644 index 0000000000..7fa50eee2f --- /dev/null +++ b/wxPython/wx/examples/examples.txt @@ -0,0 +1,99 @@ +================================= + Example Programs Using wxPython +================================= + +-------------------------------------------------- + A survival guide for the post-wx-prefixed world. +-------------------------------------------------- + +:Author: Patrick K. O'Brien +:Contact: pobrien@orbtech.com +:Date: $Date$ +:Revision: $Revision$ + +.. contents:: + + +Introduction +============ + +If something hits you on the head, don't run around screaming that the +sky is falling. Instead, take a close look and see if it wasn't a +"wx" prefix that hit you. Apparently, they're dropping off wxPython +class names like flies dropping dead in the scorching heat of a +summer's day. + +Yes, the world is changing, and even our little wxPython world must +change with it. Then again, I'm not fond of pesky summertime flies, +and I'm not too upset that the "wx" prefixes are going to bite the +dust. I think it's for the best. But, being the kind, considerate +person that I am, I decided to write this guide to make the wx +namespace transition easier for everyone, even Chicken Little. + +.. sidebar:: Say what? + + If you have no idea what I mean by the "wx namespace transition," + consider yourself lucky. You can simply use these examples to + learn wxPython in its current state. All you need to know is that + previous wxPython code used a slightly different syntax that some + folks (including me) considered ugly. So we changed it. And + that's when the sky starting falling... + +Rather than simply **tell** you that everything will be okay, I +decided to **show** you that everything will be okay. To do that, +I've created a bunch of example programs using the new wx package. I +hope you like them. + + +Basic +===== + +It doesn't get much simpler than this. Every wxPython program needs +an application and a frame. To encourage good coding habits, I've +split them into separate modules. They don't do much, but they're a +good starting point. + +I include a simple App class in the frame module because the PyCrust +"wrapper" utility (``wrap.py``) only works with modules that contain +an application class. So including a simple one in each of your frame +modules allows you to use the PyCrust runtime wrapper and debug your +frames independent of your full application. + +Here is the module (``frame.py``) that defines the frame class: + +.. include:: basic/frame.py + :literal: + +And here is the module (``app.py``) that defines the application class +and imports the frame from ``frame.py``: + +.. include:: basic/app.py + :literal: + + +Hello +===== + +This program displays an image file (``wxPython.jpg``) inside a frame +sized to match the graphic. + +.. figure:: screenshots/hello-win98.png + :scale: 100 + + Running ``hello.py`` on Windows. + +.. figure:: screenshots/hello-linux.png + :scale: 100 + + Running ``hello.py`` on Linux. + +.. figure:: screenshots/hello-mac.png + :scale: 100 + + Running ``hello.py`` on Mac OS X. + +Here is the source code for ``hello.py``: + +.. include:: hello/hello.py + :literal: + diff --git a/wxPython/wx/examples/hello/__init__.py b/wxPython/wx/examples/hello/__init__.py new file mode 100644 index 0000000000..b929a7db76 --- /dev/null +++ b/wxPython/wx/examples/hello/__init__.py @@ -0,0 +1 @@ +# Python package. diff --git a/wxPython/wx/examples/hello/hello.py b/wxPython/wx/examples/hello/hello.py new file mode 100755 index 0000000000..63a29b5666 --- /dev/null +++ b/wxPython/wx/examples/hello/hello.py @@ -0,0 +1,38 @@ +#!/usr/bin/env python + +"""Hello, wxPython! program.""" + +__author__ = "Patrick K. O'Brien " +__cvsid__ = "$Id$" +__revision__ = "$Revision$"[11:-2] + +import wx + +class Frame(wx.Frame): + """Frame class that displays an image.""" + + def __init__(self, image, parent=None, id=-1, + pos=wx.DefaultPosition, title='Hello, wxPython!'): + """Create a Frame instance and display image.""" + temp = image.ConvertToBitmap() + size = temp.GetWidth(), temp.GetHeight() + wx.Frame.__init__(self, parent, id, title, pos, size) + self.bmp = wx.StaticBitmap(parent=self, id=-1, bitmap=temp) + +class App(wx.App): + """Application class.""" + + def OnInit(self): + wx.InitAllImageHandlers() + image = wx.Image('wxPython.jpg', wx.BITMAP_TYPE_JPEG) + self.frame = Frame(image) + self.frame.Show() + self.SetTopWindow(self.frame) + return True + +def main(): + app = App() + app.MainLoop() + +if __name__ == '__main__': + main() diff --git a/wxPython/wx/examples/hello/wxPython.jpg b/wxPython/wx/examples/hello/wxPython.jpg new file mode 100644 index 0000000000..9770d4e9b8 Binary files /dev/null and b/wxPython/wx/examples/hello/wxPython.jpg differ diff --git a/wxPython/wx/examples/screenshots/hello-linux.png b/wxPython/wx/examples/screenshots/hello-linux.png new file mode 100644 index 0000000000..b67fc8d934 Binary files /dev/null and b/wxPython/wx/examples/screenshots/hello-linux.png differ diff --git a/wxPython/wx/examples/screenshots/hello-mac.png b/wxPython/wx/examples/screenshots/hello-mac.png new file mode 100644 index 0000000000..6511d7612b Binary files /dev/null and b/wxPython/wx/examples/screenshots/hello-mac.png differ diff --git a/wxPython/wx/examples/screenshots/hello-win98.png b/wxPython/wx/examples/screenshots/hello-win98.png new file mode 100644 index 0000000000..ac88aed286 Binary files /dev/null and b/wxPython/wx/examples/screenshots/hello-win98.png differ diff --git a/wxPython/wx/gizmos.py b/wxPython/wx/gizmos.py new file mode 100644 index 0000000000..021355469d --- /dev/null +++ b/wxPython/wx/gizmos.py @@ -0,0 +1,15 @@ +"""Provides a way to drop the wx prefix from wxPython objects.""" + +__author__ = "Patrick K. O'Brien " +__cvsid__ = "$Id$" +__revision__ = "$Revision$"[11:-2] + +import wx +from wx import prefix + +from wxPython import gizmos +prefix.rename(d_new=globals(), d_old=gizmos.__dict__) +del gizmos + +del prefix +del wx diff --git a/wxPython/wx/glcanvas.py b/wxPython/wx/glcanvas.py new file mode 100644 index 0000000000..879a8ed5e4 --- /dev/null +++ b/wxPython/wx/glcanvas.py @@ -0,0 +1,15 @@ +"""Provides a way to drop the wx prefix from wxPython objects.""" + +__author__ = "Patrick K. O'Brien " +__cvsid__ = "$Id$" +__revision__ = "$Revision$"[11:-2] + +import wx +from wx import prefix + +from wxPython import glcanvas +prefix.rename(d_new=globals(), d_old=glcanvas.__dict__) +del glcanvas + +del prefix +del wx diff --git a/wxPython/wx/grid.py b/wxPython/wx/grid.py new file mode 100644 index 0000000000..9a8dc5a3a6 --- /dev/null +++ b/wxPython/wx/grid.py @@ -0,0 +1,15 @@ +"""Provides a way to drop the wx prefix from wxPython objects.""" + +__author__ = "Patrick K. O'Brien " +__cvsid__ = "$Id$" +__revision__ = "$Revision$"[11:-2] + +import wx +from wx import prefix + +from wxPython import grid +prefix.rename(d_new=globals(), d_old=grid.__dict__) +del grid + +del prefix +del wx diff --git a/wxPython/wx/help.py b/wxPython/wx/help.py new file mode 100644 index 0000000000..bb51b119d5 --- /dev/null +++ b/wxPython/wx/help.py @@ -0,0 +1,15 @@ +"""Provides a way to drop the wx prefix from wxPython objects.""" + +__author__ = "Patrick K. O'Brien " +__cvsid__ = "$Id$" +__revision__ = "$Revision$"[11:-2] + +import wx +from wx import prefix + +from wxPython import help +prefix.rename(d_new=globals(), d_old=help.__dict__) +del help + +del prefix +del wx diff --git a/wxPython/wx/html.py b/wxPython/wx/html.py new file mode 100644 index 0000000000..4b56926e59 --- /dev/null +++ b/wxPython/wx/html.py @@ -0,0 +1,15 @@ +"""Provides a way to drop the wx prefix from wxPython objects.""" + +__author__ = "Patrick K. O'Brien " +__cvsid__ = "$Id$" +__revision__ = "$Revision$"[11:-2] + +import wx +from wx import prefix + +from wxPython import html +prefix.rename(d_new=globals(), d_old=html.__dict__) +del html + +del prefix +del wx diff --git a/wxPython/wx/htmlhelp.py b/wxPython/wx/htmlhelp.py new file mode 100644 index 0000000000..1700bd3853 --- /dev/null +++ b/wxPython/wx/htmlhelp.py @@ -0,0 +1,15 @@ +"""Provides a way to drop the wx prefix from wxPython objects.""" + +__author__ = "Patrick K. O'Brien " +__cvsid__ = "$Id$" +__revision__ = "$Revision$"[11:-2] + +import wx +from wx import prefix + +from wxPython import htmlhelp +prefix.rename(d_new=globals(), d_old=htmlhelp.__dict__) +del htmlhelp + +del prefix +del wx diff --git a/wxPython/wx/iewin.py b/wxPython/wx/iewin.py new file mode 100644 index 0000000000..a1ec91aa15 --- /dev/null +++ b/wxPython/wx/iewin.py @@ -0,0 +1,15 @@ +"""Provides a way to drop the wx prefix from wxPython objects.""" + +__author__ = "Patrick K. O'Brien " +__cvsid__ = "$Id$" +__revision__ = "$Revision$"[11:-2] + +import wx +from wx import prefix + +from wxPython import iewin +prefix.rename(d_new=globals(), d_old=iewin.__dict__) +del iewin + +del prefix +del wx diff --git a/wxPython/wx/lib/ClickableHtmlWindow.py b/wxPython/wx/lib/ClickableHtmlWindow.py new file mode 100644 index 0000000000..c6541d6159 --- /dev/null +++ b/wxPython/wx/lib/ClickableHtmlWindow.py @@ -0,0 +1,15 @@ +"""Provides a way to drop the wx prefix from wxPython objects.""" + +__author__ = "Patrick K. O'Brien " +__cvsid__ = "$Id$" +__revision__ = "$Revision$"[11:-2] + +import wx +from wx import prefix + +from wxPython.lib import ClickableHtmlWindow +prefix.rename(d_new=globals(), d_old=ClickableHtmlWindow.__dict__) +del ClickableHtmlWindow + +del prefix +del wx diff --git a/wxPython/wx/lib/ErrorDialogs.py b/wxPython/wx/lib/ErrorDialogs.py new file mode 100644 index 0000000000..2036fa6342 --- /dev/null +++ b/wxPython/wx/lib/ErrorDialogs.py @@ -0,0 +1,15 @@ +"""Provides a way to drop the wx prefix from wxPython objects.""" + +__author__ = "Patrick K. O'Brien " +__cvsid__ = "$Id$" +__revision__ = "$Revision$"[11:-2] + +import wx +from wx import prefix + +from wxPython.lib import ErrorDialogs +prefix.rename(d_new=globals(), d_old=ErrorDialogs.__dict__) +del ErrorDialogs + +del prefix +del wx diff --git a/wxPython/wx/lib/PyCrust/__init__.py b/wxPython/wx/lib/PyCrust/__init__.py new file mode 100644 index 0000000000..b929a7db76 --- /dev/null +++ b/wxPython/wx/lib/PyCrust/__init__.py @@ -0,0 +1 @@ +# Python package. diff --git a/wxPython/wx/lib/__init__.py b/wxPython/wx/lib/__init__.py new file mode 100644 index 0000000000..b929a7db76 --- /dev/null +++ b/wxPython/wx/lib/__init__.py @@ -0,0 +1 @@ +# Python package. diff --git a/wxPython/wx/lib/activexwrapper.py b/wxPython/wx/lib/activexwrapper.py new file mode 100644 index 0000000000..ef3f2cdae1 --- /dev/null +++ b/wxPython/wx/lib/activexwrapper.py @@ -0,0 +1,15 @@ +"""Provides a way to drop the wx prefix from wxPython objects.""" + +__author__ = "Patrick K. O'Brien " +__cvsid__ = "$Id$" +__revision__ = "$Revision$"[11:-2] + +import wx +from wx import prefix + +from wxPython.lib import activexwrapper +prefix.rename(d_new=globals(), d_old=activexwrapper.__dict__) +del activexwrapper + +del prefix +del wx diff --git a/wxPython/wx/lib/anchors.py b/wxPython/wx/lib/anchors.py new file mode 100644 index 0000000000..e020588c2d --- /dev/null +++ b/wxPython/wx/lib/anchors.py @@ -0,0 +1,15 @@ +"""Provides a way to drop the wx prefix from wxPython objects.""" + +__author__ = "Patrick K. O'Brien " +__cvsid__ = "$Id$" +__revision__ = "$Revision$"[11:-2] + +import wx +from wx import prefix + +from wxPython.lib import anchors +prefix.rename(d_new=globals(), d_old=anchors.__dict__) +del anchors + +del prefix +del wx diff --git a/wxPython/wx/lib/buttons.py b/wxPython/wx/lib/buttons.py new file mode 100644 index 0000000000..6dbb1d6e19 --- /dev/null +++ b/wxPython/wx/lib/buttons.py @@ -0,0 +1,15 @@ +"""Provides a way to drop the wx prefix from wxPython objects.""" + +__author__ = "Patrick K. O'Brien " +__cvsid__ = "$Id$" +__revision__ = "$Revision$"[11:-2] + +import wx +from wx import prefix + +from wxPython.lib import buttons +prefix.rename(d_new=globals(), d_old=buttons.__dict__) +del buttons + +del prefix +del wx diff --git a/wxPython/wx/lib/calendar.py b/wxPython/wx/lib/calendar.py new file mode 100644 index 0000000000..57210df97f --- /dev/null +++ b/wxPython/wx/lib/calendar.py @@ -0,0 +1,15 @@ +"""Provides a way to drop the wx prefix from wxPython objects.""" + +__author__ = "Patrick K. O'Brien " +__cvsid__ = "$Id$" +__revision__ = "$Revision$"[11:-2] + +import wx +from wx import prefix + +from wxPython.lib import calendar +prefix.rename(d_new=globals(), d_old=calendar.__dict__) +del calendar + +del prefix +del wx diff --git a/wxPython/wx/lib/colourchooser/__init__.py b/wxPython/wx/lib/colourchooser/__init__.py new file mode 100644 index 0000000000..b929a7db76 --- /dev/null +++ b/wxPython/wx/lib/colourchooser/__init__.py @@ -0,0 +1 @@ +# Python package. diff --git a/wxPython/wx/lib/colourchooser/canvas.py b/wxPython/wx/lib/colourchooser/canvas.py new file mode 100644 index 0000000000..599295beb7 --- /dev/null +++ b/wxPython/wx/lib/colourchooser/canvas.py @@ -0,0 +1,15 @@ +"""Provides a way to drop the wx prefix from wxPython objects.""" + +__author__ = "Patrick K. O'Brien " +__cvsid__ = "$Id$" +__revision__ = "$Revision$"[11:-2] + +import wx +from wx import prefix + +from wxPython.lib.colourchooser import canvas +prefix.rename(d_new=globals(), d_old=canvas.__dict__) +del canvas + +del prefix +del wx diff --git a/wxPython/wx/lib/colourchooser/intl.py b/wxPython/wx/lib/colourchooser/intl.py new file mode 100644 index 0000000000..dd7710a315 --- /dev/null +++ b/wxPython/wx/lib/colourchooser/intl.py @@ -0,0 +1,15 @@ +"""Provides a way to drop the wx prefix from wxPython objects.""" + +__author__ = "Patrick K. O'Brien " +__cvsid__ = "$Id$" +__revision__ = "$Revision$"[11:-2] + +import wx +from wx import prefix + +from wxPython.lib.colourchooser import intl +prefix.rename(d_new=globals(), d_old=intl.__dict__) +del intl + +del prefix +del wx diff --git a/wxPython/wx/lib/colourchooser/pycolourbox.py b/wxPython/wx/lib/colourchooser/pycolourbox.py new file mode 100644 index 0000000000..ca35b71091 --- /dev/null +++ b/wxPython/wx/lib/colourchooser/pycolourbox.py @@ -0,0 +1,15 @@ +"""Provides a way to drop the wx prefix from wxPython objects.""" + +__author__ = "Patrick K. O'Brien " +__cvsid__ = "$Id$" +__revision__ = "$Revision$"[11:-2] + +import wx +from wx import prefix + +from wxPython.lib.colourchooser import pycolourbox +prefix.rename(d_new=globals(), d_old=pycolourbox.__dict__) +del pycolourbox + +del prefix +del wx diff --git a/wxPython/wx/lib/colourchooser/pycolourchooser.py b/wxPython/wx/lib/colourchooser/pycolourchooser.py new file mode 100644 index 0000000000..573fcbec40 --- /dev/null +++ b/wxPython/wx/lib/colourchooser/pycolourchooser.py @@ -0,0 +1,15 @@ +"""Provides a way to drop the wx prefix from wxPython objects.""" + +__author__ = "Patrick K. O'Brien " +__cvsid__ = "$Id$" +__revision__ = "$Revision$"[11:-2] + +import wx +from wx import prefix + +from wxPython.lib.colourchooser import pycolourchooser +prefix.rename(d_new=globals(), d_old=pycolourchooser.__dict__) +del pycolourchooser + +del prefix +del wx diff --git a/wxPython/wx/lib/colourchooser/pycolourslider.py b/wxPython/wx/lib/colourchooser/pycolourslider.py new file mode 100644 index 0000000000..6e8c152bce --- /dev/null +++ b/wxPython/wx/lib/colourchooser/pycolourslider.py @@ -0,0 +1,15 @@ +"""Provides a way to drop the wx prefix from wxPython objects.""" + +__author__ = "Patrick K. O'Brien " +__cvsid__ = "$Id$" +__revision__ = "$Revision$"[11:-2] + +import wx +from wx import prefix + +from wxPython.lib.colourchooser import pycolourslider +prefix.rename(d_new=globals(), d_old=pycolourslider.__dict__) +del pycolourslider + +del prefix +del wx diff --git a/wxPython/wx/lib/colourchooser/pypalette.py b/wxPython/wx/lib/colourchooser/pypalette.py new file mode 100644 index 0000000000..64c0575b99 --- /dev/null +++ b/wxPython/wx/lib/colourchooser/pypalette.py @@ -0,0 +1,15 @@ +"""Provides a way to drop the wx prefix from wxPython objects.""" + +__author__ = "Patrick K. O'Brien " +__cvsid__ = "$Id$" +__revision__ = "$Revision$"[11:-2] + +import wx +from wx import prefix + +from wxPython.lib.colourchooser import pypalette +prefix.rename(d_new=globals(), d_old=pypalette.__dict__) +del pypalette + +del prefix +del wx diff --git a/wxPython/wx/lib/colourdb.py b/wxPython/wx/lib/colourdb.py new file mode 100644 index 0000000000..2de39c6168 --- /dev/null +++ b/wxPython/wx/lib/colourdb.py @@ -0,0 +1,15 @@ +"""Provides a way to drop the wx prefix from wxPython objects.""" + +__author__ = "Patrick K. O'Brien " +__cvsid__ = "$Id$" +__revision__ = "$Revision$"[11:-2] + +import wx +from wx import prefix + +from wxPython.lib import colourdb +prefix.rename(d_new=globals(), d_old=colourdb.__dict__) +del colourdb + +del prefix +del wx diff --git a/wxPython/wx/lib/colourselect.py b/wxPython/wx/lib/colourselect.py new file mode 100644 index 0000000000..c1dc19adf5 --- /dev/null +++ b/wxPython/wx/lib/colourselect.py @@ -0,0 +1,15 @@ +"""Provides a way to drop the wx prefix from wxPython objects.""" + +__author__ = "Patrick K. O'Brien " +__cvsid__ = "$Id$" +__revision__ = "$Revision$"[11:-2] + +import wx +from wx import prefix + +from wxPython.lib import colourselect +prefix.rename(d_new=globals(), d_old=colourselect.__dict__) +del colourselect + +del prefix +del wx diff --git a/wxPython/wx/lib/dialogs.py b/wxPython/wx/lib/dialogs.py new file mode 100644 index 0000000000..140e771a9b --- /dev/null +++ b/wxPython/wx/lib/dialogs.py @@ -0,0 +1,15 @@ +"""Provides a way to drop the wx prefix from wxPython objects.""" + +__author__ = "Patrick K. O'Brien " +__cvsid__ = "$Id$" +__revision__ = "$Revision$"[11:-2] + +import wx +from wx import prefix + +from wxPython.lib import dialogs +prefix.rename(d_new=globals(), d_old=dialogs.__dict__) +del dialogs + +del prefix +del wx diff --git a/wxPython/wx/lib/editor/__init__.py b/wxPython/wx/lib/editor/__init__.py new file mode 100644 index 0000000000..b929a7db76 --- /dev/null +++ b/wxPython/wx/lib/editor/__init__.py @@ -0,0 +1 @@ +# Python package. diff --git a/wxPython/wx/lib/editor/editor.py b/wxPython/wx/lib/editor/editor.py new file mode 100644 index 0000000000..52319607bd --- /dev/null +++ b/wxPython/wx/lib/editor/editor.py @@ -0,0 +1,15 @@ +"""Provides a way to drop the wx prefix from wxPython objects.""" + +__author__ = "Patrick K. O'Brien " +__cvsid__ = "$Id$" +__revision__ = "$Revision$"[11:-2] + +import wx +from wx import prefix + +from wxPython.lib.editor import editor +prefix.rename(d_new=globals(), d_old=editor.__dict__) +del editor + +del prefix +del wx diff --git a/wxPython/wx/lib/editor/images.py b/wxPython/wx/lib/editor/images.py new file mode 100644 index 0000000000..b8d6574118 --- /dev/null +++ b/wxPython/wx/lib/editor/images.py @@ -0,0 +1,15 @@ +"""Provides a way to drop the wx prefix from wxPython objects.""" + +__author__ = "Patrick K. O'Brien " +__cvsid__ = "$Id$" +__revision__ = "$Revision$"[11:-2] + +import wx +from wx import prefix + +from wxPython.lib.editor import images +prefix.rename(d_new=globals(), d_old=images.__dict__) +del images + +del prefix +del wx diff --git a/wxPython/wx/lib/editor/selection.py b/wxPython/wx/lib/editor/selection.py new file mode 100644 index 0000000000..44abc28ab9 --- /dev/null +++ b/wxPython/wx/lib/editor/selection.py @@ -0,0 +1,15 @@ +"""Provides a way to drop the wx prefix from wxPython objects.""" + +__author__ = "Patrick K. O'Brien " +__cvsid__ = "$Id$" +__revision__ = "$Revision$"[11:-2] + +import wx +from wx import prefix + +from wxPython.lib.editor import selection +prefix.rename(d_new=globals(), d_old=selection.__dict__) +del selection + +del prefix +del wx diff --git a/wxPython/wx/lib/evtmgr.py b/wxPython/wx/lib/evtmgr.py new file mode 100644 index 0000000000..9e77330314 --- /dev/null +++ b/wxPython/wx/lib/evtmgr.py @@ -0,0 +1,15 @@ +"""Provides a way to drop the wx prefix from wxPython objects.""" + +__author__ = "Patrick K. O'Brien " +__cvsid__ = "$Id$" +__revision__ = "$Revision$"[11:-2] + +import wx +from wx import prefix + +from wxPython.lib import evtmgr +prefix.rename(d_new=globals(), d_old=evtmgr.__dict__) +del evtmgr + +del prefix +del wx diff --git a/wxPython/wx/lib/fancytext.py b/wxPython/wx/lib/fancytext.py new file mode 100644 index 0000000000..a9e4f26d9f --- /dev/null +++ b/wxPython/wx/lib/fancytext.py @@ -0,0 +1,15 @@ +"""Provides a way to drop the wx prefix from wxPython objects.""" + +__author__ = "Patrick K. O'Brien " +__cvsid__ = "$Id$" +__revision__ = "$Revision$"[11:-2] + +import wx +from wx import prefix + +from wxPython.lib import fancytext +prefix.rename(d_new=globals(), d_old=fancytext.__dict__) +del fancytext + +del prefix +del wx diff --git a/wxPython/wx/lib/filebrowsebutton.py b/wxPython/wx/lib/filebrowsebutton.py new file mode 100644 index 0000000000..36ad6453d8 --- /dev/null +++ b/wxPython/wx/lib/filebrowsebutton.py @@ -0,0 +1,15 @@ +"""Provides a way to drop the wx prefix from wxPython objects.""" + +__author__ = "Patrick K. O'Brien " +__cvsid__ = "$Id$" +__revision__ = "$Revision$"[11:-2] + +import wx +from wx import prefix + +from wxPython.lib import filebrowsebutton +prefix.rename(d_new=globals(), d_old=filebrowsebutton.__dict__) +del filebrowsebutton + +del prefix +del wx diff --git a/wxPython/wx/lib/gridmovers.py b/wxPython/wx/lib/gridmovers.py new file mode 100644 index 0000000000..b365e33656 --- /dev/null +++ b/wxPython/wx/lib/gridmovers.py @@ -0,0 +1,15 @@ +"""Provides a way to drop the wx prefix from wxPython objects.""" + +__author__ = "Patrick K. O'Brien " +__cvsid__ = "$Id$" +__revision__ = "$Revision$"[11:-2] + +import wx +from wx import prefix + +from wxPython.lib import gridmovers +prefix.rename(d_new=globals(), d_old=gridmovers.__dict__) +del gridmovers + +del prefix +del wx diff --git a/wxPython/wx/lib/grids.py b/wxPython/wx/lib/grids.py new file mode 100644 index 0000000000..e984e4c6f3 --- /dev/null +++ b/wxPython/wx/lib/grids.py @@ -0,0 +1,15 @@ +"""Provides a way to drop the wx prefix from wxPython objects.""" + +__author__ = "Patrick K. O'Brien " +__cvsid__ = "$Id$" +__revision__ = "$Revision$"[11:-2] + +import wx +from wx import prefix + +from wxPython.lib import grids +prefix.rename(d_new=globals(), d_old=grids.__dict__) +del grids + +del prefix +del wx diff --git a/wxPython/wx/lib/imagebrowser.py b/wxPython/wx/lib/imagebrowser.py new file mode 100644 index 0000000000..80bc50049f --- /dev/null +++ b/wxPython/wx/lib/imagebrowser.py @@ -0,0 +1,15 @@ +"""Provides a way to drop the wx prefix from wxPython objects.""" + +__author__ = "Patrick K. O'Brien " +__cvsid__ = "$Id$" +__revision__ = "$Revision$"[11:-2] + +import wx +from wx import prefix + +from wxPython.lib import imagebrowser +prefix.rename(d_new=globals(), d_old=imagebrowser.__dict__) +del imagebrowser + +del prefix +del wx diff --git a/wxPython/wx/lib/imageutils.py b/wxPython/wx/lib/imageutils.py new file mode 100644 index 0000000000..ccd700e1f4 --- /dev/null +++ b/wxPython/wx/lib/imageutils.py @@ -0,0 +1,15 @@ +"""Provides a way to drop the wx prefix from wxPython objects.""" + +__author__ = "Patrick K. O'Brien " +__cvsid__ = "$Id$" +__revision__ = "$Revision$"[11:-2] + +import wx +from wx import prefix + +from wxPython.lib import imageutils +prefix.rename(d_new=globals(), d_old=imageutils.__dict__) +del imageutils + +del prefix +del wx diff --git a/wxPython/wx/lib/infoframe.py b/wxPython/wx/lib/infoframe.py new file mode 100644 index 0000000000..62089231d9 --- /dev/null +++ b/wxPython/wx/lib/infoframe.py @@ -0,0 +1,15 @@ +"""Provides a way to drop the wx prefix from wxPython objects.""" + +__author__ = "Patrick K. O'Brien " +__cvsid__ = "$Id$" +__revision__ = "$Revision$"[11:-2] + +import wx +from wx import prefix + +from wxPython.lib import infoframe +prefix.rename(d_new=globals(), d_old=infoframe.__dict__) +del infoframe + +del prefix +del wx diff --git a/wxPython/wx/lib/intctrl.py b/wxPython/wx/lib/intctrl.py new file mode 100644 index 0000000000..0290187504 --- /dev/null +++ b/wxPython/wx/lib/intctrl.py @@ -0,0 +1,15 @@ +"""Provides a way to drop the wx prefix from wxPython objects.""" + +__author__ = "Patrick K. O'Brien " +__cvsid__ = "$Id$" +__revision__ = "$Revision$"[11:-2] + +import wx +from wx import prefix + +from wxPython.lib import intctrl +prefix.rename(d_new=globals(), d_old=intctrl.__dict__) +del intctrl + +del prefix +del wx diff --git a/wxPython/wx/lib/layoutf.py b/wxPython/wx/lib/layoutf.py new file mode 100644 index 0000000000..97c3129d5a --- /dev/null +++ b/wxPython/wx/lib/layoutf.py @@ -0,0 +1,15 @@ +"""Provides a way to drop the wx prefix from wxPython objects.""" + +__author__ = "Patrick K. O'Brien " +__cvsid__ = "$Id$" +__revision__ = "$Revision$"[11:-2] + +import wx +from wx import prefix + +from wxPython.lib import layoutf +prefix.rename(d_new=globals(), d_old=layoutf.__dict__) +del layoutf + +del prefix +del wx diff --git a/wxPython/wx/lib/mixins/__init__.py b/wxPython/wx/lib/mixins/__init__.py new file mode 100644 index 0000000000..b929a7db76 --- /dev/null +++ b/wxPython/wx/lib/mixins/__init__.py @@ -0,0 +1 @@ +# Python package. diff --git a/wxPython/wx/lib/mixins/grid.py b/wxPython/wx/lib/mixins/grid.py new file mode 100644 index 0000000000..4dce095727 --- /dev/null +++ b/wxPython/wx/lib/mixins/grid.py @@ -0,0 +1,15 @@ +"""Provides a way to drop the wx prefix from wxPython objects.""" + +__author__ = "Patrick K. O'Brien " +__cvsid__ = "$Id$" +__revision__ = "$Revision$"[11:-2] + +import wx +from wx import prefix + +from wxPython.lib.mixins import grid +prefix.rename(d_new=globals(), d_old=grid.__dict__) +del grid + +del prefix +del wx diff --git a/wxPython/wx/lib/mixins/imagelist.py b/wxPython/wx/lib/mixins/imagelist.py new file mode 100644 index 0000000000..d6143ec40c --- /dev/null +++ b/wxPython/wx/lib/mixins/imagelist.py @@ -0,0 +1,15 @@ +"""Provides a way to drop the wx prefix from wxPython objects.""" + +__author__ = "Patrick K. O'Brien " +__cvsid__ = "$Id$" +__revision__ = "$Revision$"[11:-2] + +import wx +from wx import prefix + +from wxPython.lib.mixins import imagelist +prefix.rename(d_new=globals(), d_old=imagelist.__dict__) +del imagelist + +del prefix +del wx diff --git a/wxPython/wx/lib/mixins/listctrl.py b/wxPython/wx/lib/mixins/listctrl.py new file mode 100644 index 0000000000..06660353f6 --- /dev/null +++ b/wxPython/wx/lib/mixins/listctrl.py @@ -0,0 +1,15 @@ +"""Provides a way to drop the wx prefix from wxPython objects.""" + +__author__ = "Patrick K. O'Brien " +__cvsid__ = "$Id$" +__revision__ = "$Revision$"[11:-2] + +import wx +from wx import prefix + +from wxPython.lib.mixins import listctrl +prefix.rename(d_new=globals(), d_old=listctrl.__dict__) +del listctrl + +del prefix +del wx diff --git a/wxPython/wx/lib/mixins/rubberband.py b/wxPython/wx/lib/mixins/rubberband.py new file mode 100644 index 0000000000..924d931b0c --- /dev/null +++ b/wxPython/wx/lib/mixins/rubberband.py @@ -0,0 +1,15 @@ +"""Provides a way to drop the wx prefix from wxPython objects.""" + +__author__ = "Patrick K. O'Brien " +__cvsid__ = "$Id$" +__revision__ = "$Revision$"[11:-2] + +import wx +from wx import prefix + +from wxPython.lib.mixins import rubberband +prefix.rename(d_new=globals(), d_old=rubberband.__dict__) +del rubberband + +del prefix +del wx diff --git a/wxPython/wx/lib/multisash.py b/wxPython/wx/lib/multisash.py new file mode 100644 index 0000000000..56a0f75c0d --- /dev/null +++ b/wxPython/wx/lib/multisash.py @@ -0,0 +1,15 @@ +"""Provides a way to drop the wx prefix from wxPython objects.""" + +__author__ = "Patrick K. O'Brien " +__cvsid__ = "$Id$" +__revision__ = "$Revision$"[11:-2] + +import wx +from wx import prefix + +from wxPython.lib import multisash +prefix.rename(d_new=globals(), d_old=multisash.__dict__) +del multisash + +del prefix +del wx diff --git a/wxPython/wx/lib/popupctl.py b/wxPython/wx/lib/popupctl.py new file mode 100644 index 0000000000..f7e541601b --- /dev/null +++ b/wxPython/wx/lib/popupctl.py @@ -0,0 +1,15 @@ +"""Provides a way to drop the wx prefix from wxPython objects.""" + +__author__ = "Patrick K. O'Brien " +__cvsid__ = "$Id$" +__revision__ = "$Revision$"[11:-2] + +import wx +from wx import prefix + +from wxPython.lib import popupctl +prefix.rename(d_new=globals(), d_old=popupctl.__dict__) +del popupctl + +del prefix +del wx diff --git a/wxPython/wx/lib/printout.py b/wxPython/wx/lib/printout.py new file mode 100644 index 0000000000..d89d0ad8a2 --- /dev/null +++ b/wxPython/wx/lib/printout.py @@ -0,0 +1,15 @@ +"""Provides a way to drop the wx prefix from wxPython objects.""" + +__author__ = "Patrick K. O'Brien " +__cvsid__ = "$Id$" +__revision__ = "$Revision$"[11:-2] + +import wx +from wx import prefix + +from wxPython.lib import printout +prefix.rename(d_new=globals(), d_old=printout.__dict__) +del printout + +del prefix +del wx diff --git a/wxPython/wx/lib/rcsizer.py b/wxPython/wx/lib/rcsizer.py new file mode 100644 index 0000000000..d52f19c438 --- /dev/null +++ b/wxPython/wx/lib/rcsizer.py @@ -0,0 +1,15 @@ +"""Provides a way to drop the wx prefix from wxPython objects.""" + +__author__ = "Patrick K. O'Brien " +__cvsid__ = "$Id$" +__revision__ = "$Revision$"[11:-2] + +import wx +from wx import prefix + +from wxPython.lib import rcsizer +prefix.rename(d_new=globals(), d_old=rcsizer.__dict__) +del rcsizer + +del prefix +del wx diff --git a/wxPython/wx/lib/rightalign.py b/wxPython/wx/lib/rightalign.py new file mode 100644 index 0000000000..69291bf3bd --- /dev/null +++ b/wxPython/wx/lib/rightalign.py @@ -0,0 +1,15 @@ +"""Provides a way to drop the wx prefix from wxPython objects.""" + +__author__ = "Patrick K. O'Brien " +__cvsid__ = "$Id$" +__revision__ = "$Revision$"[11:-2] + +import wx +from wx import prefix + +from wxPython.lib import rightalign +prefix.rename(d_new=globals(), d_old=rightalign.__dict__) +del rightalign + +del prefix +del wx diff --git a/wxPython/wx/lib/sheet.py b/wxPython/wx/lib/sheet.py new file mode 100644 index 0000000000..8b859bb6d2 --- /dev/null +++ b/wxPython/wx/lib/sheet.py @@ -0,0 +1,15 @@ +"""Provides a way to drop the wx prefix from wxPython objects.""" + +__author__ = "Patrick K. O'Brien " +__cvsid__ = "$Id$" +__revision__ = "$Revision$"[11:-2] + +import wx +from wx import prefix + +from wxPython.lib import sheet +prefix.rename(d_new=globals(), d_old=sheet.__dict__) +del sheet + +del prefix +del wx diff --git a/wxPython/wx/lib/stattext.py b/wxPython/wx/lib/stattext.py new file mode 100644 index 0000000000..46c3f8de66 --- /dev/null +++ b/wxPython/wx/lib/stattext.py @@ -0,0 +1,15 @@ +"""Provides a way to drop the wx prefix from wxPython objects.""" + +__author__ = "Patrick K. O'Brien " +__cvsid__ = "$Id$" +__revision__ = "$Revision$"[11:-2] + +import wx +from wx import prefix + +from wxPython.lib import stattext +prefix.rename(d_new=globals(), d_old=stattext.__dict__) +del stattext + +del prefix +del wx diff --git a/wxPython/wx/lib/throbber.py b/wxPython/wx/lib/throbber.py new file mode 100644 index 0000000000..c663166e2e --- /dev/null +++ b/wxPython/wx/lib/throbber.py @@ -0,0 +1,15 @@ +"""Provides a way to drop the wx prefix from wxPython objects.""" + +__author__ = "Patrick K. O'Brien " +__cvsid__ = "$Id$" +__revision__ = "$Revision$"[11:-2] + +import wx +from wx import prefix + +from wxPython.lib import throbber +prefix.rename(d_new=globals(), d_old=throbber.__dict__) +del throbber + +del prefix +del wx diff --git a/wxPython/wx/lib/timectrl.py b/wxPython/wx/lib/timectrl.py new file mode 100644 index 0000000000..6a7abb84bf --- /dev/null +++ b/wxPython/wx/lib/timectrl.py @@ -0,0 +1,15 @@ +"""Provides a way to drop the wx prefix from wxPython objects.""" + +__author__ = "Patrick K. O'Brien " +__cvsid__ = "$Id$" +__revision__ = "$Revision$"[11:-2] + +import wx +from wx import prefix + +from wxPython.lib import timectrl +prefix.rename(d_new=globals(), d_old=timectrl.__dict__) +del timectrl + +del prefix +del wx diff --git a/wxPython/wx/lib/wxPlotCanvas.py b/wxPython/wx/lib/wxPlotCanvas.py new file mode 100644 index 0000000000..f2cccf2e32 --- /dev/null +++ b/wxPython/wx/lib/wxPlotCanvas.py @@ -0,0 +1,15 @@ +"""Provides a way to drop the wx prefix from wxPython objects.""" + +__author__ = "Patrick K. O'Brien " +__cvsid__ = "$Id$" +__revision__ = "$Revision$"[11:-2] + +import wx +from wx import prefix + +from wxPython.lib import wxPlotCanvas +prefix.rename(d_new=globals(), d_old=wxPlotCanvas.__dict__) +del wxPlotCanvas + +del prefix +del wx diff --git a/wxPython/wx/lib/wxpTag.py b/wxPython/wx/lib/wxpTag.py new file mode 100644 index 0000000000..06efe39d94 --- /dev/null +++ b/wxPython/wx/lib/wxpTag.py @@ -0,0 +1,15 @@ +"""Provides a way to drop the wx prefix from wxPython objects.""" + +__author__ = "Patrick K. O'Brien " +__cvsid__ = "$Id$" +__revision__ = "$Revision$"[11:-2] + +import wx +from wx import prefix + +from wxPython.lib import wxpTag +prefix.rename(d_new=globals(), d_old=wxpTag.__dict__) +del wxpTag + +del prefix +del wx diff --git a/wxPython/wx/ogl.py b/wxPython/wx/ogl.py new file mode 100644 index 0000000000..558c2fb9ef --- /dev/null +++ b/wxPython/wx/ogl.py @@ -0,0 +1,15 @@ +"""Provides a way to drop the wx prefix from wxPython objects.""" + +__author__ = "Patrick K. O'Brien " +__cvsid__ = "$Id$" +__revision__ = "$Revision$"[11:-2] + +import wx +from wx import prefix + +from wxPython import ogl +prefix.rename(d_new=globals(), d_old=ogl.__dict__) +del ogl + +del prefix +del wx diff --git a/wxPython/wx/prefix.py b/wxPython/wx/prefix.py new file mode 100644 index 0000000000..3c7fdff2ce --- /dev/null +++ b/wxPython/wx/prefix.py @@ -0,0 +1,28 @@ +"""Renaming utility. + +Provides a way to drop the wx prefix from wxPython objects.""" + +__author__ = "Patrick K. O'Brien " +__cvsid__ = "$Id$" +__revision__ = "$Revision$"[11:-2] + +import types + +def rename(d_new, d_old): + for old, obj in d_old.iteritems(): + if type(obj) is types.ModuleType or old.startswith('_'): + # Skip modules and private names. + continue +## mod = d_old['__name__'] +## if hasattr(obj, '__module__') and not obj.__module__.startswith(mod): +## # Skip objects imported from other modules, except those +## # related to the current module, such as stc_. +## continue + new = old + if old.startswith('EVT_') or old.startswith('wxEVT_'): + # Leave these names unmodified. + pass + elif old.startswith('wx'): + new = old[2:] + if new: + d_new[new] = d_old[old] diff --git a/wxPython/wx/stc.py b/wxPython/wx/stc.py new file mode 100644 index 0000000000..cd9405e034 --- /dev/null +++ b/wxPython/wx/stc.py @@ -0,0 +1,15 @@ +"""Provides a way to drop the wx prefix from wxPython objects.""" + +__author__ = "Patrick K. O'Brien " +__cvsid__ = "$Id$" +__revision__ = "$Revision$"[11:-2] + +import wx +from wx import prefix + +from wxPython import stc +prefix.rename(d_new=globals(), d_old=stc.__dict__) +del stc + +del prefix +del wx diff --git a/wxPython/wx/wizard.py b/wxPython/wx/wizard.py new file mode 100644 index 0000000000..c995db1257 --- /dev/null +++ b/wxPython/wx/wizard.py @@ -0,0 +1,15 @@ +"""Provides a way to drop the wx prefix from wxPython objects.""" + +__author__ = "Patrick K. O'Brien " +__cvsid__ = "$Id$" +__revision__ = "$Revision$"[11:-2] + +import wx +from wx import prefix + +from wxPython import wizard +prefix.rename(d_new=globals(), d_old=wizard.__dict__) +del wizard + +del prefix +del wx diff --git a/wxPython/wx/wx.html b/wxPython/wx/wx.html new file mode 100644 index 0000000000..b494f8b353 --- /dev/null +++ b/wxPython/wx/wx.html @@ -0,0 +1,285 @@ + + + + + + +The wxPython wx Package + + + + + +
+

The wxPython wx Package

+

How to survive the new wx namespace changes.

+ +++ + + + + + + + + + +
Author:Patrick K. O'Brien
Contact:pobrien@orbtech.com
Date:2003-03-21
Revision:1.1
+ +
+

Introduction

+

Big things sometimes come in small packages. This is certainly true +of the new wx package, which is being introduced as a transition to +allow the "wx" prefix to be dropped from the names of all wxPython +classes, functions, and constants.

+
+
+

Why change anything?

+

This change is being made for a couple of reasons. The first reason +is to discourage the use of import *, which is a dangerous +technique that can create name conflicts and bloated namespaces.

+

The second reason is to remove what some perceive to be a "wart." For +example, the following code is rather ugly in that the "wx" prefix on +the wxFrame class name is no longer useful when you're using the wx +module prefix:

+
+from wxPython import wx
+
+class Frame(wx.wxFrame)
+
+

The new wx package allows you to write code like this, instead:

+
+import wx
+
+class Frame(wx.Frame)
+
+

The third reason is that the wxWindows project intends to do the same +thing (implement a new wx namespace and drop the "wx" prefix) and we +want wxPython to lead the way.

+
+
+

What does the new wx package do?

+

As a way of getting to this new syntax as quickly as possible, the +code in this new wx package was created. What it does is alter the +existing wx namespace dynamically. By making the changes on-the-fly +at runtime, we can try out the new syntax before any permanent changes +are made to the underlying class library. The downside of making +these changes at runtime is that there is a slight delay when you +import wx; the upside is that you can start using the new syntax +now.

+
+
+

Will any of this effect my existing code?

+

No. Your existing code will continue to work and be supported for +some time. It will be up to you to decide when to switch to the new +syntax. But all new documentation and code examples will use the new +syntax. So don't wait too long. You wouldn't want anyone calling you +old-fashioned, would you?

+
+
+

How does the new wx package work?

+

It's pretty simple, and pretty clever. The wx directory contains an +__init__.py file, making it a Python package. (In contrast, the +old wxPython.wx module is a module, not a package.) When you import +wx the code in the __init__.py file is executed, and that's +where all the magic takes place. Let's take a look at the code inside +the __init__.py file:

+
+"""wx package
+
+Provides a way to drop the wx prefix from wxPython objects."""
+
+__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
+__cvsid__ = "$Id$"
+__revision__ = "$Revision$"[11:-2]
+
+from wxPython import wx
+
+import types
+
+d_new = globals()
+d_old = wx.__dict__
+
+for old, obj in d_old.iteritems():
+    if type(obj) is types.ModuleType or old.startswith('_'):
+        # Skip modules and private names.
+        continue
+    new = old
+    if old.startswith('EVT_'):
+        # Leave name unmodified; add to the new wx namespace.
+        d_new[new] = obj
+    elif old.startswith('wxEVT_'):
+        # Leave name unmodified; add to the new wx namespace.
+        d_new[new] = obj
+    else:
+        if old.startswith('wx'):
+            # Remove the 'wx' prefix.
+            new = old[2:]
+        # Add to the new wx package namespace.
+        d_new[new] = obj
+
+del d_new
+del d_old
+del new
+del obj
+del old
+del types
+
+del wx
+
+
+

Namespaces in Python are implemented as dictionaries. The dictionary +used to create the wx package's namespace is accessible using the +globals() function. The dictionary used to create the old +wxPython.wx module's namespace is wx.__dict__. Once we have these +two dictionaries, it's a simple matter of iterating through one, +changing the names, adding the renamed object to the other dictionary, +and cleaning up a few local variables and imported modules. Voila!

+
+
+

What about all the other modules, like grid, html, and stc?

+

There's more to wxPython than just the wx namespace. And we've got +those extra modules covered as well. For each of those modules (as +well as the lib package) we've got matching modules in the new wx +package. Let's take a look at a few of them.

+

Here is html.py:

+
+"""Provides a way to drop the wx prefix from wxPython objects."""
+
+__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
+__cvsid__ = "$Id$"
+__revision__ = "$Revision$"[11:-2]
+
+import wx
+from wx import prefix
+
+from wxPython import html
+prefix.rename(d_new=globals(), d_old=html.__dict__)
+del html
+
+del prefix
+del wx
+
+
+

And here is lib/dialogs.py:

+
+"""Provides a way to drop the wx prefix from wxPython objects."""
+
+__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
+__cvsid__ = "$Id$"
+__revision__ = "$Revision$"[11:-2]
+
+import wx
+from wx import prefix
+
+from wxPython.lib import dialogs
+prefix.rename(d_new=globals(), d_old=dialogs.__dict__)
+del dialogs
+
+del prefix
+del wx
+
+
+

As you can see, they both rely on the prefix.rename() function +defined in prefix.py:

+
+"""Renaming utility.
+
+Provides a way to drop the wx prefix from wxPython objects."""
+
+__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
+__cvsid__ = "$Id$"
+__revision__ = "$Revision$"[11:-2]
+
+import types
+
+def rename(d_new, d_old):
+    for old, obj in d_old.iteritems():
+        if type(obj) is types.ModuleType or old.startswith('_'):
+            # Skip modules and private names.
+            continue
+##         mod = d_old['__name__']
+##         if hasattr(obj, '__module__') and not obj.__module__.startswith(mod):
+##             # Skip objects imported from other modules, except those
+##             # related to the current module, such as stc_.
+##             continue
+        new = old
+        if old.startswith('EVT_') or old.startswith('wxEVT_'):
+            # Leave these names unmodified.
+            pass 
+        elif old.startswith('wx'):
+            new = old[2:]
+        if new:
+            d_new[new] = d_old[old]
+
+
+

Again, the technique is very similar to the one used by the wx +package.

+
+
+

How do I use it?

+

The wx package is created when you install wxPython. So you can start +using it now. Examples are included in the wx/examples directory, +which includes an examples.txt documentation file. Here is the source +code for hello.py, a simple program that displays a wxPython +graphic inside a frame:

+
+#!/usr/bin/env python
+
+"""Hello, wxPython! program."""
+
+__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
+__cvsid__ = "$Id$"
+__revision__ = "$Revision$"[11:-2]
+
+import wx
+
+class Frame(wx.Frame):
+    """Frame class that displays an image."""
+
+    def __init__(self, image, parent=None, id=-1,
+                 pos=wx.DefaultPosition, title='Hello, wxPython!'):
+        """Create a Frame instance and display image."""
+        temp = image.ConvertToBitmap()
+        size = temp.GetWidth(), temp.GetHeight()
+        wx.Frame.__init__(self, parent, id, title, pos, size)
+        self.bmp = wx.StaticBitmap(parent=self, id=-1, bitmap=temp)
+
+class App(wx.App):
+    """Application class."""
+
+    def OnInit(self):
+        wx.InitAllImageHandlers()
+        image = wx.Image('wxPython.jpg', wx.BITMAP_TYPE_JPEG)
+        self.frame = Frame(image)
+        self.frame.Show()
+        self.SetTopWindow(self.frame)
+        return True
+
+def main():
+    app = App()
+    app.MainLoop()
+
+if __name__ == '__main__':
+    main()
+
+
+

Good luck. I hope you like the new wx package as much as I do.

+

Pat

+
+
+ + diff --git a/wxPython/wx/wx.txt b/wxPython/wx/wx.txt new file mode 100644 index 0000000000..fcfb717a42 --- /dev/null +++ b/wxPython/wx/wx.txt @@ -0,0 +1,140 @@ +========================= + The wxPython wx Package +========================= + +---------------------------------------------- + How to survive the new wx namespace changes. +---------------------------------------------- + +:Author: Patrick K. O'Brien +:Contact: pobrien@orbtech.com +:Date: $Date$ +:Revision: $Revision$ + +.. contents:: + + +Introduction +============ + +Big things sometimes come in small packages. This is certainly true +of the new wx package, which is being introduced as a transition to +allow the "wx" prefix to be dropped from the names of all wxPython +classes, functions, and constants. + + +Why change anything? +==================== + +This change is being made for a couple of reasons. The first reason +is to discourage the use of ``import *``, which is a dangerous +technique that can create name conflicts and bloated namespaces. + +The second reason is to remove what some perceive to be a "wart." For +example, the following code is rather ugly in that the "wx" prefix on +the wxFrame class name is no longer useful when you're using the wx +module prefix:: + + from wxPython import wx + + class Frame(wx.wxFrame) + +The new wx package allows you to write code like this, instead:: + + import wx + + class Frame(wx.Frame) + +The third reason is that the wxWindows project intends to do the same +thing (implement a new wx namespace and drop the "wx" prefix) and we +want wxPython to lead the way. + + +What does the new wx package do? +================================ + +As a way of getting to this new syntax as quickly as possible, the +code in this new wx package was created. What it does is alter the +existing wx namespace dynamically. By making the changes on-the-fly +at runtime, we can try out the new syntax before any permanent changes +are made to the underlying class library. The downside of making +these changes at runtime is that there is a slight delay when you +``import wx``; the upside is that you can start using the new syntax +now. + + +Will any of this effect my existing code? +========================================= + +No. Your existing code will continue to work and be supported for +some time. It will be up to you to decide when to switch to the new +syntax. But all new documentation and code examples will use the new +syntax. So don't wait too long. You wouldn't want anyone calling you +old-fashioned, would you? + + +How does the new wx package work? +================================= + +It's pretty simple, and pretty clever. The wx directory contains an +``__init__.py`` file, making it a Python package. (In contrast, the +old wxPython.wx module is a module, not a package.) When you ``import +wx`` the code in the ``__init__.py`` file is executed, and that's +where all the magic takes place. Let's take a look at the code inside +the ``__init__.py`` file: + +.. include:: __init__.py + :literal: + +Namespaces in Python are implemented as dictionaries. The dictionary +used to create the wx package's namespace is accessible using the +``globals()`` function. The dictionary used to create the old +wxPython.wx module's namespace is ``wx.__dict__``. Once we have these +two dictionaries, it's a simple matter of iterating through one, +changing the names, adding the renamed object to the other dictionary, +and cleaning up a few local variables and imported modules. Voila! + + +What about all the other modules, like grid, html, and stc? +=========================================================== + +There's more to wxPython than just the wx namespace. And we've got +those extra modules covered as well. For each of those modules (as +well as the lib package) we've got matching modules in the new wx +package. Let's take a look at a few of them. + +Here is ``html.py``: + +.. include:: html.py + :literal: + +And here is ``lib/dialogs.py``: + +.. include:: lib/dialogs.py + :literal: + +As you can see, they both rely on the ``prefix.rename()`` function +defined in ``prefix.py``: + +.. include:: prefix.py + :literal: + +Again, the technique is very similar to the one used by the wx +package. + + +How do I use it? +================ + +The wx package is created when you install wxPython. So you can start +using it now. Examples are included in the wx/examples directory, +which includes an examples.txt documentation file. Here is the source +code for ``hello.py``, a simple program that displays a wxPython +graphic inside a frame: + +.. include:: examples/hello/hello.py + :literal: + +Good luck. I hope you like the new wx package as much as I do. + +Pat diff --git a/wxPython/wx/xrc.py b/wxPython/wx/xrc.py new file mode 100644 index 0000000000..55d84ea8d6 --- /dev/null +++ b/wxPython/wx/xrc.py @@ -0,0 +1,15 @@ +"""Provides a way to drop the wx prefix from wxPython objects.""" + +__author__ = "Patrick K. O'Brien " +__cvsid__ = "$Id$" +__revision__ = "$Revision$"[11:-2] + +import wx +from wx import prefix + +from wxPython import xrc +prefix.rename(d_new=globals(), d_old=xrc.__dict__) +del xrc + +del prefix +del wx