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
07642c36
Kaydet (Commit)
07642c36
authored
Eyl 22, 2000
tarafından
Jack Jansen
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
More bits and pieces of project generation.
üst
7760cff2
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
119 additions
and
10 deletions
+119
-10
__init__.py
Mac/Lib/mkcwproject/__init__.py
+59
-0
cwtalker.py
Mac/Lib/mkcwproject/cwtalker.py
+26
-0
cwxmlgen.py
Mac/Lib/mkcwproject/cwxmlgen.py
+10
-5
template-searchdirs.xml
Mac/Lib/mkcwproject/template/template-searchdirs.xml
+9
-0
template.prj.xml
Mac/Lib/mkcwproject/template/template.prj.xml
+15
-5
No files found.
Mac/Lib/mkcwproject/__init__.py
0 → 100644
Dosyayı görüntüle @
07642c36
import
cwxmlgen
import
cwtalker
def
mkproject
(
outputfile
,
modulename
,
settings
):
#
# Copy the dictionary
#
dictcopy
=
{}
for
k
,
v
in
settings
.
items
():
dictcopy
[
k
]
=
v
#
# Fill in mac-specific values
#
dictcopy
[
'mac_projectxmlname'
]
=
outputfile
+
'.xml'
dictcopy
[
'mac_exportname'
]
=
os
.
path
.
split
(
outputfile
)[
1
]
+
'.exp'
dictcopy
[
'mac_outputdir'
]
=
':lib:'
# XXX Is this correct??
dictcopy
[
'mac_dllname'
]
=
modulename
+
'.ppc.slb'
dictcopy
[
'mac_targetname'
]
=
modulename
+
'.ppc'
of
os
.
path
.
isabs
(
dictcopy
[
'sysprefix'
]):
dictcopy
[
'mac_sysprefixtype'
]
=
'Absolute'
else
:
dictcopy
[
'mac_sysprefixtype'
]
=
'Project'
# XXX not sure this is right...
#
# Generate the XML for the project
#
xmlbuilder
=
cwxmlgen
.
ProjectBuilder
(
dictcopy
)
xmlbuilder
.
generate
()
fp
=
open
(
dictcopy
[
'mac_projectxmlname'
],
"w"
)
fp
.
write
(
dict
[
"tmp_projectxmldata"
])
fp
.
close
()
#
# Generate the export file
#
fp
=
open
(
outputfile
+
'.exp'
,
'w'
)
fp
.
write
(
'init
%
s
\n
'
%
modulename
)
fp
.
close
()
#
# Generate the project from the xml
#
cw
=
cwtalker
.
MyCodeWarrior
(
start
=
1
)
cw
.
send_timeout
=
AppleEvents
.
kNoTimeOut
xmlfss
=
macfs
.
FSSpec
(
dictcopy
[
'mac_projectxmlname'
])
prjfss
=
macfs
.
FSSpec
(
outputfile
)
cw
.
my_mkproject
(
prjfss
,
xmlfss
)
def
buildproject
(
projectfile
):
cw
=
cwtalker
.
MyCodeWarrior
(
start
=
1
)
cw
.
send_timeout
=
AppleEvents
.
kNoTimeOut
prjfss
=
macfs
.
FSSpec
(
projectfile
)
cw
.
open
(
prjfss
)
cw
.
Make_Project
()
# XXX Should set target
def
cleanproject
(
projectfile
):
cw
=
cwtalker
.
MyCodeWarrior
(
start
=
1
)
cw
.
send_timeout
=
AppleEvents
.
kNoTimeOut
prjfss
=
macfs
.
FSSpec
(
projectfile
)
cw
.
open
(
prjfss
)
cw
.
Remove_Binaries
()
Mac/Lib/mkcwproject/cwtalker.py
0 → 100644
Dosyayı görüntüle @
07642c36
import
CodeWarrior
class
MyCodeWarrior
(
CodeWarrior
.
CodeWarrior
):
# Bug in the CW OSA dictionary
def
export
(
self
,
object
,
_attributes
=
{},
**
_arguments
):
"""export: Export the project file as an XML file
Keyword argument _in: the XML file in which to export the project
Keyword argument _attributes: AppleEvent attribute dictionary
"""
_code
=
'CWIE'
_subcode
=
'EXPT'
aetools
.
keysubst
(
_arguments
,
self
.
_argmap_export
)
_arguments
[
'----'
]
=
_object
_reply
,
_arguments
,
_attributes
=
self
.
send
(
_code
,
_subcode
,
_arguments
,
_attributes
)
if
_arguments
.
has_key
(
'errn'
):
raise
aetools
.
Error
,
aetools
.
decodeerror
(
_arguments
)
# XXXX Optionally decode result
if
_arguments
.
has_key
(
'----'
):
return
_arguments
[
'----'
]
def
my_mkproject
(
self
,
prjfile
,
xmlfile
):
self
.
make
(
new
=
CodeWarrior
.
project_document
,
with_data
=
xmlfile
,
at
=
prjfile
)
Mac/Lib/mkcwproject/
mkcwproject
.py
→
Mac/Lib/mkcwproject/
cwxmlgen
.py
Dosyayı görüntüle @
07642c36
...
@@ -9,6 +9,7 @@ TEMPLATELIST= [
...
@@ -9,6 +9,7 @@ TEMPLATELIST= [
(
"tmp_allsources"
,
"file"
,
"template-allsources.xml"
,
"sources"
),
(
"tmp_allsources"
,
"file"
,
"template-allsources.xml"
,
"sources"
),
(
"tmp_linkorder"
,
"file"
,
"template-linkorder.xml"
,
"sources"
),
(
"tmp_linkorder"
,
"file"
,
"template-linkorder.xml"
,
"sources"
),
(
"tmp_grouplist"
,
"file"
,
"template-grouplist.xml"
,
"sources"
),
(
"tmp_grouplist"
,
"file"
,
"template-grouplist.xml"
,
"sources"
),
(
"tmp_extrasearchdirs"
,
"file"
,
"template-searchdirs.xml"
,
"extrasearchdirs"
),
(
"tmp_projectxmldata"
,
"file"
,
"template.prj.xml"
,
None
)
(
"tmp_projectxmldata"
,
"file"
,
"template.prj.xml"
,
None
)
]
]
...
@@ -66,11 +67,15 @@ class ProjectBuilder:
...
@@ -66,11 +67,15 @@ class ProjectBuilder:
def
_test
():
def
_test
():
dict
=
{
dict
=
{
"mac_projectxmlname"
:
"xxnew.prj.xml"
,
"mac_projectxmlname"
:
"controlstrip.prj.xml"
,
# The XML filename (full path)
"mac_targetname"
:
"xxnew.ppc"
,
"mac_exportname"
:
"controlstrip.prj.exp"
,
# Export file (relative to project)
"mac_dllname"
:
"xxnew.ppc.slb"
,
"mac_outputdir"
:
":"
,
# The directory where the DLL is put (relative to project)
"sources"
:
[
"xxnewmodule.c"
],
"mac_dllname"
:
"controlstrip.ppc.slb"
,
# The DLL filename (within outputdir)
"mac_exportname"
:
"xxnew.prj.exp"
,
"mac_targetname"
:
"controlstrip.ppc"
,
# The targetname within the project
"sysprefix"
:
sys
.
prefix
,
# Where the Python sources live
"mac_sysprefixtype"
:
"Absolute"
,
# Type of previous pathname
"sources"
:
[
"controlstripmodule.c"
],
"extrasearchdirs"
:
[],
# -I and -L, in unix terms
}
}
pb
=
ProjectBuilder
(
dict
)
pb
=
ProjectBuilder
(
dict
)
pb
.
generate
()
pb
.
generate
()
...
...
Mac/Lib/mkcwproject/template/template-searchdirs.xml
0 → 100644
Dosyayı görüntüle @
07642c36
<SETTING>
<SETTING><NAME>
SearchPath
</NAME>
<SETTING><NAME>
Path
</NAME><VALUE>
%(extrasearchdirs)s
</VALUE></SETTING>
<SETTING><NAME>
PathFormat
</NAME><VALUE>
MacOS
</VALUE></SETTING>
<SETTING><NAME>
PathRoot
</NAME><VALUE>
Absolute
</VALUE></SETTING>
</SETTING>
<SETTING><NAME>
Recursive
</NAME><VALUE>
false
</VALUE></SETTING>
<SETTING><NAME>
HostFlags
</NAME><VALUE>
All
</VALUE></SETTING>
</SETTING>
Mac/Lib/mkcwproject/template/template.prj.xml
Dosyayı görüntüle @
07642c36
...
@@ -92,20 +92,30 @@
...
@@ -92,20 +92,30 @@
</SETTING>
</SETTING>
<SETTING>
<SETTING>
<SETTING><NAME>
SearchPath
</NAME>
<SETTING><NAME>
SearchPath
</NAME>
<SETTING><NAME>
Path
</NAME><VALUE>
::
:
</VALUE></SETTING>
<SETTING><NAME>
Path
</NAME><VALUE>
%(sysprefix)s:Mac
:
</VALUE></SETTING>
<SETTING><NAME>
PathFormat
</NAME><VALUE>
MacOS
</VALUE></SETTING>
<SETTING><NAME>
PathFormat
</NAME><VALUE>
MacOS
</VALUE></SETTING>
<SETTING><NAME>
PathRoot
</NAME><VALUE>
Project
</VALUE></SETTING>
<SETTING><NAME>
PathRoot
</NAME><VALUE>
%(mac_sysprefixtype)s
</VALUE></SETTING>
</SETTING>
<SETTING><NAME>
Recursive
</NAME><VALUE>
true
</VALUE></SETTING>
<SETTING><NAME>
HostFlags
</NAME><VALUE>
All
</VALUE></SETTING>
</SETTING>
<SETTING>
<SETTING><NAME>
SearchPath
</NAME>
<SETTING><NAME>
Path
</NAME><VALUE>
%(sysprefix)s
</VALUE></SETTING>
<SETTING><NAME>
PathFormat
</NAME><VALUE>
MacOS
</VALUE></SETTING>
<SETTING><NAME>
PathRoot
</NAME><VALUE>
%(mac_sysprefixtype)s
</VALUE></SETTING>
</SETTING>
</SETTING>
<SETTING><NAME>
Recursive
</NAME><VALUE>
true
</VALUE></SETTING>
<SETTING><NAME>
Recursive
</NAME><VALUE>
true
</VALUE></SETTING>
<SETTING><NAME>
HostFlags
</NAME><VALUE>
All
</VALUE></SETTING>
<SETTING><NAME>
HostFlags
</NAME><VALUE>
All
</VALUE></SETTING>
</SETTING>
</SETTING>
</SETTING>
</SETTING>
<SETTING><NAME>
SystemSearchPaths
</NAME>
<SETTING><NAME>
SystemSearchPaths
</NAME>
%(tmp_extrasearchdirs)s
<SETTING>
<SETTING>
<SETTING><NAME>
SearchPath
</NAME>
<SETTING><NAME>
SearchPath
</NAME>
<SETTING><NAME>
Path
</NAME><VALUE>
::
::GUSI2:include:
</VALUE></SETTING>
<SETTING><NAME>
Path
</NAME><VALUE>
%(sysprefix)s
::GUSI2:include:
</VALUE></SETTING>
<SETTING><NAME>
PathFormat
</NAME><VALUE>
MacOS
</VALUE></SETTING>
<SETTING><NAME>
PathFormat
</NAME><VALUE>
MacOS
</VALUE></SETTING>
<SETTING><NAME>
PathRoot
</NAME><VALUE>
Project
</VALUE></SETTING>
<SETTING><NAME>
PathRoot
</NAME><VALUE>
%(mac_sysprefixtype)s
</VALUE></SETTING>
</SETTING>
</SETTING>
<SETTING><NAME>
Recursive
</NAME><VALUE>
false
</VALUE></SETTING>
<SETTING><NAME>
Recursive
</NAME><VALUE>
false
</VALUE></SETTING>
<SETTING><NAME>
HostFlags
</NAME><VALUE>
All
</VALUE></SETTING>
<SETTING><NAME>
HostFlags
</NAME><VALUE>
All
</VALUE></SETTING>
...
@@ -136,7 +146,7 @@
...
@@ -136,7 +146,7 @@
<SETTING><NAME>
PostLinker
</NAME><VALUE></VALUE></SETTING>
<SETTING><NAME>
PostLinker
</NAME><VALUE></VALUE></SETTING>
<SETTING><NAME>
Targetname
</NAME><VALUE>
%(mac_targetname)s
</VALUE></SETTING>
<SETTING><NAME>
Targetname
</NAME><VALUE>
%(mac_targetname)s
</VALUE></SETTING>
<SETTING><NAME>
OutputDirectory
</NAME>
<SETTING><NAME>
OutputDirectory
</NAME>
<SETTING><NAME>
Path
</NAME><VALUE>
::PlugIns:
</VALUE></SETTING>
<SETTING><NAME>
Path
</NAME><VALUE>
%(mac_outputdir)s
</VALUE></SETTING>
<SETTING><NAME>
PathFormat
</NAME><VALUE>
MacOS
</VALUE></SETTING>
<SETTING><NAME>
PathFormat
</NAME><VALUE>
MacOS
</VALUE></SETTING>
<SETTING><NAME>
PathRoot
</NAME><VALUE>
Project
</VALUE></SETTING>
<SETTING><NAME>
PathRoot
</NAME><VALUE>
Project
</VALUE></SETTING>
</SETTING>
</SETTING>
...
...
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