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
import
sys
import
struct
from
Carbon
import
Icn
import
macresource
#
# Resource definitions
...
...
@@ -26,14 +27,7 @@ MAXWIDTH=320
MAXHEIGHT
=
320
def
main
():
try
:
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
)
macresource
.
need
(
'DLOG'
,
ID_MAIN
,
"PICTbrowse.rsrc"
)
ICONbrowse
()
class
ICONbrowse
(
FrameWork
.
Application
):
...
...
Mac/Demo/PICTbrowse/PICTbrowse.py
Dosyayı görüntüle @
3c06b9a7
...
...
@@ -9,6 +9,7 @@ from Carbon import Controls
from
Carbon
import
List
import
sys
import
struct
import
macresource
#
# Resource definitions
...
...
@@ -21,14 +22,7 @@ LEFT=200
TOP
=
64
def
main
():
try
:
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
)
macresource
.
need
(
'DLOG'
,
ID_MAIN
,
"PICTbrowse.rsrc"
)
PICTbrowse
()
class
PICTbrowse
(
FrameWork
.
Application
):
...
...
Mac/Demo/PICTbrowse/PICTbrowse2.py
Dosyayı görüntüle @
3c06b9a7
...
...
@@ -9,6 +9,7 @@ from Carbon import Controls
from
Carbon
import
List
import
sys
import
struct
import
macresource
#
# Resource definitions
...
...
@@ -25,14 +26,7 @@ MAXWIDTH=320
MAXHEIGHT
=
320
def
main
():
try
:
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
)
macresource
.
need
(
'DLOG'
,
ID_MAIN
,
"PICTbrowse.rsrc"
)
PICTbrowse
()
class
PICTbrowse
(
FrameWork
.
Application
):
...
...
Mac/Demo/PICTbrowse/cicnbrowse.py
Dosyayı görüntüle @
3c06b9a7
...
...
@@ -10,6 +10,7 @@ from Carbon import List
import
sys
import
struct
from
Carbon
import
Icn
import
macresource
#
# Resource definitions
...
...
@@ -26,14 +27,7 @@ MAXWIDTH=320
MAXHEIGHT
=
320
def
main
():
try
:
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
)
macresource
.
need
(
'DLOG'
,
ID_MAIN
,
"PICTbrowse.rsrc"
)
CIconbrowse
()
class
CIconbrowse
(
FrameWork
.
Application
):
...
...
@@ -119,9 +113,9 @@ class MyDialog(FrameWork.DialogWindow):
def
open
(
self
,
id
,
contents
):
self
.
id
=
id
FrameWork
.
DialogWindow
.
open
(
self
,
ID_MAIN
)
self
.
wid
.
SetDialogDefaultItem
(
MAIN_SHOW
)
self
.
dlg
.
SetDialogDefaultItem
(
MAIN_SHOW
)
self
.
contents
=
contents
self
.
ctl
=
self
.
wid
.
GetDialogItemAsControl
(
MAIN_LIST
)
self
.
ctl
=
self
.
dlg
.
GetDialogItemAsControl
(
MAIN_LIST
)
h
=
self
.
ctl
.
GetControlData_Handle
(
Controls
.
kControlListBoxPart
,
Controls
.
kControlListBoxListHandleTag
)
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
from
Carbon
import
List
import
sys
import
struct
import
macresource
#
# Resource definitions
...
...
@@ -20,14 +21,7 @@ LEFT=200
TOP
=
64
def
main
():
try
:
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
)
macresource
.
need
(
'DLOG'
,
ID_MAIN
,
"oldPICTbrowse.rsrc"
)
PICTbrowse
()
class
PICTbrowse
(
FrameWork
.
Application
):
...
...
Mac/Demo/example1/dnslookup-1.py
Dosyayı görüntüle @
3c06b9a7
...
...
@@ -7,6 +7,7 @@ from Carbon import Dlg
import
sys
import
socket
import
string
import
macresource
#
# Definitions for our resources
ID_MAIN
=
512
...
...
@@ -15,15 +16,10 @@ ITEM_LOOKUP_ENTRY=1
ITEM_RESULT
=
2
ITEM_LOOKUP_BUTTON
=
3
ITEM_QUIT_BUTTON
=
4
def
main
():
"""Main routine: open resource file, call dialog handler"""
try
:
Res
.
FSpOpenResFile
(
"dnslookup-1.rsrc"
,
1
)
except
Res
.
Error
:
EasyDialogs
.
Message
(
"Cannot open dnslookup-1.rsrc"
)
sys
.
exit
(
1
)
macresource
.
need
(
"DLOG"
,
ID_MAIN
,
"dnslookup-1.rsrc"
)
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
import
sys
import
socket
import
string
import
macresource
#
# Definitions for our resources
ID_MAIN
=
512
...
...
@@ -15,14 +16,7 @@ ITEM_RESULT=2
ITEM_LOOKUP_BUTTON
=
3
def
main
():
try
:
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
)
macresource
.
need
(
"DLOG"
,
ID_MAIN
,
"dnslookup-2.rsrc"
)
DNSLookup
()
class
DNSLookup
(
FrameWork
.
Application
):
...
...
Mac/Tools/IDE/PythonIDE.py
Dosyayı görüntüle @
3c06b9a7
...
...
@@ -13,25 +13,17 @@ def init():
from
Carbon
import
Qd
,
QuickDraw
Qd
.
SetCursor
(
Qd
.
GetCursor
(
QuickDraw
.
watchCursor
)
.
data
)
from
Carbon
import
Res
import
macresource
import
sys
,
os
try
:
Res
.
GetResource
(
'DITL'
,
468
)
except
Res
.
Error
:
# we're not an applet
Res
.
FSpOpenResFile
(
os
.
path
.
join
(
sys
.
exec_prefix
,
":Mac:Tools:IDE:PythonIDE.rsrc"
),
1
)
Res
.
FSpOpenResFile
(
os
.
path
.
join
(
sys
.
exec_prefix
,
":Mac:Tools:IDE:Widgets.rsrc"
),
1
)
macresource
.
need
(
'DITL'
,
468
,
"PythonIDE.rsrc"
)
widgetresfile
=
os
.
path
.
join
(
sys
.
exec_prefix
,
":Mac:Tools:IDE:Widgets.rsrc"
)
refno
=
macresource
.
need
(
'CURS'
,
468
,
widgetresfile
)
if
refno
:
# We're not a fullblown application
ide_path
=
os
.
path
.
join
(
sys
.
exec_prefix
,
":Mac:Tools:IDE"
)
else
:
# we're an applet
try
:
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
]
# We are a fully frozen application
ide_path
=
sys
.
argv
[
0
]
if
ide_path
not
in
sys
.
path
:
sys
.
path
.
insert
(
0
,
ide_path
)
...
...
Mac/Tools/macfreeze/macfreezegui.py
Dosyayı görüntüle @
3c06b9a7
...
...
@@ -6,6 +6,7 @@ import sys
import
os
import
string
from
Carbon
import
Res
import
macresource
ID_MAINDIALOG
=
512
...
...
@@ -54,17 +55,8 @@ def dialog(script=None):
dirname
=
os
.
path
.
join
(
dirname
,
'build.'
+
basebase
)
# Get the dialog, possibly opening the resource file (if needed)
try
:
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
)
macresource
.
need
(
'DLOG'
,
ID_MAINDIALOG
,
'macfreeze.rsrc'
)
d
=
Dlg
.
GetNewDialog
(
ID_MAINDIALOG
,
-
1
)
if
d
==
None
:
EasyDialogs
.
Message
(
"Dialog resource not found or faulty"
)
sys
.
exit
(
1
)
...
...
Mac/scripts/BuildApplication.py
Dosyayı görüntüle @
3c06b9a7
...
...
@@ -18,6 +18,7 @@ from Carbon import Res
from
Carbon
import
Dlg
import
EasyDialogs
import
buildtools
import
macresource
# Hmmm...
MACFREEZEPATH
=
os
.
path
.
join
(
sys
.
prefix
,
":Mac:Tools:macfreeze"
)
...
...
@@ -38,13 +39,7 @@ GEN68K_BUTTON = 6
PPC_ONLY
=
1
try
:
Res
.
GetResource
(
'DITL'
,
DLG_ID
)
except
Res
.
Error
:
Res
.
FSpOpenResFile
(
"BuildApplication.rsrc"
,
1
)
else
:
pass
# we're an applet
macresource
.
need
(
'DITL'
,
DLG_ID
,
"BuildApplication.rsrc"
)
def
main
():
try
:
...
...
Mac/scripts/EditPythonPrefs.py
Dosyayı görüntüle @
3c06b9a7
...
...
@@ -15,6 +15,7 @@ import os
import
sys
from
Carbon
import
Res
# For Res.Error
import
pythonprefs
import
macresource
import
EasyDialogs
try
:
from
Carbon
import
Help
...
...
@@ -195,10 +196,7 @@ def edit_applet(name):
handler
.
save
(
result
)
def
main
():
try
:
h
=
FSpOpenResFile
(
'EditPythonPrefs.rsrc'
,
1
)
except
Res
.
Error
:
pass
# Assume we already have acces to our own resource
macresource
.
need
(
'DLOG'
,
DIALOG_ID
,
'EditPythonPrefs.rsrc'
)
MacOS
.
SchedParams
(
1
,
0
)
if
len
(
sys
.
argv
)
<=
1
:
...
...
Mac/scripts/MkDistr_ui.py
Dosyayı görüntüle @
3c06b9a7
...
...
@@ -23,6 +23,7 @@ import EasyDialogs
import
macfs
import
os
import
sys
import
macresource
# Resource IDs
ID_MAIN
=
514
...
...
@@ -321,7 +322,7 @@ def GetType():
def
InitUI
():
"""Initialize stuff needed by UI (a resource file)"""
Res
.
FSpOpenResFile
(
'MkDistr.rsrc'
,
1
)
macresource
.
need
(
'DLOG'
,
ID_MAIN
,
'MkDistr.rsrc'
,
modname
=
__name__
)
class
_testerhelp
:
def
__init__
(
self
,
which
):
...
...
@@ -340,7 +341,7 @@ class _testerhelp:
class
_test
:
def
__init__
(
self
):
import
sys
Res
.
FSpOpenResFile
(
'MkDistr.rsrc'
,
1
)
InitUI
(
)
self
.
inc
=
_testerhelp
(
'include'
)
self
.
exc
=
_testerhelp
(
'exclude'
)
self
.
ui
=
MkDistrUI
(
self
)
...
...
Mac/scripts/fullbuild.py
Dosyayı görüntüle @
3c06b9a7
...
...
@@ -19,6 +19,7 @@ import EasyDialogs
import
re
import
string
import
genpluginprojects
import
macresource
import
aetools
from
Carbon
import
AppleEvents
...
...
@@ -369,11 +370,7 @@ def incbuildno(filename):
fp
.
close
()
def
main
():
try
:
h
=
Res
.
FSpOpenResFile
(
'fullbuild.rsrc'
,
1
)
except
Res
.
Error
:
pass
# Assume we already have acces to our own resource
macresource
.
need
(
'DLOG'
,
DIALOG_ID
,
'fullbuild.rsrc'
)
dir
,
ok
=
macfs
.
GetDirectory
(
'Python source folder:'
)
if
not
ok
:
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