Kaydet (Commit) 2f242582 authored tarafından Guido van Rossum's avatar Guido van Rossum

Use ImportError; New class syntax.

üst 9f7a956f
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
try: try:
import posix, path import posix, path
os = posix os = posix
except NameError: except ImportError:
import mac, macpath import mac, macpath
os = mac os = mac
path = macpath path = macpath
...@@ -16,7 +16,7 @@ from Buttons import PushButton ...@@ -16,7 +16,7 @@ from Buttons import PushButton
from WindowParent import WindowParent from WindowParent import WindowParent
from HVSplit import HSplit, VSplit from HVSplit import HSplit, VSplit
class DirList() = VSplit(): class DirList(VSplit):
# #
def create(self, (parent, dirname)): def create(self, (parent, dirname)):
self = VSplit.create(self, parent) self = VSplit.create(self, parent)
...@@ -32,7 +32,7 @@ class DirList() = VSplit(): ...@@ -32,7 +32,7 @@ class DirList() = VSplit():
return self return self
# #
class DirListWindow() = WindowParent(): class DirListWindow(WindowParent):
# #
def create(self, dirname): def create(self, dirname):
self = WindowParent.create(self, (dirname, (0, 0))) self = WindowParent.create(self, (dirname, (0, 0)))
...@@ -41,7 +41,7 @@ class DirListWindow() = WindowParent(): ...@@ -41,7 +41,7 @@ class DirListWindow() = WindowParent():
return self return self
# #
class SubdirButton() = PushButton(): class SubdirButton(PushButton):
# #
def drawpict(self, d): def drawpict(self, d):
PushButton.drawpict(self, d) PushButton.drawpict(self, d)
...@@ -51,13 +51,13 @@ class SubdirButton() = PushButton(): ...@@ -51,13 +51,13 @@ class SubdirButton() = PushButton():
window = DirListWindow().create(self.text) window = DirListWindow().create(self.text)
# #
class FileButton() = PushButton(): class FileButton(PushButton):
# #
def up_trigger(self): def up_trigger(self):
stdwin.fleep() stdwin.fleep()
# #
class ModuleButton() = FileButton(): class ModuleButton(FileButton):
# #
def drawpict(self, d): def drawpict(self, d):
PushButton.drawpict(self, d) PushButton.drawpict(self, d)
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
try: try:
import posix, path import posix, path
os = posix os = posix
except NameError: except ImportError:
import mac, macpath import mac, macpath
os = mac os = mac
path = macpath path = macpath
...@@ -16,7 +16,7 @@ from Buttons import PushButton ...@@ -16,7 +16,7 @@ from Buttons import PushButton
from WindowParent import WindowParent from WindowParent import WindowParent
from HVSplit import HSplit, VSplit from HVSplit import HSplit, VSplit
class DirList() = VSplit(): class DirList(VSplit):
# #
def create(self, (parent, dirname)): def create(self, (parent, dirname)):
self = VSplit.create(self, parent) self = VSplit.create(self, parent)
...@@ -32,7 +32,7 @@ class DirList() = VSplit(): ...@@ -32,7 +32,7 @@ class DirList() = VSplit():
return self return self
# #
class DirListWindow() = WindowParent(): class DirListWindow(WindowParent):
# #
def create(self, dirname): def create(self, dirname):
self = WindowParent.create(self, (dirname, (0, 0))) self = WindowParent.create(self, (dirname, (0, 0)))
...@@ -41,7 +41,7 @@ class DirListWindow() = WindowParent(): ...@@ -41,7 +41,7 @@ class DirListWindow() = WindowParent():
return self return self
# #
class SubdirButton() = PushButton(): class SubdirButton(PushButton):
# #
def drawpict(self, d): def drawpict(self, d):
PushButton.drawpict(self, d) PushButton.drawpict(self, d)
...@@ -51,13 +51,13 @@ class SubdirButton() = PushButton(): ...@@ -51,13 +51,13 @@ class SubdirButton() = PushButton():
window = DirListWindow().create(self.text) window = DirListWindow().create(self.text)
# #
class FileButton() = PushButton(): class FileButton(PushButton):
# #
def up_trigger(self): def up_trigger(self):
stdwin.fleep() stdwin.fleep()
# #
class ModuleButton() = FileButton(): class ModuleButton(FileButton):
# #
def drawpict(self, d): def drawpict(self, d):
PushButton.drawpict(self, d) PushButton.drawpict(self, d)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment