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
c6709978
Kaydet (Commit)
c6709978
authored
Haz 03, 2009
tarafından
Tarek Ziadé
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
added some tests for distutils.extension + code cleanup
üst
c1edec33
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
108 additions
and
16 deletions
+108
-16
extension.py
Lib/distutils/extension.py
+5
-16
Setup.sample
Lib/distutils/tests/Setup.sample
+67
-0
test_extension.py
Lib/distutils/tests/test_extension.py
+36
-0
No files found.
Lib/distutils/extension.py
Dosyayı görüntüle @
c6709978
...
...
@@ -141,9 +141,11 @@ class Extension:
# class Extension
def
read_setup_file
(
filename
):
from
distutils.sysconfig
import
\
parse_makefile
,
expand_makefile_vars
,
_variable_rx
def
read_setup_file
(
filename
):
"""Reads a Setup file and returns Extension instances."""
from
distutils.sysconfig
import
(
parse_makefile
,
expand_makefile_vars
,
_variable_rx
)
from
distutils.text_file
import
TextFile
from
distutils.util
import
split_quoted
...
...
@@ -168,10 +170,8 @@ def read_setup_file (filename):
file
.
warn
(
"'
%
s' lines not handled yet"
%
line
)
continue
#print "original line: " + line
line
=
expand_makefile_vars
(
line
,
vars
)
words
=
split_quoted
(
line
)
#print "expanded line: " + line
# NB. this parses a slightly different syntax than the old
# makesetup script: here, there must be exactly one extension per
...
...
@@ -237,15 +237,4 @@ def read_setup_file (filename):
extensions
.
append
(
ext
)
#print "module:", module
#print "source files:", source_files
#print "cpp args:", cpp_args
#print "lib args:", library_args
#extensions[module] = { 'sources': source_files,
# 'cpp_args': cpp_args,
# 'lib_args': library_args }
return
extensions
# read_setup_file ()
Lib/distutils/tests/Setup.sample
0 → 100755
Dosyayı görüntüle @
c6709978
# Setup file from the pygame project
#--StartConfig
SDL = -I/usr/include/SDL -D_REENTRANT -lSDL
FONT = -lSDL_ttf
IMAGE = -lSDL_image
MIXER = -lSDL_mixer
SMPEG = -lsmpeg
PNG = -lpng
JPEG = -ljpeg
SCRAP = -lX11
PORTMIDI = -lportmidi
PORTTIME = -lporttime
#--EndConfig
#DEBUG = -C-W -C-Wall
DEBUG =
#the following modules are optional. you will want to compile
#everything you can, but you can ignore ones you don't have
#dependencies for, just comment them out
imageext src/imageext.c $(SDL) $(IMAGE) $(PNG) $(JPEG) $(DEBUG)
font src/font.c $(SDL) $(FONT) $(DEBUG)
mixer src/mixer.c $(SDL) $(MIXER) $(DEBUG)
mixer_music src/music.c $(SDL) $(MIXER) $(DEBUG)
_numericsurfarray src/_numericsurfarray.c $(SDL) $(DEBUG)
_numericsndarray src/_numericsndarray.c $(SDL) $(MIXER) $(DEBUG)
movie src/movie.c $(SDL) $(SMPEG) $(DEBUG)
scrap src/scrap.c $(SDL) $(SCRAP) $(DEBUG)
_camera src/_camera.c src/camera_v4l2.c src/camera_v4l.c $(SDL) $(DEBUG)
pypm src/pypm.c $(SDL) $(PORTMIDI) $(PORTTIME) $(DEBUG)
GFX = src/SDL_gfx/SDL_gfxPrimitives.c
#GFX = src/SDL_gfx/SDL_gfxBlitFunc.c src/SDL_gfx/SDL_gfxPrimitives.c
gfxdraw src/gfxdraw.c $(SDL) $(GFX) $(DEBUG)
#these modules are required for pygame to run. they only require
#SDL as a dependency. these should not be altered
base src/base.c $(SDL) $(DEBUG)
cdrom src/cdrom.c $(SDL) $(DEBUG)
color src/color.c $(SDL) $(DEBUG)
constants src/constants.c $(SDL) $(DEBUG)
display src/display.c $(SDL) $(DEBUG)
event src/event.c $(SDL) $(DEBUG)
fastevent src/fastevent.c src/fastevents.c $(SDL) $(DEBUG)
key src/key.c $(SDL) $(DEBUG)
mouse src/mouse.c $(SDL) $(DEBUG)
rect src/rect.c $(SDL) $(DEBUG)
rwobject src/rwobject.c $(SDL) $(DEBUG)
surface src/surface.c src/alphablit.c src/surface_fill.c $(SDL) $(DEBUG)
surflock src/surflock.c $(SDL) $(DEBUG)
time src/time.c $(SDL) $(DEBUG)
joystick src/joystick.c $(SDL) $(DEBUG)
draw src/draw.c $(SDL) $(DEBUG)
image src/image.c $(SDL) $(DEBUG)
overlay src/overlay.c $(SDL) $(DEBUG)
transform src/transform.c src/rotozoom.c src/scale2x.c src/scale_mmx.c $(SDL) $(DEBUG)
mask src/mask.c src/bitmask.c $(SDL) $(DEBUG)
bufferproxy src/bufferproxy.c $(SDL) $(DEBUG)
pixelarray src/pixelarray.c $(SDL) $(DEBUG)
_arraysurfarray src/_arraysurfarray.c $(SDL) $(DEBUG)
Lib/distutils/tests/test_extension.py
0 → 100755
Dosyayı görüntüle @
c6709978
"""Tests for distutils.extension."""
import
unittest
import
os
from
distutils.extension
import
read_setup_file
class
ExtensionTestCase
(
unittest
.
TestCase
):
def
test_read_setup_file
(
self
):
# trying to read a Setup file
# (sample extracted from the PyGame project)
setup
=
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'Setup.sample'
)
exts
=
read_setup_file
(
setup
)
names
=
[
ext
.
name
for
ext
in
exts
]
names
.
sort
()
# here are the extensions read_setup_file should have created
# out of the file
wanted
=
[
'_arraysurfarray'
,
'_camera'
,
'_numericsndarray'
,
'_numericsurfarray'
,
'base'
,
'bufferproxy'
,
'cdrom'
,
'color'
,
'constants'
,
'display'
,
'draw'
,
'event'
,
'fastevent'
,
'font'
,
'gfxdraw'
,
'image'
,
'imageext'
,
'joystick'
,
'key'
,
'mask'
,
'mixer'
,
'mixer_music'
,
'mouse'
,
'movie'
,
'overlay'
,
'pixelarray'
,
'pypm'
,
'rect'
,
'rwobject'
,
'scrap'
,
'surface'
,
'surflock'
,
'time'
,
'transform'
]
self
.
assertEquals
(
names
,
wanted
)
def
test_suite
():
return
unittest
.
makeSuite
(
ExtensionTestCase
)
if
__name__
==
"__main__"
:
unittest
.
main
(
defaultTest
=
"test_suite"
)
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