Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
3c06b9a7
Kaydet (Commit)
3c06b9a7
authored
Agu 27, 2001
tarafından
Jack Jansen
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Use the new macresource module to open the accompanying resource file (if needed).
üst
a5d7da52
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
37 additions
and
102 deletions
+37
-102
ICONbrowse.py
Mac/Demo/PICTbrowse/ICONbrowse.py
+2
-8
PICTbrowse.py
Mac/Demo/PICTbrowse/PICTbrowse.py
+2
-8
PICTbrowse2.py
Mac/Demo/PICTbrowse/PICTbrowse2.py
+2
-8
cicnbrowse.py
Mac/Demo/PICTbrowse/cicnbrowse.py
+4
-10
oldPICTbrowse.py
Mac/Demo/PICTbrowse/oldPICTbrowse.py
+2
-8
dnslookup-1.py
Mac/Demo/example1/dnslookup-1.py
+3
-7
dnslookup-2.py
Mac/Demo/example2/dnslookup-2.py
+2
-8
PythonIDE.py
Mac/Tools/IDE/PythonIDE.py
+8
-16
macfreezegui.py
Mac/Tools/macfreeze/macfreezegui.py
+3
-11
BuildApplication.py
Mac/scripts/BuildApplication.py
+2
-7
EditPythonPrefs.py
Mac/scripts/EditPythonPrefs.py
+2
-4
MkDistr_ui.py
Mac/scripts/MkDistr_ui.py
+3
-2
fullbuild.py
Mac/scripts/fullbuild.py
+2
-5
No files found.
Mac/Demo/PICTbrowse/ICONbrowse.py
Dosyayı görüntüle @
3c06b9a7
...
@@ -10,6 +10,7 @@ from Carbon import List
...
@@ -10,6 +10,7 @@ from Carbon import List
import
sys
import
sys
import
struct
import
struct
from
Carbon
import
Icn
from
Carbon
import
Icn
import
macresource
#
#
# Resource definitions
# Resource definitions
...
@@ -26,14 +27,7 @@ MAXWIDTH=320
...
@@ -26,14 +27,7 @@ MAXWIDTH=320
MAXHEIGHT
=
320
MAXHEIGHT
=
320
def
main
():
def
main
():
try
:
macresource
.
need
(
'DLOG'
,
ID_MAIN
,
"PICTbrowse.rsrc"
)
dummy
=
Res
.
GetResource
(
'DLOG'
,
ID_MAIN
)
except
Res
.
Error
:
try
:
Res
.
FSpOpenResFile
(
"PICTbrowse.rsrc"
,
1
)
except
Res
.
Error
,
arg
:
EasyDialogs
.
Message
(
"Cannot open PICTbrowse.rsrc: "
+
arg
[
1
])
sys
.
exit
(
1
)
ICONbrowse
()
ICONbrowse
()
class
ICONbrowse
(
FrameWork
.
Application
):
class
ICONbrowse
(
FrameWork
.
Application
):
...
...
Mac/Demo/PICTbrowse/PICTbrowse.py
Dosyayı görüntüle @
3c06b9a7
...
@@ -9,6 +9,7 @@ from Carbon import Controls
...
@@ -9,6 +9,7 @@ from Carbon import Controls
from
Carbon
import
List
from
Carbon
import
List
import
sys
import
sys
import
struct
import
struct
import
macresource
#
#
# Resource definitions
# Resource definitions
...
@@ -21,14 +22,7 @@ LEFT=200
...
@@ -21,14 +22,7 @@ LEFT=200
TOP
=
64
TOP
=
64
def
main
():
def
main
():
try
:
macresource
.
need
(
'DLOG'
,
ID_MAIN
,
"PICTbrowse.rsrc"
)
dummy
=
Res
.
GetResource
(
'DLOG'
,
ID_MAIN
)
except
Res
.
Error
:
try
:
Res
.
FSpOpenResFile
(
"PICTbrowse.rsrc"
,
1
)
except
Res
.
Error
,
arg
:
EasyDialogs
.
Message
(
"Cannot open PICTbrowse.rsrc: "
+
arg
[
1
])
sys
.
exit
(
1
)
PICTbrowse
()
PICTbrowse
()
class
PICTbrowse
(
FrameWork
.
Application
):
class
PICTbrowse
(
FrameWork
.
Application
):
...
...
Mac/Demo/PICTbrowse/PICTbrowse2.py
Dosyayı görüntüle @
3c06b9a7
...
@@ -9,6 +9,7 @@ from Carbon import Controls
...
@@ -9,6 +9,7 @@ from Carbon import Controls
from
Carbon
import
List
from
Carbon
import
List
import
sys
import
sys
import
struct
import
struct
import
macresource
#
#
# Resource definitions
# Resource definitions
...
@@ -25,14 +26,7 @@ MAXWIDTH=320
...
@@ -25,14 +26,7 @@ MAXWIDTH=320
MAXHEIGHT
=
320
MAXHEIGHT
=
320
def
main
():
def
main
():
try
:
macresource
.
need
(
'DLOG'
,
ID_MAIN
,
"PICTbrowse.rsrc"
)
dummy
=
Res
.
GetResource
(
'DLOG'
,
ID_MAIN
)
except
Res
.
Error
:
try
:
Res
.
FSpOpenResFile
(
"PICTbrowse.rsrc"
,
1
)
except
Res
.
Error
,
arg
:
EasyDialogs
.
Message
(
"Cannot open PICTbrowse.rsrc: "
+
arg
[
1
])
sys
.
exit
(
1
)
PICTbrowse
()
PICTbrowse
()
class
PICTbrowse
(
FrameWork
.
Application
):
class
PICTbrowse
(
FrameWork
.
Application
):
...
...
Mac/Demo/PICTbrowse/cicnbrowse.py
Dosyayı görüntüle @
3c06b9a7
...
@@ -10,6 +10,7 @@ from Carbon import List
...
@@ -10,6 +10,7 @@ from Carbon import List
import
sys
import
sys
import
struct
import
struct
from
Carbon
import
Icn
from
Carbon
import
Icn
import
macresource
#
#
# Resource definitions
# Resource definitions
...
@@ -26,14 +27,7 @@ MAXWIDTH=320
...
@@ -26,14 +27,7 @@ MAXWIDTH=320
MAXHEIGHT
=
320
MAXHEIGHT
=
320
def
main
():
def
main
():
try
:
macresource
.
need
(
'DLOG'
,
ID_MAIN
,
"PICTbrowse.rsrc"
)
dummy
=
Res
.
GetResource
(
'DLOG'
,
ID_MAIN
)
except
Res
.
Error
:
try
:
Res
.
FSpOpenResFile
(
"PICTbrowse.rsrc"
,
1
)
except
Res
.
Error
,
arg
:
EasyDialogs
.
Message
(
"Cannot open PICTbrowse.rsrc: "
+
arg
[
1
])
sys
.
exit
(
1
)
CIconbrowse
()
CIconbrowse
()
class
CIconbrowse
(
FrameWork
.
Application
):
class
CIconbrowse
(
FrameWork
.
Application
):
...
@@ -119,9 +113,9 @@ class MyDialog(FrameWork.DialogWindow):
...
@@ -119,9 +113,9 @@ class MyDialog(FrameWork.DialogWindow):
def
open
(
self
,
id
,
contents
):
def
open
(
self
,
id
,
contents
):
self
.
id
=
id
self
.
id
=
id
FrameWork
.
DialogWindow
.
open
(
self
,
ID_MAIN
)
FrameWork
.
DialogWindow
.
open
(
self
,
ID_MAIN
)
self
.
wid
.
SetDialogDefaultItem
(
MAIN_SHOW
)
self
.
dlg
.
SetDialogDefaultItem
(
MAIN_SHOW
)
self
.
contents
=
contents
self
.
contents
=
contents
self
.
ctl
=
self
.
wid
.
GetDialogItemAsControl
(
MAIN_LIST
)
self
.
ctl
=
self
.
dlg
.
GetDialogItemAsControl
(
MAIN_LIST
)
h
=
self
.
ctl
.
GetControlData_Handle
(
Controls
.
kControlListBoxPart
,
h
=
self
.
ctl
.
GetControlData_Handle
(
Controls
.
kControlListBoxPart
,
Controls
.
kControlListBoxListHandleTag
)
Controls
.
kControlListBoxListHandleTag
)
self
.
list
=
List
.
as_List
(
h
)
self
.
list
=
List
.
as_List
(
h
)
...
...
Mac/Demo/PICTbrowse/oldPICTbrowse.py
Dosyayı görüntüle @
3c06b9a7
...
@@ -8,6 +8,7 @@ from Carbon import Win
...
@@ -8,6 +8,7 @@ from Carbon import Win
from
Carbon
import
List
from
Carbon
import
List
import
sys
import
sys
import
struct
import
struct
import
macresource
#
#
# Resource definitions
# Resource definitions
...
@@ -20,14 +21,7 @@ LEFT=200
...
@@ -20,14 +21,7 @@ LEFT=200
TOP
=
64
TOP
=
64
def
main
():
def
main
():
try
:
macresource
.
need
(
'DLOG'
,
ID_MAIN
,
"oldPICTbrowse.rsrc"
)
dummy
=
Res
.
GetResource
(
'DLOG'
,
ID_MAIN
)
except
Res
.
Error
:
try
:
Res
.
FSpOpenResFile
(
"oldPICTbrowse.rsrc"
,
0
)
except
Res
.
Error
,
arg
:
EasyDialogs
.
Message
(
"Cannot open PICTbrowse.rsrc: "
+
arg
[
1
])
sys
.
exit
(
1
)
PICTbrowse
()
PICTbrowse
()
class
PICTbrowse
(
FrameWork
.
Application
):
class
PICTbrowse
(
FrameWork
.
Application
):
...
...
Mac/Demo/example1/dnslookup-1.py
Dosyayı görüntüle @
3c06b9a7
...
@@ -7,6 +7,7 @@ from Carbon import Dlg
...
@@ -7,6 +7,7 @@ from Carbon import Dlg
import
sys
import
sys
import
socket
import
socket
import
string
import
string
import
macresource
#
#
# Definitions for our resources
# Definitions for our resources
ID_MAIN
=
512
ID_MAIN
=
512
...
@@ -15,15 +16,10 @@ ITEM_LOOKUP_ENTRY=1
...
@@ -15,15 +16,10 @@ ITEM_LOOKUP_ENTRY=1
ITEM_RESULT
=
2
ITEM_RESULT
=
2
ITEM_LOOKUP_BUTTON
=
3
ITEM_LOOKUP_BUTTON
=
3
ITEM_QUIT_BUTTON
=
4
ITEM_QUIT_BUTTON
=
4
def
main
():
def
main
():
"""Main routine: open resource file, call dialog handler"""
"""Main routine: open resource file, call dialog handler"""
try
:
macresource
.
need
(
"DLOG"
,
ID_MAIN
,
"dnslookup-1.rsrc"
)
Res
.
FSpOpenResFile
(
"dnslookup-1.rsrc"
,
1
)
except
Res
.
Error
:
EasyDialogs
.
Message
(
"Cannot open dnslookup-1.rsrc"
)
sys
.
exit
(
1
)
do_dialog
()
do_dialog
()
def
do_dialog
():
def
do_dialog
():
...
...
Mac/Demo/example2/dnslookup-2.py
Dosyayı görüntüle @
3c06b9a7
...
@@ -5,6 +5,7 @@ from Carbon import Dlg
...
@@ -5,6 +5,7 @@ from Carbon import Dlg
import
sys
import
sys
import
socket
import
socket
import
string
import
string
import
macresource
#
#
# Definitions for our resources
# Definitions for our resources
ID_MAIN
=
512
ID_MAIN
=
512
...
@@ -15,14 +16,7 @@ ITEM_RESULT=2
...
@@ -15,14 +16,7 @@ ITEM_RESULT=2
ITEM_LOOKUP_BUTTON
=
3
ITEM_LOOKUP_BUTTON
=
3
def
main
():
def
main
():
try
:
macresource
.
need
(
"DLOG"
,
ID_MAIN
,
"dnslookup-2.rsrc"
)
dummy
=
Res
.
GetResource
(
'DLOG'
,
ID_MAIN
)
except
Res
.
Error
:
try
:
Res
.
FSpOpenResFile
(
"dnslookup-2.rsrc"
,
1
)
except
Res
.
Error
:
EasyDialogs
.
Message
(
"Cannot open dnslookup-2.rsrc"
)
sys
.
exit
(
1
)
DNSLookup
()
DNSLookup
()
class
DNSLookup
(
FrameWork
.
Application
):
class
DNSLookup
(
FrameWork
.
Application
):
...
...
Mac/Tools/IDE/PythonIDE.py
Dosyayı görüntüle @
3c06b9a7
...
@@ -13,25 +13,17 @@ def init():
...
@@ -13,25 +13,17 @@ def init():
from
Carbon
import
Qd
,
QuickDraw
from
Carbon
import
Qd
,
QuickDraw
Qd
.
SetCursor
(
Qd
.
GetCursor
(
QuickDraw
.
watchCursor
)
.
data
)
Qd
.
SetCursor
(
Qd
.
GetCursor
(
QuickDraw
.
watchCursor
)
.
data
)
from
Carbon
import
Res
import
macresource
import
sys
,
os
import
sys
,
os
try
:
macresource
.
need
(
'DITL'
,
468
,
"PythonIDE.rsrc"
)
Res
.
GetResource
(
'DITL'
,
468
)
widgetresfile
=
os
.
path
.
join
(
sys
.
exec_prefix
,
":Mac:Tools:IDE:Widgets.rsrc"
)
except
Res
.
Error
:
refno
=
macresource
.
need
(
'CURS'
,
468
,
widgetresfile
)
# we're not an applet
if
refno
:
Res
.
FSpOpenResFile
(
os
.
path
.
join
(
sys
.
exec_prefix
,
":Mac:Tools:IDE:PythonIDE.rsrc"
),
1
)
# We're not a fullblown application
Res
.
FSpOpenResFile
(
os
.
path
.
join
(
sys
.
exec_prefix
,
":Mac:Tools:IDE:Widgets.rsrc"
),
1
)
ide_path
=
os
.
path
.
join
(
sys
.
exec_prefix
,
":Mac:Tools:IDE"
)
ide_path
=
os
.
path
.
join
(
sys
.
exec_prefix
,
":Mac:Tools:IDE"
)
else
:
else
:
# we're an applet
# We are a fully frozen application
try
:
ide_path
=
sys
.
argv
[
0
]
Res
.
GetResource
(
'CURS'
,
468
)
except
Res
.
Error
:
Res
.
FSpOpenResFile
(
os
.
path
.
join
(
sys
.
exec_prefix
,
":Mac:Tools:IDE:Widgets.rsrc"
),
1
)
ide_path
=
os
.
path
.
join
(
sys
.
exec_prefix
,
":Mac:Tools:IDE"
)
else
:
# we're a full blown applet
ide_path
=
sys
.
argv
[
0
]
if
ide_path
not
in
sys
.
path
:
if
ide_path
not
in
sys
.
path
:
sys
.
path
.
insert
(
0
,
ide_path
)
sys
.
path
.
insert
(
0
,
ide_path
)
...
...
Mac/Tools/macfreeze/macfreezegui.py
Dosyayı görüntüle @
3c06b9a7
...
@@ -6,6 +6,7 @@ import sys
...
@@ -6,6 +6,7 @@ import sys
import
os
import
os
import
string
import
string
from
Carbon
import
Res
from
Carbon
import
Res
import
macresource
ID_MAINDIALOG
=
512
ID_MAINDIALOG
=
512
...
@@ -54,17 +55,8 @@ def dialog(script=None):
...
@@ -54,17 +55,8 @@ def dialog(script=None):
dirname
=
os
.
path
.
join
(
dirname
,
'build.'
+
basebase
)
dirname
=
os
.
path
.
join
(
dirname
,
'build.'
+
basebase
)
# Get the dialog, possibly opening the resource file (if needed)
# Get the dialog, possibly opening the resource file (if needed)
try
:
macresource
.
need
(
'DLOG'
,
ID_MAINDIALOG
,
'macfreeze.rsrc'
)
d
=
Dlg
.
GetNewDialog
(
ID_MAINDIALOG
,
-
1
)
d
=
Dlg
.
GetNewDialog
(
ID_MAINDIALOG
,
-
1
)
except
Dlg
.
Error
:
d
=
None
if
d
==
None
:
try
:
Res
.
FSpOpenResFile
(
'macfreeze.rsrc'
,
1
)
except
Res
.
Error
:
d
=
None
else
:
d
=
Dlg
.
GetNewDialog
(
ID_MAINDIALOG
,
-
1
)
if
d
==
None
:
if
d
==
None
:
EasyDialogs
.
Message
(
"Dialog resource not found or faulty"
)
EasyDialogs
.
Message
(
"Dialog resource not found or faulty"
)
sys
.
exit
(
1
)
sys
.
exit
(
1
)
...
...
Mac/scripts/BuildApplication.py
Dosyayı görüntüle @
3c06b9a7
...
@@ -18,6 +18,7 @@ from Carbon import Res
...
@@ -18,6 +18,7 @@ from Carbon import Res
from
Carbon
import
Dlg
from
Carbon
import
Dlg
import
EasyDialogs
import
EasyDialogs
import
buildtools
import
buildtools
import
macresource
# Hmmm...
# Hmmm...
MACFREEZEPATH
=
os
.
path
.
join
(
sys
.
prefix
,
":Mac:Tools:macfreeze"
)
MACFREEZEPATH
=
os
.
path
.
join
(
sys
.
prefix
,
":Mac:Tools:macfreeze"
)
...
@@ -38,13 +39,7 @@ GEN68K_BUTTON = 6
...
@@ -38,13 +39,7 @@ GEN68K_BUTTON = 6
PPC_ONLY
=
1
PPC_ONLY
=
1
try
:
macresource
.
need
(
'DITL'
,
DLG_ID
,
"BuildApplication.rsrc"
)
Res
.
GetResource
(
'DITL'
,
DLG_ID
)
except
Res
.
Error
:
Res
.
FSpOpenResFile
(
"BuildApplication.rsrc"
,
1
)
else
:
pass
# we're an applet
def
main
():
def
main
():
try
:
try
:
...
...
Mac/scripts/EditPythonPrefs.py
Dosyayı görüntüle @
3c06b9a7
...
@@ -15,6 +15,7 @@ import os
...
@@ -15,6 +15,7 @@ import os
import
sys
import
sys
from
Carbon
import
Res
# For Res.Error
from
Carbon
import
Res
# For Res.Error
import
pythonprefs
import
pythonprefs
import
macresource
import
EasyDialogs
import
EasyDialogs
try
:
try
:
from
Carbon
import
Help
from
Carbon
import
Help
...
@@ -195,10 +196,7 @@ def edit_applet(name):
...
@@ -195,10 +196,7 @@ def edit_applet(name):
handler
.
save
(
result
)
handler
.
save
(
result
)
def
main
():
def
main
():
try
:
macresource
.
need
(
'DLOG'
,
DIALOG_ID
,
'EditPythonPrefs.rsrc'
)
h
=
FSpOpenResFile
(
'EditPythonPrefs.rsrc'
,
1
)
except
Res
.
Error
:
pass
# Assume we already have acces to our own resource
MacOS
.
SchedParams
(
1
,
0
)
MacOS
.
SchedParams
(
1
,
0
)
if
len
(
sys
.
argv
)
<=
1
:
if
len
(
sys
.
argv
)
<=
1
:
...
...
Mac/scripts/MkDistr_ui.py
Dosyayı görüntüle @
3c06b9a7
...
@@ -23,6 +23,7 @@ import EasyDialogs
...
@@ -23,6 +23,7 @@ import EasyDialogs
import
macfs
import
macfs
import
os
import
os
import
sys
import
sys
import
macresource
# Resource IDs
# Resource IDs
ID_MAIN
=
514
ID_MAIN
=
514
...
@@ -321,7 +322,7 @@ def GetType():
...
@@ -321,7 +322,7 @@ def GetType():
def
InitUI
():
def
InitUI
():
"""Initialize stuff needed by UI (a resource file)"""
"""Initialize stuff needed by UI (a resource file)"""
Res
.
FSpOpenResFile
(
'MkDistr.rsrc'
,
1
)
macresource
.
need
(
'DLOG'
,
ID_MAIN
,
'MkDistr.rsrc'
,
modname
=
__name__
)
class
_testerhelp
:
class
_testerhelp
:
def
__init__
(
self
,
which
):
def
__init__
(
self
,
which
):
...
@@ -340,7 +341,7 @@ class _testerhelp:
...
@@ -340,7 +341,7 @@ class _testerhelp:
class
_test
:
class
_test
:
def
__init__
(
self
):
def
__init__
(
self
):
import
sys
import
sys
Res
.
FSpOpenResFile
(
'MkDistr.rsrc'
,
1
)
InitUI
(
)
self
.
inc
=
_testerhelp
(
'include'
)
self
.
inc
=
_testerhelp
(
'include'
)
self
.
exc
=
_testerhelp
(
'exclude'
)
self
.
exc
=
_testerhelp
(
'exclude'
)
self
.
ui
=
MkDistrUI
(
self
)
self
.
ui
=
MkDistrUI
(
self
)
...
...
Mac/scripts/fullbuild.py
Dosyayı görüntüle @
3c06b9a7
...
@@ -19,6 +19,7 @@ import EasyDialogs
...
@@ -19,6 +19,7 @@ import EasyDialogs
import
re
import
re
import
string
import
string
import
genpluginprojects
import
genpluginprojects
import
macresource
import
aetools
import
aetools
from
Carbon
import
AppleEvents
from
Carbon
import
AppleEvents
...
@@ -369,11 +370,7 @@ def incbuildno(filename):
...
@@ -369,11 +370,7 @@ def incbuildno(filename):
fp
.
close
()
fp
.
close
()
def
main
():
def
main
():
try
:
macresource
.
need
(
'DLOG'
,
DIALOG_ID
,
'fullbuild.rsrc'
)
h
=
Res
.
FSpOpenResFile
(
'fullbuild.rsrc'
,
1
)
except
Res
.
Error
:
pass
# Assume we already have acces to our own resource
dir
,
ok
=
macfs
.
GetDirectory
(
'Python source folder:'
)
dir
,
ok
=
macfs
.
GetDirectory
(
'Python source folder:'
)
if
not
ok
:
if
not
ok
:
sys
.
exit
(
0
)
sys
.
exit
(
0
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment