wpdev-commits Mailing List for Wolfpack Emu (Page 182)
Brought to you by:
rip,
thiagocorrea
You can subscribe to this list here.
| 2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(14) |
Aug
(121) |
Sep
(256) |
Oct
(59) |
Nov
(73) |
Dec
(120) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(259) |
Feb
(381) |
Mar
(501) |
Apr
(355) |
May
(427) |
Jun
(270) |
Jul
(394) |
Aug
(412) |
Sep
(724) |
Oct
(578) |
Nov
(65) |
Dec
|
|
From: <dar...@us...> - 2003-11-21 01:26:53
|
Update of /cvsroot/wpdev/xmlscripts/scripts/wolfpack/magic
In directory sc8-pr-cvs1:/tmp/cvs-serv16849/wolfpack/magic
Added Files:
circle4.py circle5.py circle6.py circle7.py circle8.py
firefield.py
Log Message:
Several Changes and/or fixes.
--- NEW FILE: circle4.py ---
from wolfpack.magic.spell import CharEffectSpell, Spell, DelayedDamageSpell
from wolfpack.magic.utilities import *
import random
import wolfpack
from wolfpack.utilities import tobackpack
class Curse ( CharEffectSpell ):
def __init__( self ):
CharEffectSpell.__init__( self, 4 )
self.reagents = { REAGENT_NIGHTSHADE: 1, REAGENT_GARLIC: 1, REAGENT_SULFURASH: 1 }
self.mantra = 'Des Sanct'
self.harmful = 1
def effect( self, char, target ):
statmodifier( char, target, 3, 1 )
target.effect( 0x373a, 10, 15 )
target.soundeffect( 0x1ea )
class GreaterHeal ( CharEffectSpell ):
def __init__( self ):
CharEffectSpell.__init__( self, 4 )
self.reagents = { REAGENT_GARLIC: 1, REAGENT_GINSENG: 1, REAGENT_SPIDERSILK: 1 }
self.mantra = 'In Vas Mani'
def effect( self, char, target ):
# 40% of Magery + 1-10
amount = int( 0.04 * char.skill[ MAGERY ] ) + random.randint( 1, 10 )
target.hitpoints = min( target.maxhitpoints, target.hitpoints + amount )
target.updatehealth()
target.effect( 0x376A, 9, 32 )
target.soundeffect( 0x202 )
class Lightning ( DelayedDamageSpell ):
def __init__( self ):
DelayedDamageSpell.__init__( self, 4 )
self.reagents = { REAGENT_SULFURASH: 1, REAGENT_MANDRAKE: 1 }
self.mantra = 'Por Ort Grav'
self.delay = None
def damage( self, char, target ):
target.lightning()
target.soundeffect( 0x29 )
damage = self.scaledamage( char, target, random.randint( 12, 21 ) )
target.damage( DAMAGE_MAGICAL, damage, char )
class ManaDrain ( DelayedDamageSpell ):
def __init__( self ):
DelayedDamageSpell.__init__( self, 4 )
self.reagents = { REAGENT_SULFURASH: 1, REAGENT_MANDRAKE: 1 }
self.mantra = 'Ort Rel'
self.delay = None
def damage( self, char, target ):
if self.checkresist( char, target ):
target.message( 501783 )
else:
target.mana -= random.randint( 1, target.mana )
target.updatemana()
target.action( ANIM_TAKEHIT )
target.sound( SND_DEFEND )
target.effect( 0x3779, 10, 25 )
target.soundeffect( 0x28e )
class Recall ( Spell ):
def __init__( self ):
Spell.__init__( self, 4 )
self.reagents = { REAGENT_BLOODMOSS: 1, REAGENT_SULFURASH: 1, REAGENT_GARLIC: 1 }
self.mantra = 'Kal Ort Por'
self.validtarget = TARGET_ITEM
def target( self, char, mode, targettype, target ):
char.turnto( target )
# We can only recall from recall runes
if not 'recall_rune' in target.events:
char.message( 502357 )
return
if not self.consumerequirements( char, mode ):
return
if not target.hastag( 'marked' ) or target.gettag( 'marked' ) != 1:
char.message( 502354 )
fizzle( char )
return
region = wolfpack.region( char.pos.x, char.pos.y, char.pos.map )
if region.norecallout:
char.message( 501802 )
fizzle( char )
return
location = target.gettag( 'location' )
location = location.split( "," )
location = wolfpack.coord( location[0], location[1], location[2], location[3] )
region = wolfpack.region( location.x, location.y, location.map )
if region.norecallin:
char.message( 1019004 )
fizzle( char )
return
char.soundeffect( 0x1fc )
char.removefromview()
char.moveto( location )
char.update()
char.soundeffect( 0x1fc )
class FireField( Spell ):
def __init__( self ):
Spell.__init__( self, 4 )
self.reagents = { REAGENT_BLACKPEARL: 1, REAGENT_SPIDERSILK: 1, REAGENT_SULFURASH: 1 }
self.mantra = 'In Flam Grav'
self.validtarget = TARGET_GROUND
self.harmful = 1
self.resistable = 1
def target( self, char, mode, targettype, target ):
char.turnto( target )
if not char.cansee( target ) and not char.gm:
char.message( 500237 )
return
if not self.consumerequirements( char, mode ):
return
xdiff = abs( target.x - char.pos.x )
ydiff = abs( target.y - char.pos.y )
positions = []
# West / East
if xdiff > ydiff:
itemid = 0x3996
for i in range( -2, 3 ):
positions.append( wolfpack.coord( target.x, target.y + i, target.z, target.map ) )
# North South
else:
itemid = 0x398c
for i in range( -2, 3 ):
positions.append( wolfpack.coord( target.x + i, target.y, target.z, target.map ) )
serials = []
char.soundeffect( 0x20c )
for pos in positions:
newitem = wolfpack.newitem( 1 )
newitem.id = itemid
newitem.moveto( pos )
newitem.decay = 0 # Dont decay. TempEffect will take care of them
newitem.settag( 'dispellable_field', 1 )
newitem.events = [ 'wolfpack.magic.firefield' ]
newitem.update()
serials.append( newitem.serial )
duration = int( ( 4 + char.skill[ MAGERY ] * 0.05 ) * 1000 )
wolfpack.addtimer( duration, "wolfpack.magic.utilities.field_expire", serials, 1 )
def onLoad():
#ArchCure().register( 25 )
#ArchProtection().register( 26 )
Curse().register( 27 )
FireField().register( 28 )
GreaterHeal().register( 29 )
Lightning().register( 30 )
ManaDrain().register( 31 )
Recall().register( 32 )
--- NEW FILE: circle5.py ---
from wolfpack.magic.spell import CharEffectSpell, Spell, DelayedDamageSpell
from wolfpack.magic.utilities import *
import random
import wolfpack
from wolfpack.utilities import tobackpack
def onLoad():
pass
--- NEW FILE: circle6.py ---
from wolfpack.magic.spell import CharEffectSpell, Spell, DelayedDamageSpell
from wolfpack.magic.utilities import *
import random
import wolfpack
from wolfpack.utilities import tobackpack
def onLoad():
pass
--- NEW FILE: circle7.py ---
from wolfpack.magic.spell import CharEffectSpell, Spell, DelayedDamageSpell
from wolfpack.magic.utilities import *
import random
import wolfpack
from wolfpack.utilities import tobackpack
def onLoad():
pass
--- NEW FILE: circle8.py ---
from wolfpack.magic.spell import CharEffectSpell, Spell, DelayedDamageSpell
from wolfpack.magic.utilities import *
import random
import wolfpack
from wolfpack.utilities import tobackpack
def onLoad():
pass
--- NEW FILE: firefield.py ---
import wolfpack
from wolfpack.consts import *
def onCollide( char, item ):
if not char.hastag( 'in_firefield' ):
char.settag( 'in_firefield' )
char.addtimer( 500, 'wolfpack.magic.firefield.expire', [] )
return 0
def expire( char, args ):
# Check if there is another firefield at the players location
items = wolfpack.items( char.pos.x, char.pos.y, char.pos.map, 0 )
for item in items:
if 'wolfpack.magic.firefield' in item.events:
char.damage( DAMAGE_MAGICAL, 5 )
char.addtimer( 500, 'wolfpack.magic.firefield.expire', [] )
char.char( 'You exited the Field' )
char.deltag( 'in_firefield' )
|
|
From: <co...@us...> - 2003-11-19 13:11:45
|
Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1:/tmp/cvs-serv26202
Modified Files:
player.cpp
Log Message:
Fixed problem with python events
Index: player.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/player.cpp,v
retrieving revision 1.45
retrieving revision 1.46
diff -C2 -d -r1.45 -r1.46
*** player.cpp 10 Oct 2003 21:13:46 -0000 1.45
--- player.cpp 19 Nov 2003 13:11:42 -0000 1.46
***************
*** 1322,1326 ****
if( scriptChain || global )
{
! PyObject *args = Py_BuildValue( "O&", PyGetCharObject, this );
result = cPythonScript::callChainedEventHandler( EVENT_LOGIN, scriptChain, args );
--- 1322,1326 ----
if( scriptChain || global )
{
! PyObject *args = Py_BuildValue( "(O&)", PyGetCharObject, this );
result = cPythonScript::callChainedEventHandler( EVENT_LOGIN, scriptChain, args );
***************
*** 1362,1366 ****
if( scriptChain || global )
{
! PyObject *args = Py_BuildValue( "O&", PyGetCharObject, this );
result = cPythonScript::callChainedEventHandler( EVENT_LOGOUT, scriptChain, args );
--- 1362,1366 ----
if( scriptChain || global )
{
! PyObject *args = Py_BuildValue( "(O&)", PyGetCharObject, this );
result = cPythonScript::callChainedEventHandler( EVENT_LOGOUT, scriptChain, args );
***************
*** 1383,1387 ****
if( scriptChain || global )
{
! PyObject *args = Py_BuildValue( "O&", PyGetCharObject, this );
result = cPythonScript::callChainedEventHandler( EVENT_HELP, scriptChain, args );
--- 1383,1387 ----
if( scriptChain || global )
{
! PyObject *args = Py_BuildValue( "(O&)", PyGetCharObject, this );
result = cPythonScript::callChainedEventHandler( EVENT_HELP, scriptChain, args );
***************
*** 1404,1408 ****
if( scriptChain || global )
{
! PyObject *args = Py_BuildValue( "O&", PyGetCharObject, this );
result = cPythonScript::callChainedEventHandler( EVENT_CHAT, scriptChain, args );
--- 1404,1408 ----
if( scriptChain || global )
{
! PyObject *args = Py_BuildValue( "(O&)", PyGetCharObject, this );
result = cPythonScript::callChainedEventHandler( EVENT_CHAT, scriptChain, args );
|
|
From: <co...@us...> - 2003-11-19 08:47:32
|
Update of /cvsroot/wpdev/wolfpack/python
In directory sc8-pr-cvs1:/tmp/cvs-serv19493/python
Modified Files:
socket.cpp utilities.h
Log Message:
Unicode sysmessages trough python implemented
Index: socket.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/python/socket.cpp,v
retrieving revision 1.44
retrieving revision 1.45
diff -C2 -d -r1.44 -r1.45
*** socket.cpp 23 Sep 2003 23:55:25 -0000 1.44
--- socket.cpp 19 Nov 2003 08:47:28 -0000 1.45
***************
*** 101,105 ****
return PyFalse;
! if( !checkArgStr( 0 ) )
{
PyErr_BadArgument();
--- 101,118 ----
return PyFalse;
! QString message;
! PyObject* param;
! if( PyTuple_Size( args ) > 0 )
! param = PyTuple_GetItem( args, 0 );
!
! if( checkArgStr( 0 ) )
! {
! message = PyString_AsString( param );
! }
! else if( checkArgUnicode( 0 ) )
! {
! message.setUnicodeCodes( PyUnicode_AsUnicode(param), PyUnicode_GetSize( param ) ) ;
! }
! else
{
PyErr_BadArgument();
***************
*** 107,111 ****
}
- QString message = PyString_AsString( PyTuple_GetItem( args, 0 ) );
UINT16 color = 0x37;
UINT16 font = 3;
--- 120,123 ----
Index: utilities.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/python/utilities.h,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -d -r1.23 -r1.24
*** utilities.h 23 Sep 2003 12:40:20 -0000 1.23
--- utilities.h 19 Nov 2003 08:47:29 -0000 1.24
***************
*** 119,122 ****
--- 119,123 ----
#define getArgInt( id ) PyInt_AsLong( PyTuple_GetItem( args, id ) )
#define checkArgStr( id ) ( PyTuple_Size( args ) > id && PyString_Check( PyTuple_GetItem( args, id ) ) )
+ #define checkArgUnicode( id ) ( PyTuple_Size( args ) > id && PyUnicode_Check( PyTuple_GetItem( args, id ) ) )
#define getArgStr( id ) PyString_AsString( PyTuple_GetItem( args, id ) )
#define checkArgAccount( id ) ( PyTuple_Size( args ) > id && checkWpAccount( PyTuple_GetItem( args, id ) ) )
|
|
From: <co...@us...> - 2003-11-15 20:55:19
|
Update of /cvsroot/wpdev/xmlscripts/scripts/skills
In directory sc8-pr-cvs1:/tmp/cvs-serv4929/scripts/skills
Modified Files:
__init__.py mining.py
Log Message:
AntiMacroCheck implemented
Index: __init__.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/skills/__init__.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** __init__.py 3 Oct 2003 16:21:10 -0000 1.6
--- __init__.py 15 Nov 2003 20:55:13 -0000 1.7
***************
*** 108,112 ****
! def checkskill( char, skillid, chance ):
if char.dead:
return OOPS
--- 108,112 ----
! def checkskill( char, targetobject, skillid, chance ):
if char.dead:
return OOPS
***************
*** 128,132 ****
gainchance = 0.01
! if gainchance >= whrandom.random() or skillvalue < 100:
skillgain( char, skillid )
--- 128,133 ----
gainchance = 0.01
! #If you lucky and antimacro is agree so let's gain this skill
! if ( gainchance >= whrandom.random() and antimacrocheck( char, skillid, targetobject ) ) or skillvalue < 100:
skillgain( char, skillid )
***************
*** 168,172 ****
- char.update()
return OK
--- 169,172 ----
***************
*** 181,191 ****
if stat == STRENGTH:
char.strength = char.strength + 1
- char.updatestats()
elif stat == DEXTERITY:
char.dexterity = char.dexterity + 1
- char.updatestats()
elif stat == INTELLIGENCE:
char.intelligence = char.intelligence + 1
- char.updatestats()
return OK
--- 181,188 ----
***************
*** 199,200 ****
--- 196,216 ----
def totalstats( char ):
return char.strength + char.dexterity + char.intelligence
+
+ def antimacrocheck( char, skillid, object ):
+ #Get or set antimacro tag: "AM" + SERIAL = COUNT
+ tagname = "AMAC" + str( char.serial ) + " " + str( skillid )
+ if object.hastag( tagname ):
+ count = object.gettag( tagname )
+ object.settag( tagname, count + 1 )
+ if count <= ANTIMACROALLOWANCE:
+ return OK
+ elif count > ANTIMACROALLOWANCE + 1:
+ return OOPS
+ else:
+ object.addtimer( ANTIMACRODELAY, "wolfpack.utilities.cleartag", [char, tagname] )
+ return OOPS
+ else:
+ object.settag( tagname, 1 )
+ return OK
+
+
Index: mining.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/skills/mining.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** mining.py 3 Oct 2003 16:21:10 -0000 1.5
--- mining.py 15 Nov 2003 20:55:13 -0000 1.6
***************
*** 34,86 ****
def mining( char, pos, tool ):
! socket = char.socket
!
! if char.hastag( 'mining_gem' ):
! veingem = wolfpack.finditem( char.gettag( 'mining_gem' ) )
! if not veingem:
! veingem = getvein( socket, pos )
! if not veingem:
! char.deltag( 'mining_gem' )
! return OOPS
! else:
! veingem = getvein( socket, pos )
! if not veingem:
! return OOPS
! else:
! char.settag( 'mining_gem', veingem.serial )
!
! if char.distanceto( veingem ) > MINING_MAX_DISTANCE:
! veingem = getvein( socket, pos )
!
! if not veingem:
! return OOPS
!
! if not veingem.hastag( 'resname' ) or not veingem.hastag( 'resourcecount' ):
! return OOPS
!
! resname = veingem.gettag( 'resname' ) # Sometimes mutated in colored ore and back
! resourcecount = veingem.gettag( 'resourcecount' )
! reqskill = oretable[ resname ][ REQSKILL ]
!
! success = 0
! char.addtimer( 1400, "skills.mining.effecttimer", [oresound] )
char.settag( 'is_mining', servertime() + miningdelay )
char.turnto( pos )
char.action( 11 )
- # Are you skilled enough ? And here is ore ?
- if resourcecount > 2 and char.skill[ MINING ] > reqskill:
- # Anyway you haven't 100% chance to get something :)
- if char.skill[ MINING ] > reqskill:
- if whrandom.randint( oretable[ resname ][ MINSKILL ], oretable[ resname ][ MAXSKILL ] ) < char.skill[ MINING ]:
- if whrandom.random() < 0.9:
- success = 1
- skills.successharvest( char, veingem, oretable, resname, 1 ) # 1 - amount of ore
- skills.checkskill( char, MINING, 0 )
-
- if success == 0:
- socket.clilocmessage( 501869, "", GRAY, NORMAL ) # You loosen some rocks but fail to find any usable ore.
-
- char.deltag('nowmining')
return OK
--- 34,42 ----
def mining( char, pos, tool ):
! char.addtimer( 1300, "skills.mining.domining", [oresound,tool,pos] )
char.settag( 'is_mining', servertime() + miningdelay )
char.turnto( pos )
char.action( 11 )
return OK
***************
*** 153,157 ****
#Sound effect
! def effecttimer( char, args ):
char.soundeffect( args[0] )
return OK
--- 109,162 ----
#Sound effect
! def domining( char, args ):
char.soundeffect( args[0] )
+ tool = args[1]
+ pos = args[2]
+ socket = char.socket
+
+ if char.hastag( 'mining_gem' ):
+ veingem = wolfpack.finditem( char.gettag( 'mining_gem' ) )
+ if not veingem:
+ veingem = getvein( socket, pos )
+ if not veingem:
+ char.deltag( 'mining_gem' )
+ return OOPS
+ else:
+ veingem = getvein( socket, pos )
+ if not veingem:
+ return OOPS
+ else:
+ char.settag( 'mining_gem', veingem.serial )
+
+ if char.distanceto( veingem ) > MINING_MAX_DISTANCE:
+ veingem = getvein( socket, pos )
+
+ if not veingem:
+ return OOPS
+
+ if not veingem.hastag( 'resname' ) or not veingem.hastag( 'resourcecount' ):
+ return OOPS
+
+ resname = veingem.gettag( 'resname' ) # Sometimes mutated in colored ore and back
+ resourcecount = veingem.gettag( 'resourcecount' )
+ reqskill = oretable[ resname ][ REQSKILL ]
+
+ success = 0
+ char.update()
+ char.updatestats()
+
+ # Are you skilled enough ? And here is ore ?
+ if resourcecount > 2 and ( char.skill[ MINING ] >= reqskill or char.skill[ MINING ] <= 100 ):
+ skills.checkskill( char, veingem, MINING, 0 )
+ if whrandom.random() > 0.7:
+ skills.successharvest( char, veingem, oretable, resname, 1 ) # 1 - amount of ore
+ success = 1
+
+
+
+ if success == 0:
+ socket.clilocmessage( 501869, "", GRAY, NORMAL ) # You loosen some rocks but fail to find any usable ore.
+
+ char.deltag('nowmining')
+
return OK
|
|
From: <co...@us...> - 2003-11-15 20:55:18
|
Update of /cvsroot/wpdev/xmlscripts/scripts/wolfpack In directory sc8-pr-cvs1:/tmp/cvs-serv4929/scripts/wolfpack Modified Files: consts.py utilities.py Log Message: AntiMacroCheck implemented Index: consts.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/wolfpack/consts.py,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** consts.py 8 Oct 2003 01:56:08 -0000 1.33 --- consts.py 15 Nov 2003 20:55:13 -0000 1.34 *************** *** 357,358 **** --- 357,363 ---- RELOAD_CONFIGURATION = 3 SAVE_WORLD = 4 + + #5 minutes + ANTIMACRODELAY = 300000 + #3 uses of object + ANTIMACROALLOWANCE = 3 Index: utilities.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/wolfpack/utilities.py,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** utilities.py 29 Sep 2003 17:15:20 -0000 1.19 --- utilities.py 15 Nov 2003 20:55:14 -0000 1.20 *************** *** 270,271 **** --- 270,277 ---- range( 1635, 1642 ) + \ range( 1647, 1650 ) + + def cleartag( self, args ): + char = args[0] + tagname = args[1] + self.deltag( tagname ) + return OK |
|
From: <co...@us...> - 2003-11-12 15:51:07
|
Update of /cvsroot/wpdev/xmlscripts/scripts
In directory sc8-pr-cvs1:/tmp/cvs-serv32742
Modified Files:
xmlconfig.py
Log Message:
Writing is working
Index: xmlconfig.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/xmlconfig.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** xmlconfig.py 12 Nov 2003 15:49:16 -0000 1.4
--- xmlconfig.py 12 Nov 2003 15:50:43 -0000 1.5
***************
*** 58,62 ****
self.parent = parent
self.groups = []
! self.xmlname = 'wolfpack.xml'
self.sc = Pmw.ScrolledCanvas(parent,
borderframe = 1,
--- 58,62 ----
self.parent = parent
self.groups = []
! self.xmlname = '../wolfpack.xml'
self.sc = Pmw.ScrolledCanvas(parent,
borderframe = 1,
|
|
From: <co...@us...> - 2003-11-12 15:49:40
|
Update of /cvsroot/wpdev/xmlscripts/scripts
In directory sc8-pr-cvs1:/tmp/cvs-serv32473
Modified Files:
xmlconfig.py
Log Message:
Writing is working
Index: xmlconfig.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/xmlconfig.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** xmlconfig.py 11 Nov 2003 22:23:36 -0000 1.3
--- xmlconfig.py 12 Nov 2003 15:49:16 -0000 1.4
***************
*** 12,17 ****
--- 12,20 ----
self.choices = choices
+
class ConfigGroup:
def __init__(self, parent, y, text, options):
+ self.entries = []
+ self.text = text
self.gr = Pmw.Group( parent.interior(),
tag_text = text,
***************
*** 32,35 ****
--- 35,39 ----
entry.pack(fill='both',expand=1,pady=5,padx=5)
self.height += 40
+ self.entries.append( entry )
else:
entry = Pmw.EntryField(self.gr.interior(),
***************
*** 41,44 ****
--- 45,49 ----
entry.pack(fill='both',expand=1,pady=5,padx=5)
self.height += 40
+ self.entries.append( entry )
parent.create_window(1, y,width=300,height=self.height,anchor='nw',window = self.gr)
***************
*** 50,53 ****
--- 55,61 ----
class XMLConfig:
def __init__(self, parent):
+ self.resutl = ''
+ self.parent = parent
+ self.groups = []
self.xmlname = 'wolfpack.xml'
self.sc = Pmw.ScrolledCanvas(parent,
***************
*** 84,109 ****
opts.append( Option( op.getAttribute('key'), value, choices ) )
cfg = ConfigGroup( self.sc, y, gr.getAttribute('name'), opts )
y += cfg.height + 5
opts = []
-
self.sc.pack(padx = 5, pady = 5, fill = 'both', expand = 1)
self.sc.resizescrollregion()
!
! def writeXML(self):
! dom = Document()
! all = dom.createElement("preferences")
! all.setAttribute('version','1.0')
! all.setAttribute('application','Wolfpack')
! sub = dom.createElement("group")
! sub.setAttribute('name','AI')
! all.appendChild(sub)
! dom.appendChild(all)
! file = open(filename,'w')
! file.write("<!DOCTYPE preferences>\n")
! file.write(dom.toprettyxml())
! file.flush()
! file.close()
if __name__ == '__main__':
--- 92,148 ----
opts.append( Option( op.getAttribute('key'), value, choices ) )
cfg = ConfigGroup( self.sc, y, gr.getAttribute('name'), opts )
+ self.groups.append( cfg )
y += cfg.height + 5
opts = []
self.sc.pack(padx = 5, pady = 5, fill = 'both', expand = 1)
self.sc.resizescrollregion()
! def writexml(self):
! self.dialog = Pmw.MessageDialog(self.parent,
! buttons = ('OK','Cancel'),
! message_text = 'Save changes ?',
! defaultbutton = 'OK',
! title = 'My dialog',
! command = self.execute)
! self.dialog.withdraw()
! self.dialog.activate(geometry = 'centerscreenalways')
!
! if self.result == 'OK':
! self.dialog.deactivate(self.result)
! dom = Document()
! all = dom.createElement("preferences")
! all.setAttribute('version','1.0')
! all.setAttribute('application','Wolfpack')
! for gr in self.groups:
! entries = gr.entries
! groupname = gr.text
! xgr = dom.createElement('group')
! xgr.setAttribute('name',groupname)
! for en in entries:
! labeltext = en['label_text']
! try:
! value = en['value']
! except:
! value = str(en.get())
! xop = dom.createElement('option')
! xop.setAttribute('key',labeltext)
! xop.setAttribute('value',value)
! xgr.appendChild(xop)
!
! all.appendChild(xgr)
!
! all.appendChild(xgr)
! dom.appendChild(all)
! file = open(self.xmlname,'w')
! file.write("<!DOCTYPE preferences>\n")
! file.write(dom.toprettyxml())
! file.flush()
! file.close()
!
! def execute(self, result):
! self.result = result
! self.dialog.deactivate(result)
!
if __name__ == '__main__':
***************
*** 112,118 ****
root.title('Wolfpack configurator')
! exitButton = Tkinter.Button(root, text = 'Exit', command = root.destroy)
! exitButton.pack(side = 'bottom')
! widget = XMLConfig(root)
root.mainloop()
--- 151,161 ----
root.title('Wolfpack configurator')
! config = XMLConfig(root)
! saveButton = Tkinter.Button(root, text = 'Save changes', command = config.writexml)
! saveButton.pack(pady = 5, padx = 5)
! exitButton = Tkinter.Button(root, text = 'Exit configurator', command = root.destroy)
! exitButton.pack(pady = 5, padx = 5)
!
!
root.mainloop()
|
|
From: <co...@us...> - 2003-11-11 22:23:39
|
Update of /cvsroot/wpdev/xmlscripts/scripts In directory sc8-pr-cvs1:/tmp/cvs-serv17476 Modified Files: xmlconfig.py Log Message: no message Index: xmlconfig.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/xmlconfig.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** xmlconfig.py 11 Nov 2003 21:52:51 -0000 1.2 --- xmlconfig.py 11 Nov 2003 22:23:36 -0000 1.3 *************** *** 1,6 **** from xml.dom.minidom import * ! import Tkinter import Pmw class Option: --- 1,8 ---- from xml.dom.minidom import * ! import sys ! sys.path[:0] = ['../python-lib/'] import Pmw + import Tkinter class Option: *************** *** 17,21 **** ) self.y = y ! self.height = 10 for op in options: if len( op.choices ) > 0: --- 19,23 ---- ) self.y = y ! self.height = 20 for op in options: if len( op.choices ) > 0: |
Update of /cvsroot/wpdev/xmlscripts/python-lib/Pmw/Pmw_1_2/lib
In directory sc8-pr-cvs1:/tmp/cvs-serv17003/Pmw_1_2/lib
Added Files:
__init__.py Pmw.def PmwAboutDialog.py PmwBalloon.py PmwBase.py
PmwBlt.py PmwButtonBox.py PmwColor.py PmwComboBox.py
PmwComboBoxDialog.py PmwCounter.py PmwCounterDialog.py
PmwDialog.py PmwEntryField.py PmwGroup.py PmwHistoryText.py
PmwLabeledWidget.py PmwLoader.py PmwLogicalFont.py
PmwMainMenuBar.py PmwMenuBar.py PmwMessageBar.py
PmwMessageDialog.py PmwNoteBook.py PmwOptionMenu.py
PmwPanedWidget.py PmwPromptDialog.py PmwRadioSelect.py
PmwScrolledCanvas.py PmwScrolledField.py PmwScrolledFrame.py
PmwScrolledListBox.py PmwScrolledText.py PmwSelectionDialog.py
PmwTextDialog.py PmwTimeCounter.py PmwTimeFuncs.py
Log Message:
pmw class wrapers for Tkinter
--- NEW FILE: __init__.py ---
# File to allow this directory to be treated as a python package.
--- NEW FILE: Pmw.def ---
# [Emacs: -*- python -*-]
# --- This is the Pmw definition file ---
#
# It is invoked by the Pmw dynamic loader in Pmw.__init__.
#
# widgets : tuple with the names of those widget classes that are
# stacked in a module of the same name.
# widgetclasses : dictionary from names of widget classes to module names.
# functions : dictionary from function names to modules names.
# modules : tuple of module names that don't contain widget classes
# of the same name.
#
# Widgets whose name is the same as its module.
_widgets = (
'AboutDialog', 'Balloon', 'ButtonBox', 'ComboBox',
'ComboBoxDialog', 'Counter', 'CounterDialog', 'Dialog',
'EntryField', 'Group', 'HistoryText', 'LabeledWidget',
'MainMenuBar', 'MenuBar', 'MessageBar',
'MessageDialog', 'NoteBook', 'OptionMenu', 'PanedWidget',
'PromptDialog', 'RadioSelect', 'ScrolledCanvas', 'ScrolledField',
'ScrolledFrame', 'ScrolledListBox', 'ScrolledText', 'SelectionDialog',
'TextDialog', 'TimeCounter',
)
# Widgets whose name is not the same as its module.
_extraWidgets = {
}
_functions = {
'logicalfont' : 'LogicalFont',
'logicalfontnames' : 'LogicalFont',
'aboutversion' : 'AboutDialog',
'aboutcopyright' : 'AboutDialog',
'aboutcontact' : 'AboutDialog',
'datestringtojdn' : 'TimeFuncs',
'timestringtoseconds' : 'TimeFuncs',
'setyearpivot' : 'TimeFuncs',
'ymdtojdn' : 'TimeFuncs',
'jdntoymd' : 'TimeFuncs',
'stringtoreal' : 'TimeFuncs',
'aligngrouptags' : 'Group',
'OK' : 'EntryField',
'ERROR' : 'EntryField',
'PARTIAL' : 'EntryField',
'numericvalidator' : 'EntryField',
'integervalidator' : 'EntryField',
'hexadecimalvalidator' : 'EntryField',
'realvalidator' : 'EntryField',
'alphabeticvalidator' : 'EntryField',
'alphanumericvalidator' : 'EntryField',
'timevalidator' : 'EntryField',
'datevalidator' : 'EntryField',
}
_modules = (
'Color', 'Blt',
)
--- NEW FILE: PmwAboutDialog.py ---
import Pmw
class AboutDialog(Pmw.MessageDialog):
# Window to display version and contact information.
# Class members containing resettable 'default' values:
_version = ''
_copyright = ''
_contact = ''
def __init__(self, parent = None, **kw):
# Define the megawidget options.
INITOPT = Pmw.INITOPT
optiondefs = (
('applicationname', '', INITOPT),
('iconpos', 'w', None),
('icon_bitmap', 'info', None),
('buttons', ('Close',), None),
('defaultbutton', 0, None),
)
self.defineoptions(kw, optiondefs)
# Initialise the base class (after defining the options).
Pmw.MessageDialog.__init__(self, parent)
applicationname = self['applicationname']
if not kw.has_key('title'):
self.configure(title = 'About ' + applicationname)
if not kw.has_key('message_text'):
text = applicationname + '\n\n'
if AboutDialog._version != '':
text = text + 'Version ' + AboutDialog._version + '\n'
if AboutDialog._copyright != '':
text = text + AboutDialog._copyright + '\n\n'
if AboutDialog._contact != '':
text = text + AboutDialog._contact
self.configure(message_text=text)
# Check keywords and initialise options.
self.initialiseoptions()
def aboutversion(value):
AboutDialog._version = value
def aboutcopyright(value):
AboutDialog._copyright = value
def aboutcontact(value):
AboutDialog._contact = value
--- NEW FILE: PmwBalloon.py ---
import os
import string
import Tkinter
import Pmw
class Balloon(Pmw.MegaToplevel):
def __init__(self, parent = None, **kw):
# Define the megawidget options.
optiondefs = (
('initwait', 500, None), # milliseconds
('label_background', 'lightyellow', None),
('label_foreground', 'black', None),
('label_justify', 'left', None),
('master', 'parent', None),
('relmouse', 'none', self._relmouse),
('state', 'both', self._state),
('statuscommand', None, None),
('xoffset', 20, None), # pixels
('yoffset', 1, None), # pixels
('hull_highlightthickness', 1, None),
('hull_highlightbackground', 'black', None),
)
self.defineoptions(kw, optiondefs)
# Initialise the base class (after defining the options).
Pmw.MegaToplevel.__init__(self, parent)
self.withdraw()
self.overrideredirect(1)
# Create the components.
interior = self.interior()
self._label = self.createcomponent('label',
(), None,
Tkinter.Label, (interior,))
self._label.pack()
# The default hull configuration options give a black border
# around the balloon, but avoids a black 'flash' when the
# balloon is deiconified, before the text appears.
if not kw.has_key('hull_background'):
self.configure(hull_background = \
str(self._label.cget('background')))
# Initialise instance variables.
self._timer = None
# The widget or item that is currently triggering the balloon.
# It is None if the balloon is not being displayed. It is a
# one-tuple if the balloon is being displayed in response to a
# widget binding (value is the widget). It is a two-tuple if
# the balloon is being displayed in response to a canvas or
# text item binding (value is the widget and the item).
self._currentTrigger = None
# Check keywords and initialise options.
self.initialiseoptions()
def destroy(self):
if self._timer is not None:
self.after_cancel(self._timer)
self._timer = None
Pmw.MegaToplevel.destroy(self)
def bind(self, widget, balloonHelp, statusHelp = None):
# If a previous bind for this widget exists, remove it.
self.unbind(widget)
if balloonHelp is None and statusHelp is None:
return
if statusHelp is None:
statusHelp = balloonHelp
enterId = widget.bind('<Enter>',
lambda event, self = self, w = widget,
sHelp = statusHelp, bHelp = balloonHelp:
self._enter(event, w, sHelp, bHelp, 0))
# Set Motion binding so that if the pointer remains at rest
# within the widget until the status line removes the help and
# then the pointer moves again, then redisplay the help in the
# status line.
# Note: The Motion binding only works for basic widgets, and
# the hull of megawidgets but not for other megawidget components.
motionId = widget.bind('<Motion>',
lambda event = None, self = self, statusHelp = statusHelp:
self.showstatus(statusHelp))
leaveId = widget.bind('<Leave>', self._leave)
buttonId = widget.bind('<ButtonPress>', self._buttonpress)
# Set Destroy binding so that the balloon can be withdrawn and
# the timer can be cancelled if the widget is destroyed.
destroyId = widget.bind('<Destroy>', self._destroy)
# Use the None item in the widget's private Pmw dictionary to
# store the widget's bind callbacks, for later clean up.
if not hasattr(widget, '_Pmw_BalloonBindIds'):
widget._Pmw_BalloonBindIds = {}
widget._Pmw_BalloonBindIds[None] = \
(enterId, motionId, leaveId, buttonId, destroyId)
def unbind(self, widget):
if hasattr(widget, '_Pmw_BalloonBindIds'):
if widget._Pmw_BalloonBindIds.has_key(None):
(enterId, motionId, leaveId, buttonId, destroyId) = \
widget._Pmw_BalloonBindIds[None]
# Need to pass in old bindings, so that Tkinter can
# delete the commands. Otherwise, memory is leaked.
widget.unbind('<Enter>', enterId)
widget.unbind('<Motion>', motionId)
widget.unbind('<Leave>', leaveId)
widget.unbind('<ButtonPress>', buttonId)
widget.unbind('<Destroy>', destroyId)
del widget._Pmw_BalloonBindIds[None]
if self._currentTrigger is not None and len(self._currentTrigger) == 1:
# The balloon is currently being displayed and the current
# trigger is a widget.
triggerWidget = self._currentTrigger[0]
if triggerWidget == widget:
if self._timer is not None:
self.after_cancel(self._timer)
self._timer = None
self.withdraw()
self.clearstatus()
self._currentTrigger = None
def tagbind(self, widget, tagOrItem, balloonHelp, statusHelp = None):
# If a previous bind for this widget's tagOrItem exists, remove it.
self.tagunbind(widget, tagOrItem)
if balloonHelp is None and statusHelp is None:
return
if statusHelp is None:
statusHelp = balloonHelp
enterId = widget.tag_bind(tagOrItem, '<Enter>',
lambda event, self = self, w = widget,
sHelp = statusHelp, bHelp = balloonHelp:
self._enter(event, w, sHelp, bHelp, 1))
motionId = widget.tag_bind(tagOrItem, '<Motion>',
lambda event = None, self = self, statusHelp = statusHelp:
self.showstatus(statusHelp))
leaveId = widget.tag_bind(tagOrItem, '<Leave>', self._leave)
buttonId = widget.tag_bind(tagOrItem, '<ButtonPress>', self._buttonpress)
# Use the tagOrItem item in the widget's private Pmw dictionary to
# store the tagOrItem's bind callbacks, for later clean up.
if not hasattr(widget, '_Pmw_BalloonBindIds'):
widget._Pmw_BalloonBindIds = {}
widget._Pmw_BalloonBindIds[tagOrItem] = \
(enterId, motionId, leaveId, buttonId)
def tagunbind(self, widget, tagOrItem):
if hasattr(widget, '_Pmw_BalloonBindIds'):
if widget._Pmw_BalloonBindIds.has_key(tagOrItem):
(enterId, motionId, leaveId, buttonId) = \
widget._Pmw_BalloonBindIds[tagOrItem]
widget.tag_unbind(tagOrItem, '<Enter>', enterId)
widget.tag_unbind(tagOrItem, '<Motion>', motionId)
widget.tag_unbind(tagOrItem, '<Leave>', leaveId)
widget.tag_unbind(tagOrItem, '<ButtonPress>', buttonId)
del widget._Pmw_BalloonBindIds[tagOrItem]
if self._currentTrigger is None:
# The balloon is not currently being displayed.
return
if len(self._currentTrigger) == 1:
# The current trigger is a widget.
return
if len(self._currentTrigger) == 2:
# The current trigger is a canvas item.
(triggerWidget, triggerItem) = self._currentTrigger
if triggerWidget == widget and triggerItem == tagOrItem:
if self._timer is not None:
self.after_cancel(self._timer)
self._timer = None
self.withdraw()
self.clearstatus()
self._currentTrigger = None
else: # The current trigger is a text item.
(triggerWidget, x, y) = self._currentTrigger
if triggerWidget == widget:
currentPos = widget.index('@%d,%d' % (x, y))
currentTags = widget.tag_names(currentPos)
if tagOrItem in currentTags:
if self._timer is not None:
self.after_cancel(self._timer)
self._timer = None
self.withdraw()
self.clearstatus()
self._currentTrigger = None
def showstatus(self, statusHelp):
if self['state'] in ('status', 'both'):
cmd = self['statuscommand']
if callable(cmd):
cmd(statusHelp)
def clearstatus(self):
self.showstatus(None)
def _state(self):
if self['state'] not in ('both', 'balloon', 'status', 'none'):
raise ValueError, 'bad state option ' + repr(self['state']) + \
': should be one of \'both\', \'balloon\', ' + \
'\'status\' or \'none\''
def _relmouse(self):
if self['relmouse'] not in ('both', 'x', 'y', 'none'):
raise ValueError, 'bad relmouse option ' + repr(self['relmouse'])+ \
': should be one of \'both\', \'x\', ' + '\'y\' or \'none\''
def _enter(self, event, widget, statusHelp, balloonHelp, isItem):
# Do not display balloon if mouse button is pressed. This
# will only occur if the button was pressed inside a widget,
# then the mouse moved out of and then back into the widget,
# with the button still held down. The number 0x1f00 is the
# button mask for the 5 possible buttons in X.
buttonPressed = (event.state & 0x1f00) != 0
if not buttonPressed and balloonHelp is not None and \
self['state'] in ('balloon', 'both'):
if self._timer is not None:
self.after_cancel(self._timer)
self._timer = None
self._timer = self.after(self['initwait'],
lambda self = self, widget = widget, help = balloonHelp,
isItem = isItem:
self._showBalloon(widget, help, isItem))
if isItem:
if hasattr(widget, 'canvasx'):
# The widget is a canvas.
item = widget.find_withtag('current')
if len(item) > 0:
item = item[0]
else:
item = None
self._currentTrigger = (widget, item)
else:
# The widget is a text widget.
self._currentTrigger = (widget, event.x, event.y)
else:
self._currentTrigger = (widget,)
self.showstatus(statusHelp)
def _leave(self, event):
if self._timer is not None:
self.after_cancel(self._timer)
self._timer = None
self.withdraw()
self.clearstatus()
self._currentTrigger = None
def _destroy(self, event):
# Only withdraw the balloon and cancel the timer if the widget
# being destroyed is the widget that triggered the balloon.
# Note that in a Tkinter Destroy event, the widget field is a
# string and not a widget as usual.
if self._currentTrigger is None:
# The balloon is not currently being displayed
return
if len(self._currentTrigger) == 1:
# The current trigger is a widget (not an item)
triggerWidget = self._currentTrigger[0]
if str(triggerWidget) == event.widget:
if self._timer is not None:
self.after_cancel(self._timer)
self._timer = None
self.withdraw()
self.clearstatus()
self._currentTrigger = None
def _buttonpress(self, event):
if self._timer is not None:
self.after_cancel(self._timer)
self._timer = None
self.withdraw()
self._currentTrigger = None
def _showBalloon(self, widget, balloonHelp, isItem):
self._label.configure(text = balloonHelp)
# First, display the balloon offscreen to get dimensions.
screenWidth = self.winfo_screenwidth()
screenHeight = self.winfo_screenheight()
self.geometry('+%d+0' % (screenWidth + 1))
self.update_idletasks()
if isItem:
# Get the bounding box of the current item.
bbox = widget.bbox('current')
if bbox is None:
# The item that triggered the balloon has disappeared,
# perhaps by a user's timer event that occured between
# the <Enter> event and the 'initwait' timer calling
# this method.
return
# The widget is either a text or canvas. The meaning of
# the values returned by the bbox method is different for
# each, so use the existence of the 'canvasx' method to
# distinguish between them.
if hasattr(widget, 'canvasx'):
# The widget is a canvas. Place balloon under canvas
# item. The positions returned by bbox are relative
# to the entire canvas, not just the visible part, so
# need to convert to window coordinates.
leftrel = bbox[0] - widget.canvasx(0)
toprel = bbox[1] - widget.canvasy(0)
bottomrel = bbox[3] - widget.canvasy(0)
else:
# The widget is a text widget. Place balloon under
# the character closest to the mouse. The positions
# returned by bbox are relative to the text widget
# window (ie the visible part of the text only).
leftrel = bbox[0]
toprel = bbox[1]
bottomrel = bbox[1] + bbox[3]
else:
leftrel = 0
toprel = 0
bottomrel = widget.winfo_height()
xpointer, ypointer = widget.winfo_pointerxy() # -1 if off screen
if xpointer >= 0 and self['relmouse'] in ('both', 'x'):
x = xpointer
else:
x = leftrel + widget.winfo_rootx()
x = x + self['xoffset']
if ypointer >= 0 and self['relmouse'] in ('both', 'y'):
y = ypointer
else:
y = bottomrel + widget.winfo_rooty()
y = y + self['yoffset']
edges = (string.atoi(str(self.cget('hull_highlightthickness'))) +
string.atoi(str(self.cget('hull_borderwidth')))) * 2
if x + self._label.winfo_reqwidth() + edges > screenWidth:
x = screenWidth - self._label.winfo_reqwidth() - edges
if y + self._label.winfo_reqheight() + edges > screenHeight:
if ypointer >= 0 and self['relmouse'] in ('both', 'y'):
y = ypointer
else:
y = toprel + widget.winfo_rooty()
y = y - self._label.winfo_reqheight() - self['yoffset'] - edges
Pmw.setgeometryanddeiconify(self, '+%d+%d' % (x, y))
--- NEW FILE: PmwBase.py ---
# Pmw megawidget base classes.
# This module provides a foundation for building megawidgets. It
# contains the MegaArchetype class which manages component widgets and
# configuration options. Also provided are the MegaToplevel and
# MegaWidget classes, derived from the MegaArchetype class. The
# MegaToplevel class contains a Tkinter Toplevel widget to act as the
# container of the megawidget. This is used as the base class of all
# megawidgets that are contained in their own top level window, such
# as a Dialog window. The MegaWidget class contains a Tkinter Frame
# to act as the container of the megawidget. This is used as the base
# class of all other megawidgets, such as a ComboBox or ButtonBox.
#
# Megawidgets are built by creating a class that inherits from either
# the MegaToplevel or MegaWidget class.
import os
import string
import sys
[...1894 lines suppressed...]
text = self._errorQueue[0]
del self._errorQueue[0]
self._display(text)
self._updateButtons()
def _display(self, text):
self._errorCount = self._errorCount + 1
text = 'Error: %d\n%s' % (self._errorCount, text)
self._text.delete('1.0', 'end')
self._text.insert('end', text)
def _updateButtons(self):
numQueued = len(self._errorQueue)
if numQueued > 0:
self._label.configure(text='%d more errors' % numQueued)
self._nextError.configure(state='normal')
else:
self._label.configure(text='No more errors')
self._nextError.configure(state='disabled')
--- NEW FILE: PmwBlt.py ---
# Python interface to some of the commands of the 2.4 version of the
# BLT extension to tcl.
import string
import types
import Tkinter
# Supported commands:
_busyCommand = '::blt::busy'
_vectorCommand = '::blt::vector'
_graphCommand = '::blt::graph'
_testCommand = '::blt::*'
_chartCommand = '::blt::stripchart'
_tabsetCommand = '::blt::tabset'
_haveBlt = None
_haveBltBusy = None
def _checkForBlt(window):
global _haveBlt
global _haveBltBusy
# Blt may be a package which has not yet been loaded. Try to load it.
try:
window.tk.call('package', 'require', 'BLT')
except Tkinter.TclError:
# Another way to try to dynamically load blt:
try:
window.tk.call('load', '', 'Blt')
except Tkinter.TclError:
pass
_haveBlt= (window.tk.call('info', 'commands', _testCommand) != '')
_haveBltBusy = (window.tk.call('info', 'commands', _busyCommand) != '')
def haveblt(window):
if _haveBlt is None:
_checkForBlt(window)
return _haveBlt
def havebltbusy(window):
if _haveBlt is None:
_checkForBlt(window)
return _haveBltBusy
def _loadBlt(window):
if _haveBlt is None:
if window is None:
window = Tkinter._default_root
if window is None:
window = Tkinter.Tk()
_checkForBlt(window)
def busy_hold(window, cursor = None):
_loadBlt(window)
if cursor is None:
window.tk.call(_busyCommand, 'hold', window._w)
else:
window.tk.call(_busyCommand, 'hold', window._w, '-cursor', cursor)
def busy_release(window):
_loadBlt(window)
window.tk.call(_busyCommand, 'release', window._w)
def busy_forget(window):
_loadBlt(window)
window.tk.call(_busyCommand, 'forget', window._w)
#=============================================================================
# Interface to the blt vector command which makes it look like the
# builtin python list type.
# The -variable, -command, -watchunset creation options are not supported.
# The dup, merge, notify, offset, populate, seq and variable methods
# and the +, -, * and / operations are not supported.
# Blt vector functions:
def vector_expr(expression):
tk = Tkinter._default_root.tk
strList = tk.splitlist(tk.call(_vectorCommand, 'expr', expression))
return tuple(map(string.atof, strList))
def vector_names(pattern = None):
tk = Tkinter._default_root.tk
return tk.splitlist(tk.call(_vectorCommand, 'names', pattern))
class Vector:
_varnum = 0
def __init__(self, size=None, master=None):
# <size> can be either an integer size, or a string "first:last".
_loadBlt(master)
if master:
self._master = master
else:
self._master = Tkinter._default_root
self.tk = self._master.tk
self._name = 'PY_VEC' + str(Vector._varnum)
Vector._varnum = Vector._varnum + 1
if size is None:
self.tk.call(_vectorCommand, 'create', self._name)
else:
self.tk.call(_vectorCommand, 'create', '%s(%s)' % (self._name, size))
def __del__(self):
self.tk.call(_vectorCommand, 'destroy', self._name)
def __str__(self):
return self._name
def __repr__(self):
return '[' + string.join(map(str, self), ', ') + ']'
def __cmp__(self, list):
return cmp(self[:], list)
def __len__(self):
return self.tk.getint(self.tk.call(self._name, 'length'))
def __getitem__(self, key):
oldkey = key
if key < 0:
key = key + len(self)
try:
return self.tk.getdouble(self.tk.globalgetvar(self._name, str(key)))
except Tkinter.TclError:
raise IndexError, oldkey
def __setitem__(self, key, value):
if key < 0:
key = key + len(self)
return self.tk.globalsetvar(self._name, str(key), float(value))
def __delitem__(self, key):
if key < 0:
key = key + len(self)
return self.tk.globalunsetvar(self._name, str(key))
def __getslice__(self, start, end):
length = len(self)
if start < 0:
start = 0
if end > length:
end = length
if start >= end:
return []
end = end - 1 # Blt vector slices include end point.
text = self.tk.globalgetvar(self._name, str(start) + ':' + str(end))
return map(self.tk.getdouble, self.tk.splitlist(text))
def __setslice__(self, start, end, list):
if start > end:
end = start
self.set(self[:start] + list + self[end:])
def __delslice__(self, start, end):
if start < end:
self.set(self[:start] + self[end:])
def __add__(self, list):
return self[:] + list
def __radd__(self, list):
return list + self[:]
def __mul__(self, n):
return self[:] * n
__rmul__ = __mul__
# Python builtin list methods:
def append(self, *args):
self.tk.call(self._name, 'append', args)
def count(self, obj):
return self[:].count(obj)
def index(self, value):
return self[:].index(value)
def insert(self, index, value):
self[index:index] = [value]
def remove(self, value):
del self[self.index(value)]
def reverse(self):
s = self[:]
s.reverse()
self.set(s)
def sort(self, *args):
s = self[:]
s.sort()
self.set(s)
# Blt vector instance methods:
# append - same as list method above
def clear(self):
self.tk.call(self._name, 'clear')
def delete(self, *args):
self.tk.call((self._name, 'delete') + args)
def expr(self, expression):
self.tk.call(self._name, 'expr', expression)
def length(self, newSize=None):
return self.tk.getint(self.tk.call(self._name, 'length', newSize))
def range(self, first, last=None):
# Note that, unlike self[first:last], this includes the last
# item in the returned range.
text = self.tk.call(self._name, 'range', first, last)
return map(self.tk.getdouble, self.tk.splitlist(text))
def search(self, start, end=None):
return self._master._getints(self.tk.call(
self._name, 'search', start, end))
def set(self, list):
if type(list) != types.TupleType:
list = tuple(list)
self.tk.call(self._name, 'set', list)
# The blt vector sort method has different semantics to the python
# list sort method. Call these blt_sort:
def blt_sort(self, *args):
self.tk.call((self._name, 'sort') + args)
def blt_sort_reverse(self, *args):
self.tk.call((self._name, 'sort', '-reverse') + args)
# Special blt vector indexes:
def min(self):
return self.tk.getdouble(self.tk.globalgetvar(self._name, 'min'))
def max(self):
return self.tk.getdouble(self.tk.globalgetvar(self._name, 'max'))
# Method borrowed from Tkinter.Var class:
def get(self):
return self[:]
#=============================================================================
# This is a general purpose configure routine which can handle the
# configuration of widgets, items within widgets, etc. Supports the
# forms configure() and configure('font') for querying and
# configure(font = 'fixed', text = 'hello') for setting.
def _doConfigure(widget, subcommand, option, kw):
if not option and not kw:
# Return a description of all options.
ret = {}
options = widget.tk.splitlist(widget.tk.call(subcommand))
for optionString in options:
optionInfo = widget.tk.splitlist(optionString)
option = optionInfo[0][1:]
ret[option] = (option,) + optionInfo[1:]
return ret
if option:
# Return a description of the option given by <option>.
if kw:
# Having keywords implies setting configuration options.
# Can't set and get in one command!
raise ValueError, 'cannot have option argument with keywords'
option = '-' + option
optionInfo = widget.tk.splitlist(widget.tk.call(subcommand + (option,)))
return (optionInfo[0][1:],) + optionInfo[1:]
# Otherwise, set the given configuration options.
widget.tk.call(subcommand + widget._options(kw))
#=============================================================================
class Graph(Tkinter.Widget):
# Wrapper for the blt graph widget, version 2.4.
def __init__(self, master=None, cnf={}, **kw):
_loadBlt(master)
Tkinter.Widget.__init__(self, master, _graphCommand, cnf, kw)
def bar_create(self, name, **kw):
self.tk.call((self._w, 'bar', 'create', name) + self._options(kw))
def line_create(self, name, **kw):
self.tk.call((self._w, 'line', 'create', name) + self._options(kw))
def extents(self, item):
return self.tk.getint(self.tk.call(self._w, 'extents', item))
def invtransform(self, winX, winY):
return self._getdoubles(
self.tk.call(self._w, 'invtransform', winX, winY))
def inside(self, x, y):
return self.tk.getint(self.tk.call(self._w, 'inside', x, y))
def snap(self, photoName):
self.tk.call(self._w, 'snap', photoName)
def transform(self, x, y):
return self._getdoubles(self.tk.call(self._w, 'transform', x, y))
def axis_cget(self, axisName, key):
return self.tk.call(self._w, 'axis', 'cget', axisName, '-' + key)
def axis_configure(self, axes, option=None, **kw):
# <axes> may be a list of axisNames.
if type(axes) == types.StringType:
axes = [axes]
subcommand = (self._w, 'axis', 'configure') + tuple(axes)
return _doConfigure(self, subcommand, option, kw)
def axis_create(self, axisName, **kw):
self.tk.call((self._w, 'axis', 'create', axisName) + self._options(kw))
def axis_delete(self, *args):
self.tk.call((self._w, 'axis', 'delete') + args)
def axis_invtransform(self, axisName, value):
return self.tk.getdouble(self.tk.call(
self._w, 'axis', 'invtransform', axisName, value))
def axis_limits(self, axisName):
return self._getdoubles(self.tk.call(
self._w, 'axis', 'limits', axisName))
def axis_names(self, *args):
return self.tk.splitlist(
self.tk.call((self._w, 'axis', 'names') + args))
def axis_transform(self, axisName, value):
return self.tk.getint(self.tk.call(
self._w, 'axis', 'transform', axisName, value))
def xaxis_cget(self, key):
return self.tk.call(self._w, 'xaxis', 'cget', '-' + key)
def xaxis_configure(self, option=None, **kw):
subcommand = (self._w, 'xaxis', 'configure')
return _doConfigure(self, subcommand, option, kw)
def xaxis_invtransform(self, value):
return self.tk.getdouble(self.tk.call(
self._w, 'xaxis', 'invtransform', value))
def xaxis_limits(self):
return self._getdoubles(self.tk.call(self._w, 'xaxis', 'limits'))
def xaxis_transform(self, value):
return self.tk.getint(self.tk.call(
self._w, 'xaxis', 'transform', value))
def xaxis_use(self, axisName = None):
return self.tk.call(self._w, 'xaxis', 'use', axisName)
def x2axis_cget(self, key):
return self.tk.call(self._w, 'x2axis', 'cget', '-' + key)
def x2axis_configure(self, option=None, **kw):
subcommand = (self._w, 'x2axis', 'configure')
return _doConfigure(self, subcommand, option, kw)
def x2axis_invtransform(self, value):
return self.tk.getdouble(self.tk.call(
self._w, 'x2axis', 'invtransform', value))
def x2axis_limits(self):
return self._getdoubles(self.tk.call(self._w, 'x2axis', 'limits'))
def x2axis_transform(self, value):
return self.tk.getint(self.tk.call(
self._w, 'x2axis', 'transform', value))
def x2axis_use(self, axisName = None):
return self.tk.call(self._w, 'x2axis', 'use', axisName)
def yaxis_cget(self, key):
return self.tk.call(self._w, 'yaxis', 'cget', '-' + key)
def yaxis_configure(self, option=None, **kw):
subcommand = (self._w, 'yaxis', 'configure')
return _doConfigure(self, subcommand, option, kw)
def yaxis_invtransform(self, value):
return self.tk.getdouble(self.tk.call(
self._w, 'yaxis', 'invtransform', value))
def yaxis_limits(self):
return self._getdoubles(self.tk.call(self._w, 'yaxis', 'limits'))
def yaxis_transform(self, value):
return self.tk.getint(self.tk.call(
self._w, 'yaxis', 'transform', value))
def yaxis_use(self, axisName = None):
return self.tk.call(self._w, 'yaxis', 'use', axisName)
def y2axis_cget(self, key):
return self.tk.call(self._w, 'y2axis', 'cget', '-' + key)
def y2axis_configure(self, option=None, **kw):
subcommand = (self._w, 'y2axis', 'configure')
return _doConfigure(self, subcommand, option, kw)
def y2axis_invtransform(self, value):
return self.tk.getdouble(self.tk.call(
self._w, 'y2axis', 'invtransform', value))
def y2axis_limits(self):
return self._getdoubles(self.tk.call(self._w, 'y2axis', 'limits'))
def y2axis_transform(self, value):
return self.tk.getint(self.tk.call(
self._w, 'y2axis', 'transform', value))
def y2axis_use(self, axisName = None):
return self.tk.call(self._w, 'y2axis', 'use', axisName)
def crosshairs_cget(self, key):
return self.tk.call(self._w, 'crosshairs', 'cget', '-' + key)
def crosshairs_configure(self, option=None, **kw):
subcommand = (self._w, 'crosshairs', 'configure')
return _doConfigure(self, subcommand, option, kw)
def crosshairs_off(self):
self.tk.call(self._w, 'crosshairs', 'off')
def crosshairs_on(self):
self.tk.call(self._w, 'crosshairs', 'on')
def crosshairs_toggle(self):
self.tk.call(self._w, 'crosshairs', 'toggle')
def element_activate(self, name, *args):
self.tk.call((self._w, 'element', 'activate', name) + args)
def element_bind(self, tagName, sequence=None, func=None, add=None):
return self._bind((self._w, 'element', 'bind', tagName),
sequence, func, add)
def element_unbind(self, tagName, sequence, funcid=None):
self.tk.call(self._w, 'element', 'bind', tagName, sequence, '')
if funcid:
self.deletecommand(funcid)
def element_cget(self, name, key):
return self.tk.call(self._w, 'element', 'cget', name, '-' + key)
def element_closest(self, x, y, *args, **kw):
var = 'python_private_1'
success = self.tk.getint(self.tk.call(
(self._w, 'element', 'closest', x, y, var) +
self._options(kw) + args))
if success:
rtn = {}
rtn['dist'] = self.tk.getdouble(self.tk.globalgetvar(var, 'dist'))
rtn['x'] = self.tk.getdouble(self.tk.globalgetvar(var, 'x'))
rtn['y'] = self.tk.getdouble(self.tk.globalgetvar(var, 'y'))
rtn['index'] = self.tk.getint(self.tk.globalgetvar(var, 'index'))
rtn['name'] = self.tk.globalgetvar(var, 'name')
return rtn
else:
return None
def element_configure(self, names, option=None, **kw):
# <names> may be a list of elemNames.
if type(names) == types.StringType:
names = [names]
subcommand = (self._w, 'element', 'configure') + tuple(names)
return _doConfigure(self, subcommand, option, kw)
def element_deactivate(self, *args):
self.tk.call((self._w, 'element', 'deactivate') + args)
def element_delete(self, *args):
self.tk.call((self._w, 'element', 'delete') + args)
def element_exists(self, name):
return self.tk.getboolean(
self.tk.call(self._w, 'element', 'exists', name))
def element_names(self, *args):
return self.tk.splitlist(
self.tk.call((self._w, 'element', 'names') + args))
def element_show(self, nameList=None):
if nameList is not None:
nameList = tuple(nameList)
return self.tk.splitlist(
self.tk.call(self._w, 'element', 'show', nameList))
def element_type(self, name):
return self.tk.call(self._w, 'element', 'type', name)
def grid_cget(self, key):
return self.tk.call(self._w, 'grid', 'cget', '-' + key)
def grid_configure(self, option=None, **kw):
subcommand = (self._w, 'grid', 'configure')
return _doConfigure(self, subcommand, option, kw)
def grid_off(self):
self.tk.call(self._w, 'grid', 'off')
def grid_on(self):
self.tk.call(self._w, 'grid', 'on')
def grid_toggle(self):
self.tk.call(self._w, 'grid', 'toggle')
def legend_activate(self, *args):
self.tk.call((self._w, 'legend', 'activate') + args)
def legend_bind(self, tagName, sequence=None, func=None, add=None):
return self._bind((self._w, 'legend', 'bind', tagName),
sequence, func, add)
def legend_unbind(self, tagName, sequence, funcid=None):
self.tk.call(self._w, 'legend', 'bind', tagName, sequence, '')
if funcid:
self.deletecommand(funcid)
def legend_cget(self, key):
return self.tk.call(self._w, 'legend', 'cget', '-' + key)
def legend_configure(self, option=None, **kw):
subcommand = (self._w, 'legend', 'configure')
return _doConfigure(self, subcommand, option, kw)
def legend_deactivate(self, *args):
self.tk.call((self._w, 'legend', 'deactivate') + args)
def legend_get(self, pos):
return self.tk.call(self._w, 'legend', 'get', pos)
def pen_cget(self, name, key):
return self.tk.call(self._w, 'pen', 'cget', name, '-' + key)
def pen_configure(self, names, option=None, **kw):
# <names> may be a list of penNames.
if type(names) == types.StringType:
names = [names]
subcommand = (self._w, 'pen', 'configure') + tuple(names)
return _doConfigure(self, subcommand, option, kw)
def pen_create(self, name, **kw):
self.tk.call((self._w, 'pen', 'create', name) + self._options(kw))
def pen_delete(self, *args):
self.tk.call((self._w, 'pen', 'delete') + args)
def pen_names(self, *args):
return self.tk.splitlist(self.tk.call((self._w, 'pen', 'names') + args))
def postscript_cget(self, key):
return self.tk.call(self._w, 'postscript', 'cget', '-' + key)
def postscript_configure(self, option=None, **kw):
subcommand = (self._w, 'postscript', 'configure')
return _doConfigure(self, subcommand, option, kw)
def postscript_output(self, fileName=None, **kw):
prefix = (self._w, 'postscript', 'output')
if fileName is None:
return self.tk.call(prefix + self._options(kw))
else:
self.tk.call(prefix + (fileName,) + self._options(kw))
def marker_after(self, first, second=None):
self.tk.call(self._w, 'marker', 'after', first, second)
def marker_before(self, first, second=None):
self.tk.call(self._w, 'marker', 'before', first, second)
def marker_bind(self, tagName, sequence=None, func=None, add=None):
return self._bind((self._w, 'marker', 'bind', tagName),
sequence, func, add)
def marker_unbind(self, tagName, sequence, funcid=None):
self.tk.call(self._w, 'marker', 'bind', tagName, sequence, '')
if funcid:
self.deletecommand(funcid)
def marker_cget(self, name, key):
return self.tk.call(self._w, 'marker', 'cget', name, '-' + key)
def marker_configure(self, names, option=None, **kw):
# <names> may be a list of markerIds.
if type(names) == types.StringType:
names = [names]
subcommand = (self._w, 'marker', 'configure') + tuple(names)
return _doConfigure(self, subcommand, option, kw)
def marker_create(self, type, **kw):
return self.tk.call(
(self._w, 'marker', 'create', type) + self._options(kw))
def marker_delete(self, *args):
self.tk.call((self._w, 'marker', 'delete') + args)
def marker_exists(self, name):
return self.tk.getboolean(
self.tk.call(self._w, 'marker', 'exists', name))
def marker_names(self, *args):
return self.tk.splitlist(
self.tk.call((self._w, 'marker', 'names') + args))
def marker_type(self, name):
type = self.tk.call(self._w, 'marker', 'type', name)
if type == '':
type = None
return type
#=============================================================================
class Stripchart(Graph):
# Wrapper for the blt stripchart widget, version 2.4.
def __init__(self, master=None, cnf={}, **kw):
_loadBlt(master)
Tkinter.Widget.__init__(self, master, _chartCommand, cnf, kw)
#=============================================================================
class Tabset(Tkinter.Widget):
# Wrapper for the blt TabSet widget, version 2.4.
def __init__(self, master=None, cnf={}, **kw):
_loadBlt(master)
Tkinter.Widget.__init__(self, master, _tabsetCommand, cnf, kw)
def activate(self, tabIndex):
self.tk.call(self._w, 'activate', tabIndex)
# This is the 'bind' sub-command:
def tag_bind(self, tagName, sequence=None, func=None, add=None):
return self._bind((self._w, 'bind', tagName), sequence, func, add)
def tag_unbind(self, tagName, sequence, funcid=None):
self.tk.call(self._w, 'bind', tagName, sequence, '')
if funcid:
self.deletecommand(funcid)
def delete(self, first, last = None):
self.tk.call(self._w, 'delete', first, last)
# This is the 'focus' sub-command:
def tab_focus(self, tabIndex):
self.tk.call(self._w, 'focus', tabIndex)
def get(self, tabIndex):
return self.tk.call(self._w, 'get', tabIndex)
def index(self, tabIndex):
index = self.tk.call(self._w, 'index', tabIndex)
if index == '':
return None
else:
return self.tk.getint(self.tk.call(self._w, 'index', tabIndex))
def insert(self, position, name1, *names, **kw):
self.tk.call(
(self._w, 'insert', position, name1) + names + self._options(kw))
def invoke(self, tabIndex):
return self.tk.call(self._w, 'invoke', tabIndex)
def move(self, tabIndex1, beforeOrAfter, tabIndex2):
self.tk.call(self._w, 'move', tabIndex1, beforeOrAfter, tabIndex2)
def nearest(self, x, y):
return self.tk.call(self._w, 'nearest', x, y)
def scan_mark(self, x, y):
self.tk.call(self._w, 'scan', 'mark', x, y)
def scan_dragto(self, x, y):
self.tk.call(self._w, 'scan', 'dragto', x, y)
def see(self, index):
self.tk.call(self._w, 'see', index)
def see(self, tabIndex):
self.tk.call(self._w,'see',tabIndex)
def size(self):
return self.tk.getint(self.tk.call(self._w, 'size'))
def tab_cget(self, tabIndex, option):
if option[:1] != '-':
option = '-' + option
if option[-1:] == '_':
option = option[:-1]
return self.tk.call(self._w, 'tab', 'cget', tabIndex, option)
def tab_configure(self, tabIndexes, option=None, **kw):
# <tabIndexes> may be a list of tabs.
if type(tabIndexes) in (types.StringType, types.IntType):
tabIndexes = [tabIndexes]
subcommand = (self._w, 'tab', 'configure') + tuple(tabIndexes)
return _doConfigure(self, subcommand, option, kw)
def tab_names(self, *args):
return self.tk.splitlist(self.tk.call((self._w, 'tab', 'names') + args))
def tab_tearoff(self, tabIndex, newName = None):
if newName is None:
name = self.tk.call(self._w, 'tab', 'tearoff', tabIndex)
return self.nametowidget(name)
else:
self.tk.call(self._w, 'tab', 'tearoff', tabIndex, newName)
def view(self):
s = self.tk.call(self._w, 'view')
return tuple(map(self.tk.getint, self.tk.splitlist(s)))
def view_moveto(self, fraction):
self.tk.call(self._w, 'view', 'moveto', fraction)
def view_scroll(self, number, what):
self.tk.call(self._w, 'view', 'scroll', number, what)
--- NEW FILE: PmwButtonBox.py ---
# Based on iwidgets2.2.0/buttonbox.itk code.
import types
import Tkinter
import Pmw
class ButtonBox(Pmw.MegaWidget):
def __init__(self, parent = None, **kw):
# Define the megawidget options.
INITOPT = Pmw.INITOPT
optiondefs = (
('labelmargin', 0, INITOPT),
('labelpos', None, INITOPT),
('orient', 'horizontal', INITOPT),
('padx', 3, INITOPT),
('pady', 3, INITOPT),
)
self.defineoptions(kw, optiondefs, dynamicGroups = ('Button',))
# Initialise the base class (after defining the options).
Pmw.MegaWidget.__init__(self, parent)
# Create the components.
interior = self.interior()
if self['labelpos'] is None:
self._buttonBoxFrame = self._hull
columnOrRow = 0
else:
self._buttonBoxFrame = self.createcomponent('frame',
(), None,
Tkinter.Frame, (interior,))
self._buttonBoxFrame.grid(column=2, row=2, sticky='nsew')
columnOrRow = 2
self.createlabel(interior)
orient = self['orient']
if orient == 'horizontal':
interior.grid_columnconfigure(columnOrRow, weight = 1)
elif orient == 'vertical':
interior.grid_rowconfigure(columnOrRow, weight = 1)
else:
raise ValueError, 'bad orient option ' + repr(orient) + \
': must be either \'horizontal\' or \'vertical\''
# Initialise instance variables.
# List of tuples describing the buttons:
# - name
# - button widget
self._buttonList = []
# The index of the default button.
self._defaultButton = None
self._timerId = None
# Check keywords and initialise options.
self.initialiseoptions()
def destroy(self):
if self._timerId:
self.after_cancel(self._timerId)
self._timerId = None
Pmw.MegaWidget.destroy(self)
def numbuttons(self):
return len(self._buttonList)
def index(self, index, forInsert = 0):
listLength = len(self._buttonList)
if type(index) == types.IntType:
if forInsert and index <= listLength:
return index
elif not forInsert and index < listLength:
return index
else:
raise ValueError, 'index "%s" is out of range' % index
elif index is Pmw.END:
if forInsert:
return listLength
elif listLength > 0:
return listLength - 1
else:
raise ValueError, 'ButtonBox has no buttons'
elif index is Pmw.DEFAULT:
if self._defaultButton is not None:
return self._defaultButton
raise ValueError, 'ButtonBox has no default'
else:
names = map(lambda t: t[0], self._buttonList)
if index in names:
return names.index(index)
validValues = 'a name, a number, Pmw.END or Pmw.DEFAULT'
raise ValueError, \
'bad index "%s": must be %s' % (index, validValues)
def insert(self, componentName, beforeComponent = 0, **kw):
if componentName in self.components():
raise ValueError, 'button "%s" already exists' % componentName
if not kw.has_key('text'):
kw['text'] = componentName
kw['default'] = 'normal'
button = apply(self.createcomponent, (componentName,
(), 'Button',
Tkinter.Button, (self._buttonBoxFrame,)), kw)
index = self.index(beforeComponent, 1)
horizontal = self['orient'] == 'horizontal'
numButtons = len(self._buttonList)
# Shift buttons up one position.
for i in range(numButtons - 1, index - 1, -1):
widget = self._buttonList[i][1]
pos = i * 2 + 3
if horizontal:
widget.grid(column = pos, row = 0)
else:
widget.grid(column = 0, row = pos)
# Display the new button.
if horizontal:
button.grid(column = index * 2 + 1, row = 0, sticky = 'ew',
padx = self['padx'], pady = self['pady'])
self._buttonBoxFrame.grid_columnconfigure(
numButtons * 2 + 2, weight = 1)
else:
button.grid(column = 0, row = index * 2 + 1, sticky = 'ew',
padx = self['padx'], pady = self['pady'])
self._buttonBoxFrame.grid_rowconfigure(
numButtons * 2 + 2, weight = 1)
self._buttonList.insert(index, (componentName, button))
return button
def add(self, componentName, **kw):
return apply(self.insert, (componentName, len(self._buttonList)), kw)
def delete(self, index):
index = self.index(index)
(name, widget) = self._buttonList[index]
widget.grid_forget()
self.destroycomponent(name)
numButtons = len(self._buttonList)
# Shift buttons down one position.
horizontal = self['orient'] == 'horizontal'
for i in range(index + 1, numButtons):
widget = self._buttonList[i][1]
pos = i * 2 - 1
if horizontal:
widget.grid(column = pos, row = 0)
else:
widget.grid(column = 0, row = pos)
if horizontal:
self._buttonBoxFrame.grid_columnconfigure(numButtons * 2 - 1,
minsize = 0)
self._buttonBoxFrame.grid_columnconfigure(numButtons * 2, weight = 0)
else:
self._buttonBoxFrame.grid_rowconfigure(numButtons * 2, weight = 0)
del self._buttonList[index]
def setdefault(self, index):
# Turn off the default ring around the current default button.
if self._defaultButton is not None:
button = self._buttonList[self._defaultButton][1]
button.configure(default = 'normal')
self._defaultButton = None
# Turn on the default ring around the new default button.
if index is not None:
index = self.index(index)
self._defaultButton = index
button = self._buttonList[index][1]
button.configure(default = 'active')
def invoke(self, index = Pmw.DEFAULT, noFlash = 0):
# Invoke the callback associated with the *index* button. If
# *noFlash* is not set, flash the button to indicate to the
# user that something happened.
button = self._buttonList[self.index(index)][1]
if not noFlash:
state = button.cget('state')
relief = button.cget('relief')
button.configure(state = 'active', relief = 'sunken')
self.update_idletasks()
self.after(100)
button.configure(state = state, relief = relief)
return button.invoke()
def button(self, buttonIndex):
return self._buttonList[self.index(buttonIndex)][1]
def alignbuttons(self, when = 'later'):
if when == 'later':
if not self._timerId:
self._timerId = self.after_idle(self.alignbuttons, 'now')
return
self.update_idletasks()
self._timerId = None
# Determine the width of the maximum length button.
max = 0
horizontal = (self['orient'] == 'horizontal')
for index in range(len(self._buttonList)):
gridIndex = index * 2 + 1
if horizontal:
width = self._buttonBoxFrame.grid_bbox(gridIndex, 0)[2]
else:
width = self._buttonBoxFrame.grid_bbox(0, gridIndex)[2]
if width > max:
max = width
# Set the width of all the buttons to be the same.
if horizontal:
for index in range(len(self._buttonList)):
self._buttonBoxFrame.grid_columnconfigure(index * 2 + 1,
minsize = max)
else:
self._buttonBoxFrame.grid_columnconfigure(0, minsize = max)
--- NEW FILE: PmwColor.py ---
# Functions for converting colors and modifying the color scheme of
# an application.
import math
import string
import sys
import Tkinter
_PI = math.pi
_TWO_PI = _PI * 2
_THIRD_PI = _PI / 3
_SIXTH_PI = _PI / 6
_MAX_RGB = float(256 * 256 - 1) # max size of rgb values returned from Tk
def setscheme(root, background=None, **kw):
root = root._root()
palette = apply(_calcPalette, (root, background,), kw)
for option, value in palette.items():
root.option_add('*' + option, value, 'widgetDefault')
def getdefaultpalette(root):
# Return the default values of all options, using the defaults
# from a few widgets.
ckbtn = Tkinter.Checkbutton(root)
entry = Tkinter.Entry(root)
scbar = Tkinter.Scrollbar(root)
orig = {}
orig['activeBackground'] = str(ckbtn.configure('activebackground')[4])
orig['activeForeground'] = str(ckbtn.configure('activeforeground')[4])
orig['background'] = str(ckbtn.configure('background')[4])
orig['disabledForeground'] = str(ckbtn.configure('disabledforeground')[4])
orig['foreground'] = str(ckbtn.configure('foreground')[4])
orig['highlightBackground'] = str(ckbtn.configure('highlightbackground')[4])
orig['highlightColor'] = str(ckbtn.configure('highlightcolor')[4])
orig['insertBackground'] = str(entry.configure('insertbackground')[4])
orig['selectColor'] = str(ckbtn.configure('selectcolor')[4])
orig['selectBackground'] = str(entry.configure('selectbackground')[4])
orig['selectForeground'] = str(entry.configure('selectforeground')[4])
orig['troughColor'] = str(scbar.configure('troughcolor')[4])
ckbtn.destroy()
entry.destroy()
scbar.destroy()
return orig
#======================================================================
# Functions dealing with brightness, hue, saturation and intensity of colors.
def changebrightness(root, colorName, brightness):
# Convert the color name into its hue and back into a color of the
# required brightness.
rgb = name2rgb(root, colorName)
hue, saturation, intensity = rgb2hsi(rgb)
if saturation == 0.0:
hue = None
return hue2name(hue, brightness)
def hue2name(hue, brightness = None):
# Convert the requested hue and brightness into a color name. If
# hue is None, return a grey of the requested brightness.
if hue is None:
rgb = hsi2rgb(0.0, 0.0, brightness)
else:
while hue < 0:
hue = hue + _TWO_PI
while hue >= _TWO_PI:
hue = hue - _TWO_PI
rgb = hsi2rgb(hue, 1.0, 1.0)
if brightness is not None:
b = rgb2brightness(rgb)
i = 1.0 - (1.0 - brightness) * b
s = bhi2saturation(brightness, hue, i)
rgb = hsi2rgb(hue, s, i)
return rgb2name(rgb)
def bhi2saturation(brightness, hue, intensity):
while hue < 0:
hue = hue + _TWO_PI
while hue >= _TWO_PI:
hue = hue - _TWO_PI
hue = hue / _THIRD_PI
f = hue - math.floor(hue)
pp = intensity
pq = intensity * f
pt = intensity - intensity * f
pv = 0
hue = int(hue)
if hue == 0: rgb = (pv, pt, pp)
elif hue == 1: rgb = (pq, pv, pp)
elif hue == 2: rgb = (pp, pv, pt)
elif hue == 3: rgb = (pp, pq, pv)
elif hue == 4: rgb = (pt, pp, pv)
elif hue == 5: rgb = (pv, pp, pq)
return (intensity - brightness) / rgb2brightness(rgb)
def hsi2rgb(hue, saturation, intensity):
i = intensity
if saturation == 0:
rgb = [i, i, i]
else:
while hue < 0:
hue = hue + _TWO_PI
while hue >= _TWO_PI:
hue = hue - _TWO_PI
hue = hue / _THIRD_PI
f = hue - math.floor(hue)
p = i * (1.0 - saturation)
q = i * (1.0 - saturation * f)
t = i * (1.0 - saturation * (1.0 - f))
hue = int(hue)
if hue == 0: rgb = [i, t, p]
elif hue == 1: rgb = [q, i, p]
elif hue == 2: rgb = [p, i, t]
elif hue == 3: rgb = [p, q, i]
elif hue == 4: rgb = [t, p, i]
elif hue == 5: rgb = [i, p, q]
for index in range(3):
val = rgb[index]
if val < 0.0:
val = 0.0
if val > 1.0:
val = 1.0
rgb[index] = val
return rgb
def average(rgb1, rgb2, fraction):
return (
rgb2[0] * fraction + rgb1[0] * (1.0 - fraction),
rgb2[1] * fraction + rgb1[1] * (1.0 - fraction),
rgb2[2] * fraction + rgb1[2] * (1.0 - fraction)
)
def rgb2name(rgb):
return '#%02x%02x%02x' % \
(int(rgb[0] * 255), int(rgb[1] * 255), int(rgb[2] * 255))
def rgb2brightness(rgb):
# Return the perceived grey level of the color
# (0.0 == black, 1.0 == white).
rf = 0.299
gf = 0.587
bf = 0.114
return rf * rgb[0] + gf * rgb[1] + bf * rgb[2]
def rgb2hsi(rgb):
maxc = max(rgb[0], rgb[1], rgb[2])
minc = min(rgb[0], rgb[1], rgb[2])
intensity = maxc
if maxc != 0:
saturation = (maxc - minc) / maxc
else:
saturation = 0.0
hue = 0.0
if saturation != 0.0:
c = []
for index in range(3):
c.append((maxc - rgb[index]) / (maxc - minc))
if rgb[0] == maxc:
hue = c[2] - c[1]
elif rgb[1] == maxc:
hue = 2 + c[0] - c[2]
elif rgb[2] == maxc:
hue = 4 + c[1] - c[0]
hue = hue * _THIRD_PI
if hue < 0.0:
hue = hue + _TWO_PI
return (hue, saturation, intensity)
def name2rgb(root, colorName, asInt = 0):
if colorName[0] == '#':
# Extract rgb information from the color name itself, assuming
# it is either #rgb, #rrggbb, #rrrgggbbb, or #rrrrggggbbbb
# This is useful, since tk may return incorrect rgb values if
# the colormap is full - it will return the rbg values of the
# closest color available.
colorName = colorName[1:]
digits = len(colorName) / 3
factor = 16 ** (4 - digits)
rgb = (
string.atoi(colorName[0:digits], 16) * factor,
string.atoi(colorName[digits:digits * 2], 16) * factor,
string.atoi(colorName[digits * 2:digits * 3], 16) * factor,
)
else:
# We have no choice but to ask Tk what the rgb values are.
rgb = root.winfo_rgb(colorName)
if not asInt:
rgb = (rgb[0] / _MAX_RGB, rgb[1] / _MAX_RGB, rgb[2] / _MAX_RGB)
return rgb
def _calcPalette(root, background=None, **kw):
# Create a map that has the complete new palette. If some colors
# aren't specified, compute them from other colors that are specified.
new = {}
for key, value in kw.items():
new[key] = value
if background is not None:
new['background'] = background
if not new.has_key('background'):
raise ValueError, 'must specify a background color'
if not new.has_key('foreground'):
new['foreground'] = 'black'
bg = name2rgb(root, new['background'])
fg = name2rgb(root, new['foreground'])
for i in ('activeForeground', 'insertBackground', 'selectForeground',
'highlightColor'):
if not new.has_key(i):
new[i] = new['foreground']
if not new.has_key('disabledForeground'):
newCol = average(bg, fg, 0.3)
new['disabledForeground'] = rgb2name(newCol)
if not new.has_key('highlightBackground'):
new['highlightBackground'] = new['background']
# Set <lighterBg> to a color that is a little lighter that the
# normal background. To do this, round each color component up by
# 9% or 1/3 of the way to full white, whichever is greater.
lighterBg = []
for i in range(3):
lighterBg.append(bg[i])
inc1 = lighterBg[i] * 0.09
inc2 = (1.0 - lighterBg[i]) / 3
if inc1 > inc2:
lighterBg[i] = lighterBg[i] + inc1
else:
lighterBg[i] = lighterBg[i] + inc2
if lighterBg[i] > 1.0:
lighterBg[i] = 1.0
# Set <darkerBg> to a color that is a little darker that the
# normal background.
darkerBg = (bg[0] * 0.9, bg[1] * 0.9, bg[2] * 0.9)
if not new.has_key('activeBackground'):
# If the foreground is dark, pick a light active background.
# If the foreground is light, pick a dark active background.
# XXX This has been disabled, since it does not look very
# good with dark backgrounds. If this is ever fixed, the
# selectBackground and troughColor options should also be fixed.
if rgb2brightness(fg) < 0.5:
new['activeBackground'] = rgb2name(lighterBg)
else:
new['activeBackground'] = rgb2name(lighterBg)
if not new.has_key('selectBackground'):
new['selectBackground'] = rgb2name(darkerBg)
if not new.has_key('troughColor'):
new['troughColor'] = rgb2name(darkerBg)
if not new.has_key('selectColor'):
new['selectColor'] = 'yellow'
return new
def spectrum(numColors, correction = 1.0, saturation = 1.0, intensity = 1.0,
extraOrange = 1, returnHues = 0):
colorList = []
division = numColors / 7.0
for index in range(numColors):
if extraOrange:
if index < 2 * division:
hue = index / division
else:
hue = 2 + 2 * (index - 2 * division) / division
hue = hue * _SIXTH_PI
else:
hue = index * _TWO_PI / numColors
if returnHues:
colorList.append(hue)
else:
rgb = hsi2rgb(hue, saturation, intensity)
if correction != 1.0:
rgb = correct(rgb, correction)
name = rgb2name(rgb)
colorList.append(name)
return colorList
def correct(rgb, correction):
correction = float(correction)
rtn = []
for index in range(3):
rtn.append((1 - (1 - rgb[index]) ** correction) ** (1 / correction))
return rtn
#==============================================================================
def _recolorTree(widget, oldpalette, newcolors):
# Change the colors in a widget and its descendants.
# Change the colors in <widget> and all of its descendants,
# according to the <newcolors> dictionary. It only modifies
# colors that have their default values as specified by the
# <oldpalette> variable. The keys of the <newcolors> dictionary
# are named after widget configuration options and the values are
# the new value for that option.
for dbOption in newcolors.keys():
option = string.lower(dbOption)
try:
value = str(widget.cget(option))
except:
continue
if oldpalette is None or value == oldpalett...
[truncated message content] |
|
From: <co...@us...> - 2003-11-11 22:23:00
|
Update of /cvsroot/wpdev/xmlscripts/python-lib/Pmw/Pmw_1_2 In directory sc8-pr-cvs1:/tmp/cvs-serv17003/Pmw_1_2 Added Files: __init__.py Log Message: pmw class wrapers for Tkinter --- NEW FILE: __init__.py --- # File to allow this directory to be treated as a python package. |
|
From: <co...@us...> - 2003-11-11 22:22:58
|
Update of /cvsroot/wpdev/xmlscripts/python-lib/Pmw
In directory sc8-pr-cvs1:/tmp/cvs-serv17003
Added Files:
__init__.py
Log Message:
pmw class wrapers for Tkinter
--- NEW FILE: __init__.py ---
# This file is executed when the Pmw package is imported. It creates
# a lazy importer/dynamic loader for Pmw and replaces the Pmw module
# with it. Even though the loader from the most recent installed
# version of Pmw is used, the user is able to specify which version of
# Pmw megawidgets to load by using the setversion() function of the
# loader.
# This is the only file in Pmw which is not part of a particular Pmw
# release.
import sys
import os
import re
def _hasLoader(dir):
# Only accept Pmw_V_R_P with single digits, since ordering will
# not work correctly with multiple digits (for example, Pmw_10_0
# will be before Pmw_9_9).
if re.search('^Pmw_[0-9]_[0-9](_[0-9])?$', dir) is not None:
for suffix in ('.py', '.pyc', '.pyo'):
path = os.path.join(_dir, dir, 'lib', 'PmwLoader' + suffix)
if os.path.isfile(path):
return 1
return 0
# First get a list of all subdirectories containing versions of Pmw.
_dir = __path__[0]
_listdir = os.listdir(_dir)
_instdirs = filter(_hasLoader, _listdir)
_instdirs.sort()
_instdirs.reverse()
# Using the latest version import the dynamic loader.
_loader = 'Pmw.' + _instdirs[0] + '.lib.PmwLoader'
__import__(_loader)
_mod = sys.modules[_loader]
# Create the dynamic loader and install it into sys.modules.
sys.modules['_Pmw'] = sys.modules['Pmw']
sys.modules['Pmw'] = _mod.PmwLoader(_dir, _instdirs, _listdir)
|
|
From: <co...@us...> - 2003-11-11 22:20:03
|
Update of /cvsroot/wpdev/xmlscripts/python-lib/Pmw/Pmw_1_2/lib In directory sc8-pr-cvs1:/tmp/cvs-serv16466/lib Log Message: Directory /cvsroot/wpdev/xmlscripts/python-lib/Pmw/Pmw_1_2/lib added to the repository |
|
From: <co...@us...> - 2003-11-11 22:19:33
|
Update of /cvsroot/wpdev/xmlscripts/python-lib/Pmw/Pmw_1_2 In directory sc8-pr-cvs1:/tmp/cvs-serv16308/Pmw_1_2 Log Message: Directory /cvsroot/wpdev/xmlscripts/python-lib/Pmw/Pmw_1_2 added to the repository |
|
From: <co...@us...> - 2003-11-11 22:19:00
|
Update of /cvsroot/wpdev/xmlscripts/python-lib/Pmw In directory sc8-pr-cvs1:/tmp/cvs-serv16170/Pmw Log Message: Directory /cvsroot/wpdev/xmlscripts/python-lib/Pmw added to the repository |
|
From: <co...@us...> - 2003-11-11 21:52:55
|
Update of /cvsroot/wpdev/xmlscripts/scripts
In directory sc8-pr-cvs1:/tmp/cvs-serv9811
Modified Files:
xmlconfig.py
Log Message:
no message
Index: xmlconfig.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/xmlconfig.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** xmlconfig.py 11 Nov 2003 21:40:33 -0000 1.1
--- xmlconfig.py 11 Nov 2003 21:52:51 -0000 1.2
***************
*** 57,61 ****
try:
! wolfconfig = parse('wolfpack.xml')
childnodes = wolfconfig.childNodes
except:
--- 57,61 ----
try:
! wolfconfig = parse('../wolfpack.xml')
childnodes = wolfconfig.childNodes
except:
|
|
From: <co...@us...> - 2003-11-11 21:40:43
|
Update of /cvsroot/wpdev/xmlscripts/scripts
In directory sc8-pr-cvs1:/tmp/cvs-serv7124
Added Files:
xmlconfig.py
Log Message:
wolfpack.xml python configurator
--- NEW FILE: xmlconfig.py ---
from xml.dom.minidom import *
import Tkinter
import Pmw
class Option:
def __init__(self,name,defvalue, choices):
self.text = name
self.value = defvalue
self.choices = choices
class ConfigGroup:
def __init__(self, parent, y, text, options):
self.gr = Pmw.Group( parent.interior(),
tag_text = text,
tag_font = Pmw.logicalfont('Helvetica', 4),
)
self.y = y
self.height = 10
for op in options:
if len( op.choices ) > 0:
entry = Pmw.ComboBox(self.gr.interior(),
labelpos = 'w',
label_text = op.text,
listheight = len(op.choices)*40,
selectioncommand = self.onSelect,
scrolledlist_items = op.choices,
)
entry.selectitem(str(op.value))
entry.pack(fill='both',expand=1,pady=5,padx=5)
self.height += 40
else:
entry = Pmw.EntryField(self.gr.interior(),
labelpos = 'w',
value = str(op.value),
label_text = op.text,
validate = None
)
entry.pack(fill='both',expand=1,pady=5,padx=5)
self.height += 40
parent.create_window(1, y,width=300,height=self.height,anchor='nw',window = self.gr)
def onSelect(self,text):
print text
class XMLConfig:
def __init__(self, parent):
self.xmlname = 'wolfpack.xml'
self.sc = Pmw.ScrolledCanvas(parent,
borderframe = 1,
usehullsize = 1,
hull_width = 400,
hull_height = 300,
)
try:
wolfconfig = parse('wolfpack.xml')
childnodes = wolfconfig.childNodes
except:
print 'Could not parse wolfpack.xml!'
return
groups = wolfconfig.getElementsByTagName('group')
opts = []
y = 1
for gr in groups:
options = gr.getElementsByTagName('option')
for op in options:
value = op.getAttribute('value')
if ( value == 'true' or value == 'false' ):
choices = ('true','false')
elif( value == 'mysql' or value == 'sqlite' ):
choices = ('mysql','sqlite')
else:
choices = ()
opts.append( Option( op.getAttribute('key'), value, choices ) )
cfg = ConfigGroup( self.sc, y, gr.getAttribute('name'), opts )
y += cfg.height + 5
opts = []
self.sc.pack(padx = 5, pady = 5, fill = 'both', expand = 1)
self.sc.resizescrollregion()
def writeXML(self):
dom = Document()
all = dom.createElement("preferences")
all.setAttribute('version','1.0')
all.setAttribute('application','Wolfpack')
sub = dom.createElement("group")
sub.setAttribute('name','AI')
all.appendChild(sub)
dom.appendChild(all)
file = open(filename,'w')
file.write("<!DOCTYPE preferences>\n")
file.write(dom.toprettyxml())
file.flush()
file.close()
if __name__ == '__main__':
root = Tkinter.Tk()
Pmw.initialise(root)
root.title('Wolfpack configurator')
exitButton = Tkinter.Button(root, text = 'Exit', command = root.destroy)
exitButton.pack(side = 'bottom')
widget = XMLConfig(root)
root.mainloop()
|
|
From: <co...@us...> - 2003-11-11 12:34:13
|
Update of /cvsroot/wpdev/xmlscripts/python-lib In directory sc8-pr-cvs1:/tmp/cvs-serv18837 Removed Files: _socket.pyd _sre.pyd select.pyd Log Message: no message --- _socket.pyd DELETED --- --- _sre.pyd DELETED --- --- select.pyd DELETED --- |
|
From: <co...@us...> - 2003-11-11 09:18:16
|
Update of /cvsroot/wpdev/xmlscripts/python-lib In directory sc8-pr-cvs1:/tmp/cvs-serv13608 Added Files: _socket.pyd _sre.pyd select.pyd Log Message: Now python installation is not neccessary --- NEW FILE: _socket.pyd --- (This appears to be a binary file; contents omitted.) --- NEW FILE: _sre.pyd --- (This appears to be a binary file; contents omitted.) --- NEW FILE: select.pyd --- (This appears to be a binary file; contents omitted.) |
|
From: <co...@us...> - 2003-11-10 21:03:53
|
Update of /cvsroot/wpdev/xmlscripts/definitions In directory sc8-pr-cvs1:/tmp/cvs-serv16936/definitions Modified Files: encryption.xml Log Message: 401a encryption keys added Index: encryption.xml =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/definitions/encryption.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** encryption.xml 20 Aug 2003 18:12:37 -0000 1.4 --- encryption.xml 10 Nov 2003 21:03:50 -0000 1.5 *************** *** 1,7 **** <definitions> <list id="ENCRYPTION"> ! <!-- High priority first !! --> <!-- Client identification string (optional) ; Key1 ; Key2 --> <item> Client 4.0.0 ; 0x2E13A5FD ; 0xA21D527F </item> <item> Client 3.0.5 ; 0x2C8B97AD ; 0xA350DE7F </item> --- 1,8 ---- <definitions> <list id="ENCRYPTION"> ! <!-- High priority first !! --> <!-- Client identification string (optional) ; Key1 ; Key2 --> + <item> Client 4.0.1 ; 0x2E2BA7ED ; 0xA2017E7F </item> <item> Client 4.0.0 ; 0x2E13A5FD ; 0xA21D527F </item> <item> Client 3.0.5 ; 0x2C8B97AD ; 0xA350DE7F </item> |
Update of /cvsroot/wpdev/xmlscripts/python-lib
In directory sc8-pr-cvs1:/tmp/cvs-serv5168
Modified Files:
aifc.py anydbm.py asynchat.py asyncore.py atexit.py
BaseHTTPServer.py Bastion.py bdb.py calendar.py cgi.py
CGIHTTPServer.py cgitb.py chunk.py cmd.py code.py codecs.py
codeop.py compileall.py ConfigParser.py Cookie.py copy.py
copy_reg.py dbhash.py difflib.py dircache.py dis.py doctest.py
dumbdbm.py filecmp.py fileinput.py fnmatch.py formatter.py
ftplib.py getopt.py getpass.py gettext.py gopherlib.py gzip.py
hmac.py htmlentitydefs.py htmllib.py HTMLParser.py httplib.py
ihooks.py imaplib.py imputil.py inspect.py keyword.py
linecache.py locale.py macpath.py mailbox.py mailcap.py
markupbase.py mhlib.py mimetools.py mimetypes.py mimify.py
multifile.py mutex.py netrc.py nntplib.py ntpath.py os.py
pdb.py pickle.py pipes.py popen2.py poplib.py posixpath.py
pprint.py pre.py profile.py pstats.py pty.py py_compile.py
pyclbr.py pydoc.py Queue.py quopri.py random.py re.py
regsub.py repr.py rexec.py rfc822.py rlcompleter.py
robotparser.py sched.py sgmllib.py shelve.py shlex.py
shutil.py SimpleHTTPServer.py SimpleXMLRPCServer.py site.py
smtpd.py smtplib.py socket.py SocketServer.py sre.py
sre_compile.py sre_constants.py sre_parse.py statcache.py
string.py StringIO.py symbol.py symtable.py tabnanny.py
telnetlib.py tempfile.py threading.py toaiff.py token.py
tokenize.py traceback.py types.py unittest.py urllib.py
urllib2.py urlparse.py user.py UserDict.py UserList.py
UserString.py uu.py warnings.py weakref.py webbrowser.py
whichdb.py xdrlib.py xmllib.py xmlrpclib.py zipfile.py
Log Message:
Updated to Python 2.3.2
Index: aifc.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/python-lib/aifc.py,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** aifc.py 1 Jul 2002 01:55:58 -0000 1.1.1.1
--- aifc.py 10 Nov 2003 12:44:15 -0000 1.2
***************
*** 143,147 ****
pass
! _AIFC_version = 0xA2805140 # Version 1 of AIFF-C
_skiplist = 'COMT', 'INST', 'MIDI', 'AESD', \
--- 143,147 ----
pass
! _AIFC_version = 0xA2805140L # Version 1 of AIFF-C
_skiplist = 'COMT', 'INST', 'MIDI', 'AESD', \
***************
*** 179,183 ****
def _read_float(f): # 10 bytes
- import math
expon = _read_short(f) # 2 bytes
sign = 1
--- 179,182 ----
***************
*** 311,315 ****
self._ssnd_seek_needed = 0
elif chunkname == 'FVER':
! self._version = _read_long(chunk)
elif chunkname == 'MARK':
self._readmark(chunk)
--- 310,314 ----
self._ssnd_seek_needed = 0
elif chunkname == 'FVER':
! self._version = _read_ulong(chunk)
elif chunkname == 'MARK':
self._readmark(chunk)
***************
*** 747,752 ****
def _comp_data(self, data):
import cl
! dum = self._comp.SetParam(cl.FRAME_BUFFER_SIZE, len(data))
! dum = self._comp.SetParam(cl.COMPRESSED_BUFFER_SIZE, len(data))
return self._comp.Compress(self._nframes, data)
--- 746,751 ----
def _comp_data(self, data):
import cl
! dummy = self._comp.SetParam(cl.FRAME_BUFFER_SIZE, len(data))
! dummy = self._comp.SetParam(cl.COMPRESSED_BUFFER_SIZE, len(data))
return self._comp.Compress(self._nframes, data)
***************
*** 785,789 ****
def _init_compression(self):
if self._comptype == 'G722':
- import audioop
self._convert = self._lin2adpcm
return
--- 784,787 ----
Index: anydbm.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/python-lib/anydbm.py,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** anydbm.py 1 Jul 2002 01:55:58 -0000 1.1.1.1
--- anydbm.py 10 Nov 2003 12:44:15 -0000 1.2
***************
*** 26,30 ****
del d[key] # delete data stored at key (raises KeyError
# if no such key)
! flag = d.has_key(key) # true if the key exists
list = d.keys() # return a list of all existing keys (slow!)
--- 26,30 ----
del d[key] # delete data stored at key (raises KeyError
# if no such key)
! flag = key in d # true if the key exists
list = d.keys() # return a list of all existing keys (slow!)
***************
*** 43,51 ****
"""
! try:
! class error(Exception):
! pass
! except (NameError, TypeError):
! error = "anydbm.error"
_names = ['dbhash', 'gdbm', 'dbm', 'dumbdbm']
--- 43,48 ----
"""
! class error(Exception):
! pass
_names = ['dbhash', 'gdbm', 'dbm', 'dumbdbm']
Index: asynchat.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/python-lib/asynchat.py,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** asynchat.py 1 Jul 2002 01:55:58 -0000 1.1.1.1
--- asynchat.py 10 Nov 2003 12:44:15 -0000 1.2
***************
*** 65,68 ****
--- 65,74 ----
asyncore.dispatcher.__init__ (self, conn)
+ def collect_incoming_data(self, data):
+ raise NotImplementedError, "must be implemented in subclass"
+
+ def found_terminator(self):
+ raise NotImplementedError, "must be implemented in subclass"
+
def set_terminator (self, term):
"Set the input delimiter. Can be a fixed string of any length, an integer, or None"
***************
*** 95,103 ****
lb = len(self.ac_in_buffer)
terminator = self.get_terminator()
! if terminator is None:
# no terminator, collect it all
self.collect_incoming_data (self.ac_in_buffer)
self.ac_in_buffer = ''
! elif type(terminator) == type(0):
# numeric terminator
n = terminator
--- 101,109 ----
lb = len(self.ac_in_buffer)
terminator = self.get_terminator()
! if terminator is None or terminator == '':
# no terminator, collect it all
self.collect_incoming_data (self.ac_in_buffer)
self.ac_in_buffer = ''
! elif isinstance(terminator, int):
# numeric terminator
n = terminator
***************
*** 178,182 ****
# of the first producer in the queue
def refill_buffer (self):
- _string_type = type('')
while 1:
if len(self.producer_fifo):
--- 184,187 ----
***************
*** 189,193 ****
self.close()
return
! elif type(p) is _string_type:
self.producer_fifo.pop()
self.ac_out_buffer = self.ac_out_buffer + p
--- 194,198 ----
self.close()
return
! elif isinstance(p, str):
self.producer_fifo.pop()
self.ac_out_buffer = self.ac_out_buffer + p
***************
*** 264,270 ****
def pop (self):
if self.list:
! result = self.list[0]
! del self.list[0]
! return (1, result)
else:
return (0, None)
--- 269,273 ----
def pop (self):
if self.list:
! return (1, self.list.pop(0))
else:
return (0, None)
***************
*** 275,293 ****
# for example:
# f_p_a_e ("qwerty\r", "\r\n") => 1
- # f_p_a_e ("qwerty\r\n", "\r\n") => 2
# f_p_a_e ("qwertydkjf", "\r\n") => 0
# this could maybe be made faster with a computed regex?
# [answer: no; circa Python-2.0, Jan 2001]
! # python: 18307/s
# re: 12820/s
# regex: 14035/s
def find_prefix_at_end (haystack, needle):
! nl = len(needle)
! result = 0
! for i in range (1,nl):
! if haystack[-(nl-i):] == needle[:(nl-i)]:
! result = nl-i
! break
! return result
--- 278,294 ----
# for example:
# f_p_a_e ("qwerty\r", "\r\n") => 1
# f_p_a_e ("qwertydkjf", "\r\n") => 0
+ # f_p_a_e ("qwerty\r\n", "\r\n") => <undefined>
# this could maybe be made faster with a computed regex?
# [answer: no; circa Python-2.0, Jan 2001]
! # new python: 28961/s
! # old python: 18307/s
# re: 12820/s
# regex: 14035/s
def find_prefix_at_end (haystack, needle):
! l = len(needle) - 1
! while l and not haystack.endswith(needle[:l]):
! l -= 1
! return l
Index: asyncore.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/python-lib/asyncore.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** asyncore.py 21 Dec 2002 14:52:54 -0000 1.2
--- asyncore.py 10 Nov 2003 12:44:15 -0000 1.3
***************
*** 62,71 ****
socket_map = {}
! class ExitNow (exceptions.Exception):
pass
! DEBUG = 0
! def poll (timeout=0.0, map=None):
if map is None:
map = socket_map
--- 62,96 ----
socket_map = {}
! class ExitNow(exceptions.Exception):
pass
! def read(obj):
! try:
! obj.handle_read_event()
! except ExitNow:
! raise
! except:
! obj.handle_error()
! def write(obj):
! try:
! obj.handle_write_event()
! except ExitNow:
! raise
! except:
! obj.handle_error()
!
! def readwrite(obj, flags):
! try:
! if flags & select.POLLIN:
! obj.handle_read_event()
! if flags & select.POLLOUT:
! obj.handle_write_event()
! except ExitNow:
! raise
! except:
! obj.handle_error()
!
! def poll(timeout=0.0, map=None):
if map is None:
map = socket_map
***************
*** 74,123 ****
for fd, obj in map.items():
if obj.readable():
! r.append (fd)
if obj.writable():
! w.append (fd)
if [] == r == w == e:
time.sleep(timeout)
else:
try:
! r,w,e = select.select (r,w,e, timeout)
except select.error, err:
if err[0] != EINTR:
raise
! r = []; w = []; e = []
!
! if DEBUG:
! print r,w,e
for fd in r:
! try:
! obj = map[fd]
! except KeyError:
continue
!
! try:
! obj.handle_read_event()
! except ExitNow:
! raise ExitNow
! except:
! obj.handle_error()
for fd in w:
! try:
! obj = map[fd]
! except KeyError:
continue
! try:
! obj.handle_write_event()
! except ExitNow:
! raise ExitNow
! except:
! obj.handle_error()
!
! def poll2 (timeout=0.0, map=None):
import poll
if map is None:
! map=socket_map
if timeout is not None:
# timeout is in milliseconds
--- 99,132 ----
for fd, obj in map.items():
if obj.readable():
! r.append(fd)
if obj.writable():
! w.append(fd)
if [] == r == w == e:
time.sleep(timeout)
else:
try:
! r, w, e = select.select(r, w, e, timeout)
except select.error, err:
if err[0] != EINTR:
raise
! else:
! return
for fd in r:
! obj = map.get(fd)
! if obj is None:
continue
! read(obj)
for fd in w:
! obj = map.get(fd)
! if obj is None:
continue
+ write(obj)
! def poll2(timeout=0.0, map=None):
import poll
if map is None:
! map = socket_map
if timeout is not None:
# timeout is in milliseconds
***************
*** 132,157 ****
flags = flags | poll.POLLOUT
if flags:
! l.append ((fd, flags))
! r = poll.poll (l, timeout)
for fd, flags in r:
! try:
! obj = map[fd]
! except KeyError:
continue
! try:
! if (flags & poll.POLLIN):
! obj.handle_read_event()
! if (flags & poll.POLLOUT):
! obj.handle_write_event()
! except ExitNow:
! raise ExitNow
! except:
! obj.handle_error()
!
! def poll3 (timeout=0.0, map=None):
# Use the poll() support added to the select module in Python 2.0
if map is None:
! map=socket_map
if timeout is not None:
# timeout is in milliseconds
--- 141,156 ----
flags = flags | poll.POLLOUT
if flags:
! l.append((fd, flags))
! r = poll.poll(l, timeout)
for fd, flags in r:
! obj = map.get(fd)
! if obj is None:
continue
+ readwrite(obj, flags)
! def poll3(timeout=0.0, map=None):
# Use the poll() support added to the select module in Python 2.0
if map is None:
! map = socket_map
if timeout is not None:
# timeout is in milliseconds
***************
*** 168,172 ****
pollster.register(fd, flags)
try:
! r = pollster.poll (timeout)
except select.error, err:
if err[0] != EINTR:
--- 167,171 ----
pollster.register(fd, flags)
try:
! r = pollster.poll(timeout)
except select.error, err:
if err[0] != EINTR:
***************
*** 174,199 ****
r = []
for fd, flags in r:
! try:
! obj = map[fd]
! except KeyError:
continue
! try:
! if (flags & select.POLLIN):
! obj.handle_read_event()
! if (flags & select.POLLOUT):
! obj.handle_write_event()
! except ExitNow:
! raise ExitNow
! except:
! obj.handle_error()
!
! def loop (timeout=30.0, use_poll=0, map=None):
!
if map is None:
! map=socket_map
if use_poll:
! if hasattr (select, 'poll'):
poll_fun = poll3
else:
--- 173,187 ----
r = []
for fd, flags in r:
! obj = map.get(fd)
! if obj is None:
continue
+ readwrite(obj, flags)
! def loop(timeout=30.0, use_poll=0, map=None):
if map is None:
! map = socket_map
if use_poll:
! if hasattr(select, 'poll'):
poll_fun = poll3
else:
***************
*** 203,209 ****
while map:
! poll_fun (timeout, map)
class dispatcher:
debug = 0
connected = 0
--- 191,198 ----
while map:
! poll_fun(timeout, map)
class dispatcher:
+
debug = 0
connected = 0
***************
*** 212,220 ****
addr = None
! def __init__ (self, sock=None, map=None):
if sock:
! self.set_socket (sock, map)
# I think it should inherit this anyway
! self.socket.setblocking (0)
self.connected = 1
# XXX Does the constructor require that the socket passed
--- 201,209 ----
addr = None
! def __init__(self, sock=None, map=None):
if sock:
! self.set_socket(sock, map)
# I think it should inherit this anyway
! self.socket.setblocking(0)
self.connected = 1
# XXX Does the constructor require that the socket passed
***************
*** 228,278 ****
self.socket = None
! def __repr__ (self):
status = [self.__class__.__module__+"."+self.__class__.__name__]
if self.accepting and self.addr:
! status.append ('listening')
elif self.connected:
! status.append ('connected')
if self.addr is not None:
try:
! status.append ('%s:%d' % self.addr)
except TypeError:
! status.append (repr(self.addr))
! return '<%s at %#x>' % (' '.join (status), id (self))
! def add_channel (self, map=None):
! #self.log_info ('adding channel %s' % self)
if map is None:
! map=socket_map
! map [self._fileno] = self
! def del_channel (self, map=None):
fd = self._fileno
if map is None:
! map=socket_map
! if map.has_key (fd):
! #self.log_info ('closing channel %d:%s' % (fd, self))
! del map [fd]
! def create_socket (self, family, type):
self.family_and_type = family, type
! self.socket = socket.socket (family, type)
self.socket.setblocking(0)
self._fileno = self.socket.fileno()
self.add_channel()
! def set_socket (self, sock, map=None):
self.socket = sock
## self.__dict__['socket'] = sock
self._fileno = sock.fileno()
! self.add_channel (map)
! def set_reuse_addr (self):
# try to re-use a server port if possible
try:
! self.socket.setsockopt (
socket.SOL_SOCKET, socket.SO_REUSEADDR,
! self.socket.getsockopt (socket.SOL_SOCKET,
! socket.SO_REUSEADDR) | 1
)
except socket.error:
--- 217,267 ----
self.socket = None
! def __repr__(self):
status = [self.__class__.__module__+"."+self.__class__.__name__]
if self.accepting and self.addr:
! status.append('listening')
elif self.connected:
! status.append('connected')
if self.addr is not None:
try:
! status.append('%s:%d' % self.addr)
except TypeError:
! status.append(repr(self.addr))
! return '<%s at %#x>' % (' '.join(status), id(self))
! def add_channel(self, map=None):
! #self.log_info('adding channel %s' % self)
if map is None:
! map = socket_map
! map[self._fileno] = self
! def del_channel(self, map=None):
fd = self._fileno
if map is None:
! map = socket_map
! if map.has_key(fd):
! #self.log_info('closing channel %d:%s' % (fd, self))
! del map[fd]
! def create_socket(self, family, type):
self.family_and_type = family, type
! self.socket = socket.socket(family, type)
self.socket.setblocking(0)
self._fileno = self.socket.fileno()
self.add_channel()
! def set_socket(self, sock, map=None):
self.socket = sock
## self.__dict__['socket'] = sock
self._fileno = sock.fileno()
! self.add_channel(map)
! def set_reuse_addr(self):
# try to re-use a server port if possible
try:
! self.socket.setsockopt(
socket.SOL_SOCKET, socket.SO_REUSEADDR,
! self.socket.getsockopt(socket.SOL_SOCKET,
! socket.SO_REUSEADDR) | 1
)
except socket.error:
***************
*** 285,299 ****
# ==================================================
! def readable (self):
! return 1
if os.name == 'mac':
# The macintosh will select a listening socket for
# write if you let it. What might this mean?
! def writable (self):
return not self.accepting
else:
! def writable (self):
! return 1
# ==================================================
--- 274,288 ----
# ==================================================
! def readable(self):
! return True
if os.name == 'mac':
# The macintosh will select a listening socket for
# write if you let it. What might this mean?
! def writable(self):
return not self.accepting
else:
! def writable(self):
! return True
# ==================================================
***************
*** 301,317 ****
# ==================================================
! def listen (self, num):
self.accepting = 1
if os.name == 'nt' and num > 5:
num = 1
! return self.socket.listen (num)
! def bind (self, addr):
self.addr = addr
! return self.socket.bind (addr)
! def connect (self, address):
self.connected = 0
err = self.socket.connect_ex(address)
if err in (EINPROGRESS, EALREADY, EWOULDBLOCK):
return
--- 290,307 ----
# ==================================================
! def listen(self, num):
self.accepting = 1
if os.name == 'nt' and num > 5:
num = 1
! return self.socket.listen(num)
! def bind(self, addr):
self.addr = addr
! return self.socket.bind(addr)
! def connect(self, address):
self.connected = 0
err = self.socket.connect_ex(address)
+ # XXX Should interpret Winsock return values
if err in (EINPROGRESS, EALREADY, EWOULDBLOCK):
return
***************
*** 323,327 ****
raise socket.error, err
! def accept (self):
try:
conn, addr = self.socket.accept()
--- 313,318 ----
raise socket.error, err
! def accept(self):
! # XXX can return either an address pair or None
try:
conn, addr = self.socket.accept()
***************
*** 333,339 ****
raise socket.error, why
! def send (self, data):
try:
! result = self.socket.send (data)
return result
except socket.error, why:
--- 324,330 ----
raise socket.error, why
! def send(self, data):
try:
! result = self.socket.send(data)
return result
except socket.error, why:
***************
*** 344,350 ****
return 0
! def recv (self, buffer_size):
try:
! data = self.socket.recv (buffer_size)
if not data:
# a closed connection is indicated by signaling
--- 335,341 ----
return 0
! def recv(self, buffer_size):
try:
! data = self.socket.recv(buffer_size)
if not data:
# a closed connection is indicated by signaling
***************
*** 362,366 ****
raise socket.error, why
! def close (self):
self.del_channel()
self.socket.close()
--- 353,357 ----
raise socket.error, why
! def close(self):
self.del_channel()
self.socket.close()
***************
*** 368,386 ****
# cheap inheritance, used to pass all other attribute
# references to the underlying socket object.
! def __getattr__ (self, attr):
! return getattr (self.socket, attr)
! # log and log_info maybe overriden to provide more sophisitcated
# logging and warning methods. In general, log is for 'hit' logging
# and 'log_info' is for informational, warning and error logging.
! def log (self, message):
! sys.stderr.write ('log: %s\n' % str(message))
! def log_info (self, message, type='info'):
if __debug__ or type != 'info':
print '%s: %s' % (type, message)
! def handle_read_event (self):
if self.accepting:
# for an accepting socket, getting a read implies
--- 359,377 ----
# cheap inheritance, used to pass all other attribute
# references to the underlying socket object.
! def __getattr__(self, attr):
! return getattr(self.socket, attr)
! # log and log_info may be overridden to provide more sophisticated
# logging and warning methods. In general, log is for 'hit' logging
# and 'log_info' is for informational, warning and error logging.
! def log(self, message):
! sys.stderr.write('log: %s\n' % str(message))
! def log_info(self, message, type='info'):
if __debug__ or type != 'info':
print '%s: %s' % (type, message)
! def handle_read_event(self):
if self.accepting:
# for an accepting socket, getting a read implies
***************
*** 396,400 ****
self.handle_read()
! def handle_write_event (self):
# getting a write implies that we are connected
if not self.connected:
--- 387,391 ----
self.handle_read()
! def handle_write_event(self):
# getting a write implies that we are connected
if not self.connected:
***************
*** 403,419 ****
self.handle_write()
! def handle_expt_event (self):
self.handle_expt()
! def handle_error (self):
nil, t, v, tbinfo = compact_traceback()
# sometimes a user repr method will crash.
try:
! self_repr = repr (self)
except:
! self_repr = '<__repr__ (self) failed for object at %0x>' % id(self)
! self.log_info (
'uncaptured python exception, closing channel %s (%s:%s %s)' % (
self_repr,
--- 394,410 ----
self.handle_write()
! def handle_expt_event(self):
self.handle_expt()
! def handle_error(self):
nil, t, v, tbinfo = compact_traceback()
# sometimes a user repr method will crash.
try:
! self_repr = repr(self)
except:
! self_repr = '<__repr__(self) failed for object at %0x>' % id(self)
! self.log_info(
'uncaptured python exception, closing channel %s (%s:%s %s)' % (
self_repr,
***************
*** 426,446 ****
self.close()
! def handle_expt (self):
! self.log_info ('unhandled exception', 'warning')
! def handle_read (self):
! self.log_info ('unhandled read event', 'warning')
! def handle_write (self):
! self.log_info ('unhandled write event', 'warning')
! def handle_connect (self):
! self.log_info ('unhandled connect event', 'warning')
! def handle_accept (self):
! self.log_info ('unhandled accept event', 'warning')
! def handle_close (self):
! self.log_info ('unhandled close event', 'warning')
self.close()
--- 417,437 ----
self.close()
! def handle_expt(self):
! self.log_info('unhandled exception', 'warning')
! def handle_read(self):
! self.log_info('unhandled read event', 'warning')
! def handle_write(self):
! self.log_info('unhandled write event', 'warning')
! def handle_connect(self):
! self.log_info('unhandled connect event', 'warning')
! def handle_accept(self):
! self.log_info('unhandled accept event', 'warning')
! def handle_close(self):
! self.log_info('unhandled close event', 'warning')
self.close()
***************
*** 450,472 ****
# ---------------------------------------------------------------------------
! class dispatcher_with_send (dispatcher):
! def __init__ (self, sock=None):
! dispatcher.__init__ (self, sock)
self.out_buffer = ''
! def initiate_send (self):
num_sent = 0
! num_sent = dispatcher.send (self, self.out_buffer[:512])
self.out_buffer = self.out_buffer[num_sent:]
! def handle_write (self):
self.initiate_send()
! def writable (self):
return (not self.connected) or len(self.out_buffer)
! def send (self, data):
if self.debug:
! self.log_info ('sending %s' % repr(data))
self.out_buffer = self.out_buffer + data
self.initiate_send()
--- 441,464 ----
# ---------------------------------------------------------------------------
! class dispatcher_with_send(dispatcher):
!
! def __init__(self, sock=None):
! dispatcher.__init__(self, sock)
self.out_buffer = ''
! def initiate_send(self):
num_sent = 0
! num_sent = dispatcher.send(self, self.out_buffer[:512])
self.out_buffer = self.out_buffer[num_sent:]
! def handle_write(self):
self.initiate_send()
! def writable(self):
return (not self.connected) or len(self.out_buffer)
! def send(self, data):
if self.debug:
! self.log_info('sending %s' % repr(data))
self.out_buffer = self.out_buffer + data
self.initiate_send()
***************
*** 476,484 ****
# ---------------------------------------------------------------------------
! def compact_traceback ():
! t,v,tb = sys.exc_info()
tbinfo = []
! while 1:
! tbinfo.append ((
tb.tb_frame.f_code.co_filename,
tb.tb_frame.f_code.co_name,
--- 468,477 ----
# ---------------------------------------------------------------------------
! def compact_traceback():
! t, v, tb = sys.exc_info()
tbinfo = []
! assert tb # Must have a traceback
! while tb:
! tbinfo.append((
tb.tb_frame.f_code.co_filename,
tb.tb_frame.f_code.co_name,
***************
*** 486,491 ****
))
tb = tb.tb_next
- if not tb:
- break
# just to be safe
--- 479,482 ----
***************
*** 493,502 ****
file, function, line = tbinfo[-1]
! info = '[' + '] ['.join(map(lambda x: '|'.join(x), tbinfo)) + ']'
return (file, function, line), t, v, info
! def close_all (map=None):
if map is None:
! map=socket_map
for x in map.values():
x.socket.close()
--- 484,493 ----
file, function, line = tbinfo[-1]
! info = ' '.join(['[%s|%s|%s]' % x for x in tbinfo])
return (file, function, line), t, v, info
! def close_all(map=None):
if map is None:
! map = socket_map
for x in map.values():
x.socket.close()
***************
*** 522,555 ****
# here we override just enough to make a file
# look like a socket for the purposes of asyncore.
! def __init__ (self, fd):
self.fd = fd
! def recv (self, *args):
! return apply (os.read, (self.fd,)+args)
! def send (self, *args):
! return apply (os.write, (self.fd,)+args)
read = recv
write = send
! def close (self):
! return os.close (self.fd)
! def fileno (self):
return self.fd
! class file_dispatcher (dispatcher):
! def __init__ (self, fd):
! dispatcher.__init__ (self)
self.connected = 1
# set it to non-blocking mode
! flags = fcntl.fcntl (fd, fcntl.F_GETFL, 0)
flags = flags | os.O_NONBLOCK
! fcntl.fcntl (fd, fcntl.F_SETFL, flags)
! self.set_file (fd)
! def set_file (self, fd):
self._fileno = fd
! self.socket = file_wrapper (fd)
self.add_channel()
--- 513,548 ----
# here we override just enough to make a file
# look like a socket for the purposes of asyncore.
!
! def __init__(self, fd):
self.fd = fd
! def recv(self, *args):
! return os.read(self.fd, *args)
! def send(self, *args):
! return os.write(self.fd, *args)
read = recv
write = send
! def close(self):
! return os.close(self.fd)
! def fileno(self):
return self.fd
! class file_dispatcher(dispatcher):
!
! def __init__(self, fd):
! dispatcher.__init__(self)
self.connected = 1
# set it to non-blocking mode
! flags = fcntl.fcntl(fd, fcntl.F_GETFL, 0)
flags = flags | os.O_NONBLOCK
! fcntl.fcntl(fd, fcntl.F_SETFL, flags)
! self.set_file(fd)
! def set_file(self, fd):
self._fileno = fd
! self.socket = file_wrapper(fd)
self.add_channel()
Index: atexit.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/python-lib/atexit.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** atexit.py 21 Dec 2002 14:52:54 -0000 1.2
--- atexit.py 10 Nov 2003 12:44:15 -0000 1.3
***************
*** 18,22 ****
while _exithandlers:
func, targs, kargs = _exithandlers.pop()
! apply(func, targs, kargs)
def register(func, *targs, **kargs):
--- 18,22 ----
while _exithandlers:
func, targs, kargs = _exithandlers.pop()
! func(*targs, **kargs)
def register(func, *targs, **kargs):
Index: BaseHTTPServer.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/python-lib/BaseHTTPServer.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** BaseHTTPServer.py 21 Dec 2002 14:52:54 -0000 1.2
--- BaseHTTPServer.py 10 Nov 2003 12:44:15 -0000 1.3
***************
*** 3,7 ****
Note: the class in this module doesn't implement any HTTP request; see
SimpleHTTPServer for simple implementations of GET, HEAD and POST
! (including CGI scripts).
Contents:
--- 3,8 ----
Note: the class in this module doesn't implement any HTTP request; see
SimpleHTTPServer for simple implementations of GET, HEAD and POST
! (including CGI scripts). It does, however, optionally implement HTTP/1.1
! persistent connections, as of version 0.3.
Contents:
***************
*** 12,21 ****
XXX To do:
- - send server version
- log requests even later (to capture byte count)
- log user-agent header and other interesting goodies
- send error log to separate file
- - are request names really case sensitive?
-
"""
--- 13,19 ----
***************
*** 29,33 ****
#
# URL: http://www.ics.uci.edu/pub/ietf/http/draft-ietf-http-v10-spec-00.txt
!
# Log files
--- 27,39 ----
#
# URL: http://www.ics.uci.edu/pub/ietf/http/draft-ietf-http-v10-spec-00.txt
! #
! # and
! #
! # Network Working Group R. Fielding
! # Request for Comments: 2616 et al
! # Obsoletes: 2068 June 1999
! # Category: Standards Track
! #
! # URL: http://www.faqs.org/rfcs/rfc2616.html
# Log files
***************
*** 61,66 ****
# at the time the request was made!)
!
! __version__ = "0.2"
__all__ = ["HTTPServer", "BaseHTTPRequestHandler"]
--- 67,71 ----
# at the time the request was made!)
! __version__ = "0.3"
__all__ = ["HTTPServer", "BaseHTTPRequestHandler"]
***************
*** 71,74 ****
--- 76,80 ----
import mimetools
import SocketServer
+ import cStringIO
# Default error message
***************
*** 93,97 ****
"""Override server_bind to store the server name."""
SocketServer.TCPServer.server_bind(self)
! host, port = self.socket.getsockname()
self.server_name = socket.getfqdn(host)
self.server_port = port
--- 99,103 ----
"""Override server_bind to store the server name."""
SocketServer.TCPServer.server_bind(self)
! host, port = self.socket.getsockname()[:2]
self.server_name = socket.getfqdn(host)
self.server_port = port
***************
*** 123,135 ****
where <command> is a (case-sensitive) keyword such as GET or POST,
<path> is a string containing path information for the request,
! and <version> should be the string "HTTP/1.0". <path> is encoded
! using the URL encoding scheme (using %xx to signify the ASCII
! character with hex code xx).
! The protocol is vague about whether lines are separated by LF
! characters or by CRLF pairs -- for compatibility with the widest
! range of clients, both should be accepted. Similarly, whitespace
! in the request line should be treated sensibly (allowing multiple
! spaces between components and allowing trailing whitespace).
Similarly, for output, lines ought to be separated by CRLF pairs
--- 129,141 ----
where <command> is a (case-sensitive) keyword such as GET or POST,
<path> is a string containing path information for the request,
! and <version> should be the string "HTTP/1.0" or "HTTP/1.1".
! <path> is encoded using the URL encoding scheme (using %xx to signify
! the ASCII character with hex code xx).
! The specification specifies that lines are separated by CRLF but
! for compatibility with the widest range of clients recommends
! servers also handle LF. Similarly, whitespace in the request line
! is treated sensibly (allowing multiple spaces between components
! and allowing trailing whitespace).
Similarly, for output, lines ought to be separated by CRLF pairs
***************
*** 144,148 ****
the reply consists of just the data.
! The reply form of the HTTP 1.0 protocol again has three parts:
1. One line giving the response code
--- 150,154 ----
the reply consists of just the data.
! The reply form of the HTTP 1.x protocol again has three parts:
1. One line giving the response code
***************
*** 156,160 ****
<version> <responsecode> <responsestring>
! where <version> is the protocol version (always "HTTP/1.0"),
<responsecode> is a 3-digit response code indicating success or
failure of the request, and <responsestring> is an optional
--- 162,166 ----
<version> <responsecode> <responsestring>
! where <version> is the protocol version ("HTTP/1.0" or "HTTP/1.1"),
<responsecode> is a 3-digit response code indicating success or
failure of the request, and <responsestring> is an optional
***************
*** 213,225 ****
"""Parse a request (internal).
! The request should be stored in self.raw_request; the results
are in self.command, self.path, self.request_version and
self.headers.
! Return value is 1 for success, 0 for failure; on failure, an
error is sent back.
"""
self.request_version = version = "HTTP/0.9" # Default
requestline = self.raw_requestline
if requestline[-2:] == '\r\n':
--- 219,233 ----
"""Parse a request (internal).
! The request should be stored in self.raw_requestline; the results
are in self.command, self.path, self.request_version and
self.headers.
! Return True for success, False for failure; on failure, an
error is sent back.
"""
+ self.command = None # set in case of error on the first line
self.request_version = version = "HTTP/0.9" # Default
+ self.close_connection = 1
requestline = self.raw_requestline
if requestline[-2:] == '\r\n':
***************
*** 233,251 ****
if version[:5] != 'HTTP/':
self.send_error(400, "Bad request version (%s)" % `version`)
! return 0
elif len(words) == 2:
[command, path] = words
if command != 'GET':
self.send_error(400,
"Bad HTTP/0.9 request type (%s)" % `command`)
! return 0
else:
self.send_error(400, "Bad request syntax (%s)" % `requestline`)
! return 0
self.command, self.path, self.request_version = command, path, version
- self.headers = self.MessageClass(self.rfile, 0)
- return 1
! def handle(self):
"""Handle a single HTTP request.
--- 241,301 ----
if version[:5] != 'HTTP/':
self.send_error(400, "Bad request version (%s)" % `version`)
! return False
! try:
! base_version_number = version.split('/', 1)[1]
! version_number = base_version_number.split(".")
! # RFC 2145 section 3.1 says there can be only one "." and
! # - major and minor numbers MUST be treated as
! # separate integers;
! # - HTTP/2.4 is a lower version than HTTP/2.13, which in
! # turn is lower than HTTP/12.3;
! # - Leading zeros MUST be ignored by recipients.
! if len(version_number) != 2:
! raise ValueError
! version_number = int(version_number[0]), int(version_number[1])
! except (ValueError, IndexError):
! self.send_error(400, "Bad request version (%s)" % `version`)
! return False
! if version_number >= (1, 1) and self.protocol_version >= "HTTP/1.1":
! self.close_connection = 0
! if version_number >= (2, 0):
! self.send_error(505,
! "Invalid HTTP Version (%s)" % base_version_number)
! return False
elif len(words) == 2:
[command, path] = words
+ self.close_connection = 1
if command != 'GET':
self.send_error(400,
"Bad HTTP/0.9 request type (%s)" % `command`)
! return False
! elif not words:
! return False
else:
self.send_error(400, "Bad request syntax (%s)" % `requestline`)
! return False
self.command, self.path, self.request_version = command, path, version
! # Deal with pipelining
! bytes = ""
! while 1:
! line = self.rfile.readline()
! bytes = bytes + line
! if line == '\r\n' or line == '\n' or line == '':
! break
!
! # Examine the headers and look for a Connection directive
! hfile = cStringIO.StringIO(bytes)
! self.headers = self.MessageClass(hfile)
!
! conntype = self.headers.get('Connection', "")
! if conntype.lower() == 'close':
! self.close_connection = 1
! elif (conntype.lower() == 'keep-alive' and
! self.protocol_version >= "HTTP/1.1"):
! self.close_connection = 0
! return True
!
! def handle_one_request(self):
"""Handle a single HTTP request.
***************
*** 255,260 ****
"""
-
self.raw_requestline = self.rfile.readline()
if not self.parse_request(): # An error code has been sent, just exit
return
--- 305,312 ----
"""
self.raw_requestline = self.rfile.readline()
+ if not self.raw_requestline:
+ self.close_connection = 1
+ return
if not self.parse_request(): # An error code has been sent, just exit
return
***************
*** 266,269 ****
--- 318,329 ----
method()
+ def handle(self):
+ """Handle multiple requests if necessary."""
+ self.close_connection = 1
+
+ self.handle_one_request()
+ while not self.close_connection:
+ self.handle_one_request()
+
def send_error(self, code, message=None):
"""Send and log an error reply.
***************
*** 283,297 ****
except KeyError:
short, long = '???', '???'
! if not message:
message = short
explain = long
self.log_error("code %d, message %s", code, message)
self.send_response(code, message)
self.send_header("Content-Type", "text/html")
self.end_headers()
! self.wfile.write(self.error_message_format %
! {'code': code,
! 'message': message,
! 'explain': explain})
error_message_format = DEFAULT_ERROR_MESSAGE
--- 343,358 ----
except KeyError:
short, long = '???', '???'
! if message is None:
message = short
explain = long
self.log_error("code %d, message %s", code, message)
+ content = (self.error_message_format %
+ {'code': code, 'message': message, 'explain': explain})
self.send_response(code, message)
self.send_header("Content-Type", "text/html")
+ self.send_header('Connection', 'close')
self.end_headers()
! if self.command != 'HEAD' and code >= 200 and code not in (204, 304):
! self.wfile.write(content)
error_message_format = DEFAULT_ERROR_MESSAGE
***************
*** 306,316 ****
self.log_request(code)
if message is None:
! if self.responses.has_key(code):
message = self.responses[code][0]
else:
message = ''
if self.request_version != 'HTTP/0.9':
! self.wfile.write("%s %s %s\r\n" %
! (self.protocol_version, str(code), message))
self.send_header('Server', self.version_string())
self.send_header('Date', self.date_time_string())
--- 367,378 ----
self.log_request(code)
if message is None:
! if code in self.responses:
message = self.responses[code][0]
else:
message = ''
if self.request_version != 'HTTP/0.9':
! self.wfile.write("%s %d %s\r\n" %
! (self.protocol_version, code, message))
! # print (self.protocol_version, code, message)
self.send_header('Server', self.version_string())
self.send_header('Date', self.date_time_string())
***************
*** 321,324 ****
--- 383,392 ----
self.wfile.write("%s: %s\r\n" % (keyword, value))
+ if keyword.lower() == 'connection':
+ if value.lower() == 'close':
+ self.close_connection = 1
+ elif value.lower() == 'keep-alive':
+ self.close_connection = 0
+
def end_headers(self):
"""Send the blank line ending the MIME headers."""
***************
*** 348,352 ****
"""
! apply(self.log_message, args)
def log_message(self, format, *args):
--- 416,420 ----
"""
! self.log_message(*args)
def log_message(self, format, *args):
***************
*** 408,412 ****
"""
! host, port = self.client_address
return socket.getfqdn(host)
--- 476,480 ----
"""
! host, port = self.client_address[:2]
return socket.getfqdn(host)
***************
*** 414,419 ****
# The version of the HTTP protocol we support.
! # Don't override unless you know what you're doing (hint: incoming
! # requests are required to have exactly this version string).
protocol_version = "HTTP/1.0"
--- 482,486 ----
# The version of the HTTP protocol we support.
! # Set this to HTTP/1.1 to enable automatic keepalive
protocol_version = "HTTP/1.0"
***************
*** 425,440 ****
# See http://www.w3.org/hypertext/WWW/Protocols/HTTP/HTRESP.html
responses = {
200: ('OK', 'Request fulfilled, document follows'),
201: ('Created', 'Document created, URL follows'),
202: ('Accepted',
'Request accepted, processing continues off-line'),
! 203: ('Partial information', 'Request fulfilled from cache'),
204: ('No response', 'Request fulfilled, nothing follows'),
! 301: ('Moved', 'Object moved permanently -- see URI list'),
302: ('Found', 'Object moved temporarily -- see URI list'),
! 303: ('Method', 'Object moved -- see Method and URL list'),
304: ('Not modified',
! 'Document has not changed singe given time'),
400: ('Bad request',
--- 492,520 ----
# See http://www.w3.org/hypertext/WWW/Protocols/HTTP/HTRESP.html
responses = {
+ 100: ('Continue', 'Request received, please continue'),
+ 101: ('Switching Protocols',
+ 'Switching to new protocol; obey Upgrade header'),
+
200: ('OK', 'Request fulfilled, document follows'),
201: ('Created', 'Document created, URL follows'),
202: ('Accepted',
'Request accepted, processing continues off-line'),
! 203: ('Non-Authoritative Information', 'Request fulfilled from cache'),
204: ('No response', 'Request fulfilled, nothing follows'),
+ 205: ('Reset Content', 'Clear input form for further input.'),
+ 206: ('Partial Content', 'Partial content follows.'),
! 300: ('Multiple Choices',
! 'Object has several resources -- see URI list'),
! 301: ('Moved Permanently', 'Object moved permanently -- see URI list'),
302: ('Found', 'Object moved temporarily -- see URI list'),
! 303: ('See Other', 'Object moved -- see Method and URL list'),
304: ('Not modified',
! 'Document has not changed since given time'),
! 305: ('Use Proxy',
! 'You must use proxy specified in Location to access this '
! 'resource.'),
! 307: ('Temporary Redirect',
! 'Object moved temporarily -- see URI list'),
400: ('Bad request',
***************
*** 446,464 ****
403: ('Forbidden',
'Request forbidden -- authorization will not help'),
! 404: ('Not found', 'Nothing matches the given URI'),
500: ('Internal error', 'Server got itself in trouble'),
! 501: ('Not implemented',
'Server does not support this operation'),
! 502: ('Service temporarily overloaded',
'The server cannot process the request due to a high load'),
! 503: ('Gateway timeout',
'The gateway server did not receive a timely response'),
!
}
def test(HandlerClass = BaseHTTPRequestHandler,
! ServerClass = HTTPServer):
"""Test the HTTP request handler class.
--- 526,563 ----
403: ('Forbidden',
'Request forbidden -- authorization will not help'),
! 404: ('Not Found', 'Nothing matches the given URI'),
! 405: ('Method Not Allowed',
! 'Specified method is invalid for this server.'),
! 406: ('Not Acceptable', 'URI not available in preferred format.'),
! 407: ('Proxy Authentication Required', 'You must authenticate with '
! 'this proxy before proceeding.'),
! 408: ('Request Time-out', 'Request timed out; try again later.'),
! 409: ('Conflict', 'Request conflict.'),
! 410: ('Gone',
! 'URI no longer exists and has been permanently removed.'),
! 411: ('Length Required', 'Client must specify Content-Length.'),
! 412: ('Precondition Failed', 'Precondition in headers is false.'),
! 413: ('Request Entity Too Large', 'Entity is too large.'),
! 414: ('Request-URI Too Long', 'URI is too long.'),
! 415: ('Unsupported Media Type', 'Entity body in unsupported format.'),
! 416: ('Requested Range Not Satisfiable',
! 'Cannot satisfy request range.'),
! 417: ('Expectation Failed',
! 'Expect condition could not be satisfied.'),
500: ('Internal error', 'Server got itself in trouble'),
! 501: ('Not Implemented',
'Server does not support this operation'),
! 502: ('Bad Gateway', 'Invalid responses from another server/proxy.'),
! 503: ('Service temporarily overloaded',
'The server cannot process the request due to a high load'),
! 504: ('Gateway timeout',
'The gateway server did not receive a timely response'),
! 505: ('HTTP Version not supported', 'Cannot fulfill request.'),
}
def test(HandlerClass = BaseHTTPRequestHandler,
! ServerClass = HTTPServer, protocol="HTTP/1.0"):
"""Test the HTTP request handler class.
***************
*** 474,477 ****
--- 573,577 ----
server_address = ('', port)
+ HandlerClass.protocol_version = protocol
httpd = ServerClass(server_address, HandlerClass)
Index: Bastion.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/python-lib/Bastion.py,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** Bastion.py 1 Jul 2002 01:56:00 -0000 1.1.1.1
--- Bastion.py 10 Nov 2003 12:44:15 -0000 1.2
***************
*** 98,101 ****
--- 98,103 ----
"""
+ raise RuntimeError, "This code is not secure in Python 2.2 and 2.3"
+
# Note: we define *two* ad-hoc functions here, get1 and get2.
# Both are intended to be called in the same way: get(name).
Index: bdb.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/python-lib/bdb.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** bdb.py 21 Dec 2002 14:52:54 -0000 1.2
--- bdb.py 10 Nov 2003 12:44:15 -0000 1.3
***************
*** 7,11 ****
__all__ = ["BdbQuit","Bdb","Breakpoint"]
! BdbQuit = 'bdb.BdbQuit' # Exception to give up completely
--- 7,12 ----
__all__ = ["BdbQuit","Bdb","Breakpoint"]
! class BdbQuit(Exception):
! """Exception to give up completely"""
***************
*** 94,111 ****
# (CT) the former test for None is therefore removed from here.
if frame is self.stopframe:
! return 1
while frame is not None and frame is not self.stopframe:
if frame is self.botframe:
! return 1
frame = frame.f_back
! return 0
def break_here(self, frame):
filename = self.canonic(frame.f_code.co_filename)
! if not self.breaks.has_key(filename):
! return 0
lineno = frame.f_lineno
if not lineno in self.breaks[filename]:
! return 0
# flag says ok to delete temp. bp
(bp, flag) = effective(filename, lineno, frame)
--- 95,112 ----
# (CT) the former test for None is therefore removed from here.
if frame is self.stopframe:
! return True
while frame is not None and frame is not self.stopframe:
if frame is self.botframe:
! return True
frame = frame.f_back
! return False
def break_here(self, frame):
filename = self.canonic(frame.f_code.co_filename)
! if not filename in self.breaks:
! return False
lineno = frame.f_lineno
if not lineno in self.breaks[filename]:
! return False
# flag says ok to delete temp. bp
(bp, flag) = effective(filename, lineno, frame)
***************
*** 114,120 ****
if (flag and bp.temporary):
self.do_clear(str(bp.number))
! return 1
else:
! return 0
def do_clear(self, arg):
--- 115,121 ----
if (flag and bp.temporary):
self.do_clear(str(bp.number))
! return True
else:
! return False
def do_clear(self, arg):
***************
*** 211,215 ****
return 'Line %s:%d does not exist' % (filename,
lineno)
! if not self.breaks.has_key(filename):
self.breaks[filename] = []
list = self.breaks[filename]
--- 212,216 ----
return 'Line %s:%d does not exist' % (filename,
lineno)
! if not filename in self.breaks:
self.breaks[filename] = []
list = self.breaks[filename]
***************
*** 220,224 ****
def clear_break(self, filename, lineno):
filename = self.canonic(filename)
! if not self.breaks.has_key(filename):
return 'There are no breakpoints in %s' % filename
if lineno not in self.breaks[filename]:
--- 221,225 ----
def clear_break(self, filename, lineno):
filename = self.canonic(filename)
! if not filename in self.breaks:
return 'There are no breakpoints in %s' % filename
if lineno not in self.breaks[filename]:
***************
*** 249,253 ****
def clear_all_file_breaks(self, filename):
filename = self.canonic(filename)
! if not self.breaks.has_key(filename):
return 'There are no breakpoints in %s' % filename
for line in self.breaks[filename]:
--- 250,254 ----
def clear_all_file_breaks(self, filename):
filename = self.canonic(filename)
! if not filename in self.breaks:
return 'There are no breakpoints in %s' % filename
for line in self.breaks[filename]:
***************
*** 267,276 ****
def get_break(self, filename, lineno):
filename = self.canonic(filename)
! return self.breaks.has_key(filename) and \
lineno in self.breaks[filename]
def get_breaks(self, filename, lineno):
filename = self.canonic(filename)
! return self.breaks.has_key(filename) and \
lineno in self.breaks[filename] and \
Breakpoint.bplist[filename, lineno] or []
--- 268,277 ----
def get_break(self, filename, lineno):
filename = self.canonic(filename)
! return filename in self.breaks and \
lineno in self.breaks[filename]
def get_breaks(self, filename, lineno):
filename = self.canonic(filename)
! return filename in self.breaks and \
lineno in self.breaks[filename] and \
Breakpoint.bplist[filename, lineno] or []
***************
*** 278,282 ****
def get_file_breaks(self, filename):
filename = self.canonic(filename)
! if self.breaks.has_key(filename):
return self.breaks[filename]
else:
--- 279,283 ----
def get_file_breaks(self, filename):
filename = self.canonic(filename)
! if filename in self.breaks:
return self.breaks[filename]
else:
***************
*** 316,320 ****
else:
s = s + "<lambda>"
! if frame.f_locals.has_key('__args__'):
args = frame.f_locals['__args__']
else:
--- 317,321 ----
else:
s = s + "<lambda>"
! if '__args__' in frame.f_locals:
args = frame.f_locals['__args__']
else:
***************
*** 324,328 ****
else:
s = s + '()'
! if frame.f_locals.has_key('__return__'):
rv = frame.f_locals['__return__']
s = s + '->'
--- 325,329 ----
else:
s = s + '()'
! if '__return__' in frame.f_locals:
rv = frame.f_locals['__return__']
s = s + '->'
***************
*** 385,389 ****
try:
try:
! res = apply(func, args)
except BdbQuit:
pass
--- 386,390 ----
try:
try:
! res = func(*args)
except BdbQuit:
pass
Index: calend...
[truncated message content] |
Update of /cvsroot/wpdev/xmlscripts/python-lib/encodings
In directory sc8-pr-cvs1:/tmp/cvs-serv5168/encodings
Modified Files:
__init__.py aliases.py ascii.py base64_codec.py charmap.py
cp037.py cp1006.py cp1026.py cp1140.py cp1250.py cp1251.py
cp1252.py cp1253.py cp1254.py cp1255.py cp1256.py cp1257.py
cp1258.py cp424.py cp437.py cp500.py cp737.py cp775.py
cp850.py cp852.py cp855.py cp856.py cp857.py cp860.py cp861.py
cp862.py cp863.py cp864.py cp865.py cp866.py cp869.py cp874.py
cp875.py hex_codec.py iso8859_1.py iso8859_10.py iso8859_13.py
iso8859_14.py iso8859_15.py iso8859_2.py iso8859_3.py
iso8859_4.py iso8859_5.py iso8859_6.py iso8859_7.py
iso8859_8.py iso8859_9.py koi8_r.py latin_1.py mac_cyrillic.py
mac_greek.py mac_iceland.py mac_latin2.py mac_roman.py
mac_turkish.py mbcs.py raw_unicode_escape.py rot_13.py
undefined.py unicode_escape.py unicode_internal.py utf_16.py
utf_16_be.py utf_16_le.py utf_7.py utf_8.py uu_codec.py
zlib_codec.py
Log Message:
Updated to Python 2.3.2
Index: __init__.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/python-lib/encodings/__init__.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** __init__.py 21 Dec 2002 14:52:55 -0000 1.2
--- __init__.py 10 Nov 2003 12:44:16 -0000 1.3
***************
*** 4,10 ****
directory.
! Codec modules must have names corresponding to standard lower-case
! encoding names with hyphens mapped to underscores, e.g. 'utf-8' is
! implemented by the module 'utf_8.py'.
Each codec module must export the following interface:
--- 4,10 ----
directory.
! Codec modules must have names corresponding to normalized encoding
! names as defined in the normalize_encoding() function below, e.g.
! 'utf-8' must be implemented by the module 'utf_8.py'.
Each codec module must export the following interface:
***************
*** 19,25 ****
* getaliases() -> sequence of encoding name strings to use as aliases
! Alias names returned by getaliases() must be standard encoding
! names as defined above (lower-case, hyphens converted to
! underscores).
Written by Marc-Andre Lemburg (ma...@le...).
--- 19,24 ----
* getaliases() -> sequence of encoding name strings to use as aliases
! Alias names returned by getaliases() must be normalized encoding
! names as defined by normalize_encoding().
Written by Marc-Andre Lemburg (ma...@le...).
***************
*** 29,36 ****
"""#"
! import codecs,aliases,exceptions
_cache = {}
_unknown = '--unknown--'
class CodecRegistryError(exceptions.LookupError,
--- 28,42 ----
"""#"
! import codecs, exceptions, types
_cache = {}
_unknown = '--unknown--'
+ _import_tail = ['*']
+ _norm_encoding_map = (' . '
+ '0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ '
+ ' abcdefghijklmnopqrstuvwxyz '
+ ' '
+ ' '
+ ' ')
class CodecRegistryError(exceptions.LookupError,
***************
*** 38,57 ****
pass
def search_function(encoding):
!
# Cache lookup
! entry = _cache.get(encoding,_unknown)
if entry is not _unknown:
return entry
! # Import the module
! modname = encoding.replace('-', '_')
! modname = aliases.aliases.get(modname,modname)
try:
! mod = __import__(modname,globals(),locals(),'*')
! except ImportError,why:
! # cache misses
! _cache[encoding] = None
! return None
try:
--- 44,95 ----
pass
+ def normalize_encoding(encoding):
+
+ """ Normalize an encoding name.
+
+ Normalization works as follows: all non-alphanumeric
+ characters except the dot used for Python package names are
+ collapsed and replaced with a single underscore, e.g. ' -;#'
+ becomes '_'. Leading and trailing underscores are removed.
+
+ Note that encoding names should be ASCII only; if they do use
+ non-ASCII characters, these must be Latin-1 compatible.
+
+ """
+ # Make sure we have an 8-bit string, because .translate() works
+ # differently for Unicode strings.
+ if type(encoding) is types.UnicodeType:
+ # Note that .encode('latin-1') does *not* use the codec
+ # registry, so this call doesn't recurse. (See unicodeobject.c
+ # PyUnicode_AsEncodedString() for details)
+ encoding = encoding.encode('latin-1')
+ return '_'.join(encoding.translate(_norm_encoding_map).split())
+
def search_function(encoding):
!
# Cache lookup
! entry = _cache.get(encoding, _unknown)
if entry is not _unknown:
return entry
! # Import the module:
! #
! # First look in the encodings package, then try to lookup the
! # encoding in the aliases mapping and retry the import using the
! # default import module lookup scheme with the alias name.
! #
! modname = normalize_encoding(encoding)
try:
! mod = __import__('encodings.' + modname,
! globals(), locals(), _import_tail)
! except ImportError:
! import aliases
! modname = (aliases.aliases.get(modname) or
! aliases.aliases.get(modname.replace('.', '_')) or
! modname)
! try:
! mod = __import__(modname, globals(), locals(), _import_tail)
! except ImportError:
! mod = None
try:
***************
*** 59,70 ****
except AttributeError:
# Not a codec module
_cache[encoding] = None
return None
!
# Now ask the module for the registry entry
! try:
! entry = tuple(getregentry())
! except AttributeError:
! entry = ()
if len(entry) != 4:
raise CodecRegistryError,\
--- 97,109 ----
except AttributeError:
# Not a codec module
+ mod = None
+
+ if mod is None:
+ # Cache misses
_cache[encoding] = None
return None
!
# Now ask the module for the registry entry
! entry = tuple(getregentry())
if len(entry) != 4:
raise CodecRegistryError,\
***************
*** 87,90 ****
--- 126,130 ----
pass
else:
+ import aliases
for alias in codecaliases:
if not aliases.aliases.has_key(alias):
Index: aliases.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/python-lib/encodings/aliases.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** aliases.py 21 Dec 2002 14:52:55 -0000 1.2
--- aliases.py 10 Nov 2003 12:44:16 -0000 1.3
***************
*** 4,115 ****
map encodings names to module names.
! Note that the search function converts the encoding names to lower
! case and replaces hyphens with underscores *before* performing the
! lookup.
"""
aliases = {
! # Latin-1
! 'latin': 'latin_1',
! 'latin1': 'latin_1',
!
! # UTF-7
! 'utf7': 'utf_7',
! 'u7': 'utf_7',
!
! # UTF-8
! 'utf': 'utf_8',
! 'utf8': 'utf_8',
! 'u8': 'utf_8',
! 'utf8@ucs2': 'utf_8',
! 'utf8@ucs4': 'utf_8',
!
! # UTF-16
! 'utf16': 'utf_16',
! 'u16': 'utf_16',
! 'utf_16be': 'utf_16_be',
! 'utf_16le': 'utf_16_le',
! 'unicodebigunmarked': 'utf_16_be',
! 'unicodelittleunmarked': 'utf_16_le',
! # ASCII
! 'us_ascii': 'ascii',
! 'ansi_x3.4_1968': 'ascii', # used on Linux
! 'ansi_x3_4_1968': 'ascii', # used on BSD?
! '646': 'ascii', # used on Solaris
! # EBCDIC
! 'ebcdic_cp_us': 'cp037',
! 'ibm039': 'cp037',
! 'ibm1140': 'cp1140',
!
! # ISO
! '8859': 'latin_1',
! 'iso8859': 'latin_1',
! 'iso8859_1': 'latin_1',
! 'iso_8859_1': 'latin_1',
! 'iso_8859_10': 'iso8859_10',
! 'iso_8859_13': 'iso8859_13',
! 'iso_8859_14': 'iso8859_14',
! 'iso_8859_15': 'iso8859_15',
! 'iso_8859_2': 'iso8859_2',
! 'iso_8859_3': 'iso8859_3',
! 'iso_8859_4': 'iso8859_4',
! 'iso_8859_5': 'iso8859_5',
! 'iso_8859_6': 'iso8859_6',
! 'iso_8859_7': 'iso8859_7',
! 'iso_8859_8': 'iso8859_8',
! 'iso_8859_9': 'iso8859_9',
! # Mac
! 'maclatin2': 'mac_latin2',
! 'maccentraleurope': 'mac_latin2',
! 'maccyrillic': 'mac_cyrillic',
! 'macgreek': 'mac_greek',
! 'maciceland': 'mac_iceland',
! 'macroman': 'mac_roman',
! 'macturkish': 'mac_turkish',
! # Windows
! 'windows_1251': 'cp1251',
! 'windows_1252': 'cp1252',
! 'windows_1254': 'cp1254',
! 'windows_1255': 'cp1255',
! 'windows_1256': 'cp1256',
! 'windows_1257': 'cp1257',
! 'windows_1258': 'cp1258',
! # MBCS
! 'dbcs': 'mbcs',
! # Code pages
! '437': 'cp437',
! # CJK
! #
! # The codecs for these encodings are not distributed with the
! # Python core, but are included here for reference, since the
! # locale module relies on having these aliases available.
! #
! 'jis_7': 'jis_7',
! 'iso_2022_jp': 'jis_7',
! 'ujis': 'euc_jp',
! 'ajec': 'euc_jp',
! 'eucjp': 'euc_jp',
! 'tis260': 'tactis',
! 'sjis': 'shift_jis',
! # Content transfer/compression encodings
! 'rot13': 'rot_13',
! 'base64': 'base64_codec',
! 'base_64': 'base64_codec',
! 'zlib': 'zlib_codec',
! 'zip': 'zlib_codec',
! 'hex': 'hex_codec',
! 'uu': 'uu_codec',
! 'quopri': 'quopri_codec',
! 'quotedprintable': 'quopri_codec',
! 'quoted_printable': 'quopri_codec',
}
--- 4,341 ----
map encodings names to module names.
! Note that the search function normalizes the encoding names before
! doing the lookup, so the mapping will have to map normalized
! encoding names to module names.
!
! Contents:
!
! The following aliases dictionary contains mappings of all IANA
! character set names for which the Python core library provides
! codecs. In addition to these, a few Python specific codec
! aliases have also been added.
!
! About the CJK codec aliases:
!
! The codecs for these encodings are not distributed with the
! Python core, but are included here for reference, since the
! locale module relies on having these aliases available.
"""
aliases = {
! # ascii codec
! '646' : 'ascii',
! 'ansi_x3.4_1968' : 'ascii',
! 'ansi_x3_4_1968' : 'ascii', # some email headers use this non-standard name
! 'ansi_x3.4_1986' : 'ascii',
! 'cp367' : 'ascii',
! 'csascii' : 'ascii',
! 'ibm367' : 'ascii',
! 'iso646_us' : 'ascii',
! 'iso_646.irv_1991' : 'ascii',
! 'iso_ir_6' : 'ascii',
! 'us' : 'ascii',
! 'us_ascii' : 'ascii',
! # base64_codec codec
! 'base64' : 'base64_codec',
! 'base_64' : 'base64_codec',
! # cp037 codec
! 'csibm037' : 'cp037',
! 'ebcdic_cp_ca' : 'cp037',
! 'ebcdic_cp_nl' : 'cp037',
! 'ebcdic_cp_us' : 'cp037',
! 'ebcdic_cp_wt' : 'cp037',
! 'ibm037' : 'cp037',
! 'ibm039' : 'cp037',
! # cp1026 codec
! 'csibm1026' : 'cp1026',
! 'ibm1026' : 'cp1026',
! # cp1140 codec
! 'ibm1140' : 'cp1140',
! # cp1250 codec
! 'windows_1250' : 'cp1250',
! # cp1251 codec
! 'windows_1251' : 'cp1251',
! # cp1252 codec
! 'windows_1252' : 'cp1252',
! # cp1253 codec
! 'windows_1253' : 'cp1253',
!
! # cp1254 codec
! 'windows_1254' : 'cp1254',
!
! # cp1255 codec
! 'windows_1255' : 'cp1255',
!
! # cp1256 codec
! 'windows_1256' : 'cp1256',
!
! # cp1257 codec
! 'windows_1257' : 'cp1257',
!
! # cp1258 codec
! 'windows_1258' : 'cp1258',
!
! # cp424 codec
! 'csibm424' : 'cp424',
! 'ebcdic_cp_he' : 'cp424',
! 'ibm424' : 'cp424',
!
! # cp437 codec
! '437' : 'cp437',
! 'cspc8codepage437' : 'cp437',
! 'ibm437' : 'cp437',
!
! # cp500 codec
! 'csibm500' : 'cp500',
! 'ebcdic_cp_be' : 'cp500',
! 'ebcdic_cp_ch' : 'cp500',
! 'ibm500' : 'cp500',
!
! # cp775 codec
! 'cspc775baltic' : 'cp775',
! 'ibm775' : 'cp775',
!
! # cp850 codec
! '850' : 'cp850',
! 'cspc850multilingual' : 'cp850',
! 'ibm850' : 'cp850',
!
! # cp852 codec
! '852' : 'cp852',
! 'cspcp852' : 'cp852',
! 'ibm852' : 'cp852',
!
! # cp855 codec
! '855' : 'cp855',
! 'csibm855' : 'cp855',
! 'ibm855' : 'cp855',
!
! # cp857 codec
! '857' : 'cp857',
! 'csibm857' : 'cp857',
! 'ibm857' : 'cp857',
!
! # cp860 codec
! '860' : 'cp860',
! 'csibm860' : 'cp860',
! 'ibm860' : 'cp860',
!
! # cp861 codec
! '861' : 'cp861',
! 'cp_is' : 'cp861',
! 'csibm861' : 'cp861',
! 'ibm861' : 'cp861',
!
! # cp862 codec
! '862' : 'cp862',
! 'cspc862latinhebrew' : 'cp862',
! 'ibm862' : 'cp862',
!
! # cp863 codec
! '863' : 'cp863',
! 'csibm863' : 'cp863',
! 'ibm863' : 'cp863',
!
! # cp864 codec
! 'csibm864' : 'cp864',
! 'ibm864' : 'cp864',
!
! # cp865 codec
! '865' : 'cp865',
! 'csibm865' : 'cp865',
! 'ibm865' : 'cp865',
!
! # cp866 codec
! '866' : 'cp866',
! 'csibm866' : 'cp866',
! 'ibm866' : 'cp866',
!
! # cp869 codec
! '869' : 'cp869',
! 'cp_gr' : 'cp869',
! 'csibm869' : 'cp869',
! 'ibm869' : 'cp869',
!
! # hex_codec codec
! 'hex' : 'hex_codec',
!
! # iso8859_10 codec
! 'csisolatin6' : 'iso8859_10',
! 'iso_8859_10' : 'iso8859_10',
! 'iso_8859_10_1992' : 'iso8859_10',
! 'iso_ir_157' : 'iso8859_10',
! 'l6' : 'iso8859_10',
! 'latin6' : 'iso8859_10',
!
! # iso8859_13 codec
! 'iso_8859_13' : 'iso8859_13',
!
! # iso8859_14 codec
! 'iso_8859_14' : 'iso8859_14',
! 'iso_8859_14_1998' : 'iso8859_14',
! 'iso_celtic' : 'iso8859_14',
! 'iso_ir_199' : 'iso8859_14',
! 'l8' : 'iso8859_14',
! 'latin8' : 'iso8859_14',
!
! # iso8859_15 codec
! 'iso_8859_15' : 'iso8859_15',
!
! # iso8859_2 codec
! 'csisolatin2' : 'iso8859_2',
! 'iso_8859_2' : 'iso8859_2',
! 'iso_8859_2_1987' : 'iso8859_2',
! 'iso_ir_101' : 'iso8859_2',
! 'l2' : 'iso8859_2',
! 'latin2' : 'iso8859_2',
!
! # iso8859_3 codec
! 'csisolatin3' : 'iso8859_3',
! 'iso_8859_3' : 'iso8859_3',
! 'iso_8859_3_1988' : 'iso8859_3',
! 'iso_ir_109' : 'iso8859_3',
! 'l3' : 'iso8859_3',
! 'latin3' : 'iso8859_3',
!
! # iso8859_4 codec
! 'csisolatin4' : 'iso8859_4',
! 'iso_8859_4' : 'iso8859_4',
! 'iso_8859_4_1988' : 'iso8859_4',
! 'iso_ir_110' : 'iso8859_4',
! 'l4' : 'iso8859_4',
! 'latin4' : 'iso8859_4',
!
! # iso8859_5 codec
! 'csisolatincyrillic' : 'iso8859_5',
! 'cyrillic' : 'iso8859_5',
! 'iso_8859_5' : 'iso8859_5',
! 'iso_8859_5_1988' : 'iso8859_5',
! 'iso_ir_144' : 'iso8859_5',
!
! # iso8859_6 codec
! 'arabic' : 'iso8859_6',
! 'asmo_708' : 'iso8859_6',
! 'csisolatinarabic' : 'iso8859_6',
! 'ecma_114' : 'iso8859_6',
! 'iso_8859_6' : 'iso8859_6',
! 'iso_8859_6_1987' : 'iso8859_6',
! 'iso_ir_127' : 'iso8859_6',
!
! # iso8859_7 codec
! 'csisolatingreek' : 'iso8859_7',
! 'ecma_118' : 'iso8859_7',
! 'elot_928' : 'iso8859_7',
! 'greek' : 'iso8859_7',
! 'greek8' : 'iso8859_7',
! 'iso_8859_7' : 'iso8859_7',
! 'iso_8859_7_1987' : 'iso8859_7',
! 'iso_ir_126' : 'iso8859_7',
!
! # iso8859_8 codec
! 'csisolatinhebrew' : 'iso8859_8',
! 'hebrew' : 'iso8859_8',
! 'iso_8859_8' : 'iso8859_8',
! 'iso_8859_8_1988' : 'iso8859_8',
! 'iso_ir_138' : 'iso8859_8',
!
! # iso8859_9 codec
! 'csisolatin5' : 'iso8859_9',
! 'iso_8859_9' : 'iso8859_9',
! 'iso_8859_9_1989' : 'iso8859_9',
! 'iso_ir_148' : 'iso8859_9',
! 'l5' : 'iso8859_9',
! 'latin5' : 'iso8859_9',
!
! # jis_7 codec
! 'csiso2022jp' : 'jis_7',
! 'iso_2022_jp' : 'jis_7',
!
! # koi8_r codec
! 'cskoi8r' : 'koi8_r',
!
! # latin_1 codec
! '8859' : 'latin_1',
! 'cp819' : 'latin_1',
! 'csisolatin1' : 'latin_1',
! 'ibm819' : 'latin_1',
! 'iso8859' : 'latin_1',
! 'iso_8859_1' : 'latin_1',
! 'iso_8859_1_1987' : 'latin_1',
! 'iso_ir_100' : 'latin_1',
! 'l1' : 'latin_1',
! 'latin' : 'latin_1',
! 'latin1' : 'latin_1',
!
! # mac_cyrillic codec
! 'maccyrillic' : 'mac_cyrillic',
!
! # mac_greek codec
! 'macgreek' : 'mac_greek',
!
! # mac_iceland codec
! 'maciceland' : 'mac_iceland',
!
! # mac_latin2 codec
! 'maccentraleurope' : 'mac_latin2',
! 'maclatin2' : 'mac_latin2',
!
! # mac_roman codec
! 'macroman' : 'mac_roman',
!
! # mac_turkish codec
! 'macturkish' : 'mac_turkish',
!
! # mbcs codec
! 'dbcs' : 'mbcs',
!
! # quopri_codec codec
! 'quopri' : 'quopri_codec',
! 'quoted_printable' : 'quopri_codec',
! 'quotedprintable' : 'quopri_codec',
!
! # rot_13 codec
! 'rot13' : 'rot_13',
!
! # tactis codec
! 'tis260' : 'tactis',
!
! # utf_16 codec
! 'u16' : 'utf_16',
! 'utf16' : 'utf_16',
!
! # utf_16_be codec
! 'unicodebigunmarked' : 'utf_16_be',
! 'utf_16be' : 'utf_16_be',
!
! # utf_16_le codec
! 'unicodelittleunmarked' : 'utf_16_le',
! 'utf_16le' : 'utf_16_le',
!
! # utf_7 codec
! 'u7' : 'utf_7',
! 'utf7' : 'utf_7',
!
! # utf_8 codec
! 'u8' : 'utf_8',
! 'utf' : 'utf_8',
! 'utf8' : 'utf_8',
! 'utf8_ucs2' : 'utf_8',
! 'utf8_ucs4' : 'utf_8',
!
! # uu_codec codec
! 'uu' : 'uu_codec',
!
! # zlib_codec codec
! 'zip' : 'zlib_codec',
! 'zlib' : 'zlib_codec',
}
Index: ascii.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/python-lib/encodings/ascii.py,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** ascii.py 1 Jul 2002 01:57:21 -0000 1.1.1.1
--- ascii.py 10 Nov 2003 12:44:16 -0000 1.2
***************
*** 20,24 ****
class StreamWriter(Codec,codecs.StreamWriter):
pass
!
class StreamReader(Codec,codecs.StreamReader):
pass
--- 20,24 ----
class StreamWriter(Codec,codecs.StreamWriter):
pass
!
class StreamReader(Codec,codecs.StreamReader):
pass
Index: base64_codec.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/python-lib/encodings/base64_codec.py,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** base64_codec.py 1 Jul 2002 01:57:21 -0000 1.1.1.1
--- base64_codec.py 10 Nov 2003 12:44:16 -0000 1.2
***************
*** 52,56 ****
class StreamWriter(Codec,codecs.StreamWriter):
pass
!
class StreamReader(Codec,codecs.StreamReader):
pass
--- 52,56 ----
class StreamWriter(Codec,codecs.StreamWriter):
pass
!
class StreamReader(Codec,codecs.StreamReader):
pass
Index: charmap.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/python-lib/encodings/charmap.py,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** charmap.py 1 Jul 2002 01:57:21 -0000 1.1.1.1
--- charmap.py 10 Nov 2003 12:44:16 -0000 1.2
***************
*** 3,7 ****
Use this codec directly rather than through the automatic
conversion mechanisms supplied by unicode() and .encode().
!
Written by Marc-Andre Lemburg (ma...@le...).
--- 3,7 ----
Use this codec directly rather than through the automatic
conversion mechanisms supplied by unicode() and .encode().
!
Written by Marc-Andre Lemburg (ma...@le...).
***************
*** 32,36 ****
return Codec.encode(input,errors,self.mapping)
!
class StreamReader(Codec,codecs.StreamReader):
--- 32,36 ----
return Codec.encode(input,errors,self.mapping)
!
class StreamReader(Codec,codecs.StreamReader):
***************
*** 49,51 ****
return (Codec.encode,Codec.decode,StreamReader,StreamWriter)
-
--- 49,50 ----
Index: cp037.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/python-lib/encodings/cp037.py,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** cp037.py 1 Jul 2002 01:57:22 -0000 1.1.1.1
--- cp037.py 10 Nov 2003 12:44:16 -0000 1.2
***************
*** 17,21 ****
return codecs.charmap_encode(input,errors,encoding_map)
!
def decode(self,input,errors='strict'):
--- 17,21 ----
return codecs.charmap_encode(input,errors,encoding_map)
!
def decode(self,input,errors='strict'):
***************
*** 24,28 ****
class StreamWriter(Codec,codecs.StreamWriter):
pass
!
class StreamReader(Codec,codecs.StreamReader):
pass
--- 24,28 ----
class StreamWriter(Codec,codecs.StreamWriter):
pass
!
class StreamReader(Codec,codecs.StreamReader):
pass
***************
*** 38,277 ****
decoding_map = codecs.make_identity_dict(range(256))
decoding_map.update({
! 0x0004: 0x009c, # CONTROL
! 0x0005: 0x0009, # HORIZONTAL TABULATION
! 0x0006: 0x0086, # CONTROL
! 0x0007: 0x007f, # DELETE
! 0x0008: 0x0097, # CONTROL
! 0x0009: 0x008d, # CONTROL
! 0x000a: 0x008e, # CONTROL
! 0x0014: 0x009d, # CONTROL
! 0x0015: 0x0085, # CONTROL
! 0x0016: 0x0008, # BACKSPACE
! 0x0017: 0x0087, # CONTROL
! 0x001a: 0x0092, # CONTROL
! 0x001b: 0x008f, # CONTROL
! 0x0020: 0x0080, # CONTROL
! 0x0021: 0x0081, # CONTROL
! 0x0022: 0x0082, # CONTROL
! 0x0023: 0x0083, # CONTROL
! 0x0024: 0x0084, # CONTROL
! 0x0025: 0x000a, # LINE FEED
! 0x0026: 0x0017, # END OF TRANSMISSION BLOCK
! 0x0027: 0x001b, # ESCAPE
! 0x0028: 0x0088, # CONTROL
! 0x0029: 0x0089, # CONTROL
! 0x002a: 0x008a, # CONTROL
! 0x002b: 0x008b, # CONTROL
! 0x002c: 0x008c, # CONTROL
! 0x002d: 0x0005, # ENQUIRY
! 0x002e: 0x0006, # ACKNOWLEDGE
! 0x002f: 0x0007, # BELL
! 0x0030: 0x0090, # CONTROL
! 0x0031: 0x0091, # CONTROL
! 0x0032: 0x0016, # SYNCHRONOUS IDLE
! 0x0033: 0x0093, # CONTROL
! 0x0034: 0x0094, # CONTROL
! 0x0035: 0x0095, # CONTROL
! 0x0036: 0x0096, # CONTROL
! 0x0037: 0x0004, # END OF TRANSMISSION
! 0x0038: 0x0098, # CONTROL
! 0x0039: 0x0099, # CONTROL
! 0x003a: 0x009a, # CONTROL
! 0x003b: 0x009b, # CONTROL
! 0x003c: 0x0014, # DEVICE CONTROL FOUR
! 0x003d: 0x0015, # NEGATIVE ACKNOWLEDGE
! 0x003e: 0x009e, # CONTROL
! 0x003f: 0x001a, # SUBSTITUTE
! 0x0040: 0x0020, # SPACE
! 0x0041: 0x00a0, # NO-BREAK SPACE
! 0x0042: 0x00e2, # LATIN SMALL LETTER A WITH CIRCUMFLEX
! 0x0043: 0x00e4, # LATIN SMALL LETTER A WITH DIAERESIS
! 0x0044: 0x00e0, # LATIN SMALL LETTER A WITH GRAVE
! 0x0045: 0x00e1, # LATIN SMALL LETTER A WITH ACUTE
! 0x0046: 0x00e3, # LATIN SMALL LETTER A WITH TILDE
! 0x0047: 0x00e5, # LATIN SMALL LETTER A WITH RING ABOVE
! 0x0048: 0x00e7, # LATIN SMALL LETTER C WITH CEDILLA
! 0x0049: 0x00f1, # LATIN SMALL LETTER N WITH TILDE
! 0x004a: 0x00a2, # CENT SIGN
! 0x004b: 0x002e, # FULL STOP
! 0x004c: 0x003c, # LESS-THAN SIGN
! 0x004d: 0x0028, # LEFT PARENTHESIS
! 0x004e: 0x002b, # PLUS SIGN
! 0x004f: 0x007c, # VERTICAL LINE
! 0x0050: 0x0026, # AMPERSAND
! 0x0051: 0x00e9, # LATIN SMALL LETTER E WITH ACUTE
! 0x0052: 0x00ea, # LATIN SMALL LETTER E WITH CIRCUMFLEX
! 0x0053: 0x00eb, # LATIN SMALL LETTER E WITH DIAERESIS
! 0x0054: 0x00e8, # LATIN SMALL LETTER E WITH GRAVE
! 0x0055: 0x00ed, # LATIN SMALL LETTER I WITH ACUTE
! 0x0056: 0x00ee, # LATIN SMALL LETTER I WITH CIRCUMFLEX
! 0x0057: 0x00ef, # LATIN SMALL LETTER I WITH DIAERESIS
! 0x0058: 0x00ec, # LATIN SMALL LETTER I WITH GRAVE
! 0x0059: 0x00df, # LATIN SMALL LETTER SHARP S (GERMAN)
! 0x005a: 0x0021, # EXCLAMATION MARK
! 0x005b: 0x0024, # DOLLAR SIGN
! 0x005c: 0x002a, # ASTERISK
! 0x005d: 0x0029, # RIGHT PARENTHESIS
! 0x005e: 0x003b, # SEMICOLON
! 0x005f: 0x00ac, # NOT SIGN
! 0x0060: 0x002d, # HYPHEN-MINUS
! 0x0061: 0x002f, # SOLIDUS
! 0x0062: 0x00c2, # LATIN CAPITAL LETTER A WITH CIRCUMFLEX
! 0x0063: 0x00c4, # LATIN CAPITAL LETTER A WITH DIAERESIS
! 0x0064: 0x00c0, # LATIN CAPITAL LETTER A WITH GRAVE
! 0x0065: 0x00c1, # LATIN CAPITAL LETTER A WITH ACUTE
! 0x0066: 0x00c3, # LATIN CAPITAL LETTER A WITH TILDE
! 0x0067: 0x00c5, # LATIN CAPITAL LETTER A WITH RING ABOVE
! 0x0068: 0x00c7, # LATIN CAPITAL LETTER C WITH CEDILLA
! 0x0069: 0x00d1, # LATIN CAPITAL LETTER N WITH TILDE
! 0x006a: 0x00a6, # BROKEN BAR
! 0x006b: 0x002c, # COMMA
! 0x006c: 0x0025, # PERCENT SIGN
! 0x006d: 0x005f, # LOW LINE
! 0x006e: 0x003e, # GREATER-THAN SIGN
! 0x006f: 0x003f, # QUESTION MARK
! 0x0070: 0x00f8, # LATIN SMALL LETTER O WITH STROKE
! 0x0071: 0x00c9, # LATIN CAPITAL LETTER E WITH ACUTE
! 0x0072: 0x00ca, # LATIN CAPITAL LETTER E WITH CIRCUMFLEX
! 0x0073: 0x00cb, # LATIN CAPITAL LETTER E WITH DIAERESIS
! 0x0074: 0x00c8, # LATIN CAPITAL LETTER E WITH GRAVE
! 0x0075: 0x00cd, # LATIN CAPITAL LETTER I WITH ACUTE
! 0x0076: 0x00ce, # LATIN CAPITAL LETTER I WITH CIRCUMFLEX
! 0x0077: 0x00cf, # LATIN CAPITAL LETTER I WITH DIAERESIS
! 0x0078: 0x00cc, # LATIN CAPITAL LETTER I WITH GRAVE
! 0x0079: 0x0060, # GRAVE ACCENT
! 0x007a: 0x003a, # COLON
! 0x007b: 0x0023, # NUMBER SIGN
! 0x007c: 0x0040, # COMMERCIAL AT
! 0x007d: 0x0027, # APOSTROPHE
! 0x007e: 0x003d, # EQUALS SIGN
! 0x007f: 0x0022, # QUOTATION MARK
! 0x0080: 0x00d8, # LATIN CAPITAL LETTER O WITH STROKE
! 0x0081: 0x0061, # LATIN SMALL LETTER A
! 0x0082: 0x0062, # LATIN SMALL LETTER B
! 0x0083: 0x0063, # LATIN SMALL LETTER C
! 0x0084: 0x0064, # LATIN SMALL LETTER D
! 0x0085: 0x0065, # LATIN SMALL LETTER E
! 0x0086: 0x0066, # LATIN SMALL LETTER F
! 0x0087: 0x0067, # LATIN SMALL LETTER G
! 0x0088: 0x0068, # LATIN SMALL LETTER H
! 0x0089: 0x0069, # LATIN SMALL LETTER I
! 0x008a: 0x00ab, # LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
! 0x008b: 0x00bb, # RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
! 0x008c: 0x00f0, # LATIN SMALL LETTER ETH (ICELANDIC)
! 0x008d: 0x00fd, # LATIN SMALL LETTER Y WITH ACUTE
! 0x008e: 0x00fe, # LATIN SMALL LETTER THORN (ICELANDIC)
! 0x008f: 0x00b1, # PLUS-MINUS SIGN
! 0x0090: 0x00b0, # DEGREE SIGN
! 0x0091: 0x006a, # LATIN SMALL LETTER J
! 0x0092: 0x006b, # LATIN SMALL LETTER K
! 0x0093: 0x006c, # LATIN SMALL LETTER L
! 0x0094: 0x006d, # LATIN SMALL LETTER M
! 0x0095: 0x006e, # LATIN SMALL LETTER N
! 0x0096: 0x006f, # LATIN SMALL LETTER O
! 0x0097: 0x0070, # LATIN SMALL LETTER P
! 0x0098: 0x0071, # LATIN SMALL LETTER Q
! 0x0099: 0x0072, # LATIN SMALL LETTER R
! 0x009a: 0x00aa, # FEMININE ORDINAL INDICATOR
! 0x009b: 0x00ba, # MASCULINE ORDINAL INDICATOR
! 0x009c: 0x00e6, # LATIN SMALL LIGATURE AE
! 0x009d: 0x00b8, # CEDILLA
! 0x009e: 0x00c6, # LATIN CAPITAL LIGATURE AE
! 0x009f: 0x00a4, # CURRENCY SIGN
! 0x00a0: 0x00b5, # MICRO SIGN
! 0x00a1: 0x007e, # TILDE
! 0x00a2: 0x0073, # LATIN SMALL LETTER S
! 0x00a3: 0x0074, # LATIN SMALL LETTER T
! 0x00a4: 0x0075, # LATIN SMALL LETTER U
! 0x00a5: 0x0076, # LATIN SMALL LETTER V
! 0x00a6: 0x0077, # LATIN SMALL LETTER W
! 0x00a7: 0x0078, # LATIN SMALL LETTER X
! 0x00a8: 0x0079, # LATIN SMALL LETTER Y
! 0x00a9: 0x007a, # LATIN SMALL LETTER Z
! 0x00aa: 0x00a1, # INVERTED EXCLAMATION MARK
! 0x00ab: 0x00bf, # INVERTED QUESTION MARK
! 0x00ac: 0x00d0, # LATIN CAPITAL LETTER ETH (ICELANDIC)
! 0x00ad: 0x00dd, # LATIN CAPITAL LETTER Y WITH ACUTE
! 0x00ae: 0x00de, # LATIN CAPITAL LETTER THORN (ICELANDIC)
! 0x00af: 0x00ae, # REGISTERED SIGN
! 0x00b0: 0x005e, # CIRCUMFLEX ACCENT
! 0x00b1: 0x00a3, # POUND SIGN
! 0x00b2: 0x00a5, # YEN SIGN
! 0x00b3: 0x00b7, # MIDDLE DOT
! 0x00b4: 0x00a9, # COPYRIGHT SIGN
! 0x00b5: 0x00a7, # SECTION SIGN
! 0x00b7: 0x00bc, # VULGAR FRACTION ONE QUARTER
! 0x00b8: 0x00bd, # VULGAR FRACTION ONE HALF
! 0x00b9: 0x00be, # VULGAR FRACTION THREE QUARTERS
! 0x00ba: 0x005b, # LEFT SQUARE BRACKET
! 0x00bb: 0x005d, # RIGHT SQUARE BRACKET
! 0x00bc: 0x00af, # MACRON
! 0x00bd: 0x00a8, # DIAERESIS
! 0x00be: 0x00b4, # ACUTE ACCENT
! 0x00bf: 0x00d7, # MULTIPLICATION SIGN
! 0x00c0: 0x007b, # LEFT CURLY BRACKET
! 0x00c1: 0x0041, # LATIN CAPITAL LETTER A
! 0x00c2: 0x0042, # LATIN CAPITAL LETTER B
! 0x00c3: 0x0043, # LATIN CAPITAL LETTER C
! 0x00c4: 0x0044, # LATIN CAPITAL LETTER D
! 0x00c5: 0x0045, # LATIN CAPITAL LETTER E
! 0x00c6: 0x0046, # LATIN CAPITAL LETTER F
! 0x00c7: 0x0047, # LATIN CAPITAL LETTER G
! 0x00c8: 0x0048, # LATIN CAPITAL LETTER H
! 0x00c9: 0x0049, # LATIN CAPITAL LETTER I
! 0x00ca: 0x00ad, # SOFT HYPHEN
! 0x00cb: 0x00f4, # LATIN SMALL LETTER O WITH CIRCUMFLEX
! 0x00cc: 0x00f6, # LATIN SMALL LETTER O WITH DIAERESIS
! 0x00cd: 0x00f2, # LATIN SMALL LETTER O WITH GRAVE
! 0x00ce: 0x00f3, # LATIN SMALL LETTER O WITH ACUTE
! 0x00cf: 0x00f5, # LATIN SMALL LETTER O WITH TILDE
! 0x00d0: 0x007d, # RIGHT CURLY BRACKET
! 0x00d1: 0x004a, # LATIN CAPITAL LETTER J
! 0x00d2: 0x004b, # LATIN CAPITAL LETTER K
! 0x00d3: 0x004c, # LATIN CAPITAL LETTER L
! 0x00d4: 0x004d, # LATIN CAPITAL LETTER M
! 0x00d5: 0x004e, # LATIN CAPITAL LETTER N
! 0x00d6: 0x004f, # LATIN CAPITAL LETTER O
! 0x00d7: 0x0050, # LATIN CAPITAL LETTER P
! 0x00d8: 0x0051, # LATIN CAPITAL LETTER Q
! 0x00d9: 0x0052, # LATIN CAPITAL LETTER R
! 0x00da: 0x00b9, # SUPERSCRIPT ONE
! 0x00db: 0x00fb, # LATIN SMALL LETTER U WITH CIRCUMFLEX
! 0x00dc: 0x00fc, # LATIN SMALL LETTER U WITH DIAERESIS
! 0x00dd: 0x00f9, # LATIN SMALL LETTER U WITH GRAVE
! 0x00de: 0x00fa, # LATIN SMALL LETTER U WITH ACUTE
! 0x00df: 0x00ff, # LATIN SMALL LETTER Y WITH DIAERESIS
! 0x00e0: 0x005c, # REVERSE SOLIDUS
! 0x00e1: 0x00f7, # DIVISION SIGN
! 0x00e2: 0x0053, # LATIN CAPITAL LETTER S
! 0x00e3: 0x0054, # LATIN CAPITAL LETTER T
! 0x00e4: 0x0055, # LATIN CAPITAL LETTER U
! 0x00e5: 0x0056, # LATIN CAPITAL LETTER V
! 0x00e6: 0x0057, # LATIN CAPITAL LETTER W
! 0x00e7: 0x0058, # LATIN CAPITAL LETTER X
! 0x00e8: 0x0059, # LATIN CAPITAL LETTER Y
! 0x00e9: 0x005a, # LATIN CAPITAL LETTER Z
! 0x00ea: 0x00b2, # SUPERSCRIPT TWO
! 0x00eb: 0x00d4, # LATIN CAPITAL LETTER O WITH CIRCUMFLEX
! 0x00ec: 0x00d6, # LATIN CAPITAL LETTER O WITH DIAERESIS
! 0x00ed: 0x00d2, # LATIN CAPITAL LETTER O WITH GRAVE
! 0x00ee: 0x00d3, # LATIN CAPITAL LETTER O WITH ACUTE
! 0x00ef: 0x00d5, # LATIN CAPITAL LETTER O WITH TILDE
! 0x00f0: 0x0030, # DIGIT ZERO
! 0x00f1: 0x0031, # DIGIT ONE
! 0x00f2: 0x0032, # DIGIT TWO
! 0x00f3: 0x0033, # DIGIT THREE
! 0x00f4: 0x0034, # DIGIT FOUR
! 0x00f5: 0x0035, # DIGIT FIVE
! 0x00f6: 0x0036, # DIGIT SIX
! 0x00f7: 0x0037, # DIGIT SEVEN
! 0x00f8: 0x0038, # DIGIT EIGHT
! 0x00f9: 0x0039, # DIGIT NINE
! 0x00fa: 0x00b3, # SUPERSCRIPT THREE
! 0x00fb: 0x00db, # LATIN CAPITAL LETTER U WITH CIRCUMFLEX
! 0x00fc: 0x00dc, # LATIN CAPITAL LETTER U WITH DIAERESIS
! 0x00fd: 0x00d9, # LATIN CAPITAL LETTER U WITH GRAVE
! 0x00fe: 0x00da, # LATIN CAPITAL LETTER U WITH ACUTE
! 0x00ff: 0x009f, # CONTROL
})
--- 38,277 ----
decoding_map = codecs.make_identity_dict(range(256))
decoding_map.update({
! 0x0004: 0x009c, # CONTROL
! 0x0005: 0x0009, # HORIZONTAL TABULATION
! 0x0006: 0x0086, # CONTROL
! 0x0007: 0x007f, # DELETE
! 0x0008: 0x0097, # CONTROL
! 0x0009: 0x008d, # CONTROL
! 0x000a: 0x008e, # CONTROL
! 0x0014: 0x009d, # CONTROL
! 0x0015: 0x0085, # CONTROL
! 0x0016: 0x0008, # BACKSPACE
! 0x0017: 0x0087, # CONTROL
! 0x001a: 0x0092, # CONTROL
! 0x001b: 0x008f, # CONTROL
! 0x0020: 0x0080, # CONTROL
! 0x0021: 0x0081, # CONTROL
! 0x0022: 0x0082, # CONTROL
! 0x0023: 0x0083, # CONTROL
! 0x0024: 0x0084, # CONTROL
! 0x0025: 0x000a, # LINE FEED
! 0x0026: 0x0017, # END OF TRANSMISSION BLOCK
! 0x0027: 0x001b, # ESCAPE
! 0x0028: 0x0088, # CONTROL
! 0x0029: 0x0089, # CONTROL
! 0x002a: 0x008a, # CONTROL
! 0x002b: 0x008b, # CONTROL
! 0x002c: 0x008c, # CONTROL
! 0x002d: 0x0005, # ENQUIRY
! 0x002e: 0x0006, # ACKNOWLEDGE
! 0x002f: 0x0007, # BELL
! 0x0030: 0x0090, # CONTROL
! 0x0031: 0x0091, # CONTROL
! 0x0032: 0x0016, # SYNCHRONOUS IDLE
! 0x0033: 0x0093, # CONTROL
! 0x0034: 0x0094, # CONTROL
! 0x0035: 0x0095, # CONTROL
! 0x0036: 0x0096, # CONTROL
! 0x0037: 0x0004, # END OF TRANSMISSION
! 0x0038: 0x0098, # CONTROL
! 0x0039: 0x0099, # CONTROL
! 0x003a: 0x009a, # CONTROL
! 0x003b: 0x009b, # CONTROL
! 0x003c: 0x0014, # DEVICE CONTROL FOUR
! 0x003d: 0x0015, # NEGATIVE ACKNOWLEDGE
! 0x003e: 0x009e, # CONTROL
! 0x003f: 0x001a, # SUBSTITUTE
! 0x0040: 0x0020, # SPACE
! 0x0041: 0x00a0, # NO-BREAK SPACE
! 0x0042: 0x00e2, # LATIN SMALL LETTER A WITH CIRCUMFLEX
! 0x0043: 0x00e4, # LATIN SMALL LETTER A WITH DIAERESIS
! 0x0044: 0x00e0, # LATIN SMALL LETTER A WITH GRAVE
! 0x0045: 0x00e1, # LATIN SMALL LETTER A WITH ACUTE
! 0x0046: 0x00e3, # LATIN SMALL LETTER A WITH TILDE
! 0x0047: 0x00e5, # LATIN SMALL LETTER A WITH RING ABOVE
! 0x0048: 0x00e7, # LATIN SMALL LETTER C WITH CEDILLA
! 0x0049: 0x00f1, # LATIN SMALL LETTER N WITH TILDE
! 0x004a: 0x00a2, # CENT SIGN
! 0x004b: 0x002e, # FULL STOP
! 0x004c: 0x003c, # LESS-THAN SIGN
! 0x004d: 0x0028, # LEFT PARENTHESIS
! 0x004e: 0x002b, # PLUS SIGN
! 0x004f: 0x007c, # VERTICAL LINE
! 0x0050: 0x0026, # AMPERSAND
! 0x0051: 0x00e9, # LATIN SMALL LETTER E WITH ACUTE
! 0x0052: 0x00ea, # LATIN SMALL LETTER E WITH CIRCUMFLEX
! 0x0053: 0x00eb, # LATIN SMALL LETTER E WITH DIAERESIS
! 0x0054: 0x00e8, # LATIN SMALL LETTER E WITH GRAVE
! 0x0055: 0x00ed, # LATIN SMALL LETTER I WITH ACUTE
! 0x0056: 0x00ee, # LATIN SMALL LETTER I WITH CIRCUMFLEX
! 0x0057: 0x00ef, # LATIN SMALL LETTER I WITH DIAERESIS
! 0x0058: 0x00ec, # LATIN SMALL LETTER I WITH GRAVE
! 0x0059: 0x00df, # LATIN SMALL LETTER SHARP S (GERMAN)
! 0x005a: 0x0021, # EXCLAMATION MARK
! 0x005b: 0x0024, # DOLLAR SIGN
! 0x005c: 0x002a, # ASTERISK
! 0x005d: 0x0029, # RIGHT PARENTHESIS
! 0x005e: 0x003b, # SEMICOLON
! 0x005f: 0x00ac, # NOT SIGN
! 0x0060: 0x002d, # HYPHEN-MINUS
! 0x0061: 0x002f, # SOLIDUS
! 0x0062: 0x00c2, # LATIN CAPITAL LETTER A WITH CIRCUMFLEX
! 0x0063: 0x00c4, # LATIN CAPITAL LETTER A WITH DIAERESIS
! 0x0064: 0x00c0, # LATIN CAPITAL LETTER A WITH GRAVE
! 0x0065: 0x00c1, # LATIN CAPITAL LETTER A WITH ACUTE
! 0x0066: 0x00c3, # LATIN CAPITAL LETTER A WITH TILDE
! 0x0067: 0x00c5, # LATIN CAPITAL LETTER A WITH RING ABOVE
! 0x0068: 0x00c7, # LATIN CAPITAL LETTER C WITH CEDILLA
! 0x0069: 0x00d1, # LATIN CAPITAL LETTER N WITH TILDE
! 0x006a: 0x00a6, # BROKEN BAR
! 0x006b: 0x002c, # COMMA
! 0x006c: 0x0025, # PERCENT SIGN
! 0x006d: 0x005f, # LOW LINE
! 0x006e: 0x003e, # GREATER-THAN SIGN
! 0x006f: 0x003f, # QUESTION MARK
! 0x0070: 0x00f8, # LATIN SMALL LETTER O WITH STROKE
! 0x0071: 0x00c9, # LATIN CAPITAL LETTER E WITH ACUTE
! 0x0072: 0x00ca, # LATIN CAPITAL LETTER E WITH CIRCUMFLEX
! 0x0073: 0x00cb, # LATIN CAPITAL LETTER E WITH DIAERESIS
! 0x0074: 0x00c8, # LATIN CAPITAL LETTER E WITH GRAVE
! 0x0075: 0x00cd, # LATIN CAPITAL LETTER I WITH ACUTE
! 0x0076: 0x00ce, # LATIN CAPITAL LETTER I WITH CIRCUMFLEX
! 0x0077: 0x00cf, # LATIN CAPITAL LETTER I WITH DIAERESIS
! 0x0078: 0x00cc, # LATIN CAPITAL LETTER I WITH GRAVE
! 0x0079: 0x0060, # GRAVE ACCENT
! 0x007a: 0x003a, # COLON
! 0x007b: 0x0023, # NUMBER SIGN
! 0x007c: 0x0040, # COMMERCIAL AT
! 0x007d: 0x0027, # APOSTROPHE
! 0x007e: 0x003d, # EQUALS SIGN
! 0x007f: 0x0022, # QUOTATION MARK
! 0x0080: 0x00d8, # LATIN CAPITAL LETTER O WITH STROKE
! 0x0081: 0x0061, # LATIN SMALL LETTER A
! 0x0082: 0x0062, # LATIN SMALL LETTER B
! 0x0083: 0x0063, # LATIN SMALL LETTER C
! 0x0084: 0x0064, # LATIN SMALL LETTER D
! 0x0085: 0x0065, # LATIN SMALL LETTER E
! 0x0086: 0x0066, # LATIN SMALL LETTER F
! 0x0087: 0x0067, # LATIN SMALL LETTER G
! 0x0088: 0x0068, # LATIN SMALL LETTER H
! 0x0089: 0x0069, # LATIN SMALL LETTER I
! 0x008a: 0x00ab, # LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
! 0x008b: 0x00bb, # RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
! 0x008c: 0x00f0, # LATIN SMALL LETTER ETH (ICELANDIC)
! 0x008d: 0x00fd, # LATIN SMALL LETTER Y WITH ACUTE
! 0x008e: 0x00fe, # LATIN SMALL LETTER THORN (ICELANDIC)
! 0x008f: 0x00b1, # PLUS-MINUS SIGN
! 0x0090: 0x00b0, # DEGREE SIGN
! 0x0091: 0x006a, # LATIN SMALL LETTER J
! 0x0092: 0x006b, # LATIN SMALL LETTER K
! 0x0093: 0x006c, # LATIN SMALL LETTER L
! 0x0094: 0x006d, # LATIN SMALL LETTER M
! 0x0095: 0x006e, # LATIN SMALL LETTER N
! 0x0096: 0x006f, # LATIN SMALL LETTER O
! 0x0097: 0x0070, # LATIN SMALL LETTER P
! 0x0098: 0x0071, # LATIN SMALL LETTER Q
! 0x0099: 0x0072, # LATIN SMALL LETTER R
! 0x009a: 0x00aa, # FEMININE ORDINAL INDICATOR
! 0x009b: 0x00ba, # MASCULINE ORDINAL INDICATOR
! 0x009c: 0x00e6, # LATIN SMALL LIGATURE AE
! 0x009d: 0x00b8, # CEDILLA
! 0x009e: 0x00c6, # LATIN CAPITAL LIGATURE AE
! 0x009f: 0x00a4, # CURRENCY SIGN
! 0x00a0: 0x00b5, # MICRO SIGN
! 0x00a1: 0x007e, # TILDE
! 0x00a2: 0x0073, # LATIN SMALL LETTER S
! 0x00a3: 0x0074, # LATIN SMALL LETTER T
! 0x00a4: 0x0075, # LATIN SMALL LETTER U
! 0x00a5: 0x0076, # LATIN SMALL LETTER V
! 0x00a6: 0x0077, # LATIN SMALL LETTER W
! 0x00a7: 0x0078, # LATIN SMALL LETTER X
! 0x00a8: 0x0079, # LATIN SMALL LETTER Y
! 0x00a9: 0x007a, # LATIN SMALL LETTER Z
! 0x00aa: 0x00a1, # INVERTED EXCLAMATION MARK
! 0x00ab: 0x00bf, # INVERTED QUESTION MARK
! 0x00ac: 0x00d0, # LATIN CAPITAL LETTER ETH (ICELANDIC)
! 0x00ad: 0x00dd, # LATIN CAPITAL LETTER Y WITH ACUTE
! 0x00ae: 0x00de, # LATIN CAPITAL LETTER THORN (ICELANDIC)
! 0x00af: 0x00ae, # REGISTERED SIGN
! 0x00b0: 0x005e, # CIRCUMFLEX ACCENT
! 0x00b1: 0x00a3, # POUND SIGN
! 0x00b2: 0x00a5, # YEN SIGN
! 0x00b3: 0x00b7, # MIDDLE DOT
! 0x00b4: 0x00a9, # COPYRIGHT SIGN
! 0x00b5: 0x00a7, # SECTION SIGN
! 0x00b7: 0x00bc, # VULGAR FRACTION ONE QUARTER
! 0x00b8: 0x00bd, # VULGAR FRACTION ONE HALF
! 0x00b9: 0x00be, # VULGAR FRACTION THREE QUARTERS
! 0x00ba: 0x005b, # LEFT SQUARE BRACKET
! 0x00bb: 0x005d, # RIGHT SQUARE BRACKET
! 0x00bc: 0x00af, # MACRON
! 0x00bd: 0x00a8, # DIAERESIS
! 0x00be: 0x00b4, # ACUTE ACCENT
! 0x00bf: 0x00d7, # MULTIPLICATION SIGN
! 0x00c0: 0x007b, # LEFT CURLY BRACKET
! 0x00c1: 0x0041, # LATIN CAPITAL LETTER A
! 0x00c2: 0x0042, # LATIN CAPITAL LETTER B
! 0x00c3: 0x0043, # LATIN CAPITAL LETTER C
! 0x00c4: 0x0044, # LATIN CAPITAL LETTER D
! 0x00c5: 0x0045, # LATIN CAPITAL LETTER E
! 0x00c6: 0x0046, # LATIN CAPITAL LETTER F
! 0x00c7: 0x0047, # LATIN CAPITAL LETTER G
! 0x00c8: 0x0048, # LATIN CAPITAL LETTER H
! 0x00c9: 0x0049, # LATIN CAPITAL LETTER I
! 0x00ca: 0x00ad, # SOFT HYPHEN
! 0x00cb: 0x00f4, # LATIN SMALL LETTER O WITH CIRCUMFLEX
! 0x00cc: 0x00f6, # LATIN SMALL LETTER O WITH DIAERESIS
! 0x00cd: 0x00f2, # LATIN SMALL LETTER O WITH GRAVE
! 0x00ce: 0x00f3, # LATIN SMALL LETTER O WITH ACUTE
! 0x00cf: 0x00f5, # LATIN SMALL LETTER O WITH TILDE
! 0x00d0: 0x007d, # RIGHT CURLY BRACKET
! 0x00d1: 0x004a, # LATIN CAPITAL LETTER J
! 0x00d2: 0x004b, # LATIN CAPITAL LETTER K
! 0x00d3: 0x004c, # LATIN CAPITAL LETTER L
! 0x00d4: 0x004d, # LATIN CAPITAL LETTER M
! 0x00d5: 0x004e, # LATIN CAPITAL LETTER N
! 0x00d6: 0x004f, # LATIN CAPITAL LETTER O
! 0x00d7: 0x0050, # LATIN CAPITAL LETTER P
! 0x00d8: 0x0051, # LATIN CAPITAL LETTER Q
! 0x00d9: 0x0052, # LATIN CAPITAL LETTER R
! 0x00da: 0x00b9, # SUPERSCRIPT ONE
! 0x00db: 0x00fb, # LATIN SMALL LETTER U WITH CIRCUMFLEX
! 0x00dc: 0x00fc, # LATIN SMALL LETTER U WITH DIAERESIS
! 0x00dd: 0x00f9, # LATIN SMALL LETTER U WITH GRAVE
! 0x00de: 0x00fa, # LATIN SMALL LETTER U WITH ACUTE
! 0x00df: 0x00ff, # LATIN SMALL LETTER Y WITH DIAERESIS
! 0x00e0: 0x005c, # REVERSE SOLIDUS
! 0x00e1: 0x00f7, # DIVISION SIGN
! 0x00e2: 0x0053, # LATIN CAPITAL LETTER S
! 0x00e3: 0x0054, # LATIN CAPITAL LETTER T
! 0x00e4: 0x0055, # LATIN CAPITAL LETTER U
! 0x00e5: 0x0056, # LATIN CAPITAL LETTER V
! 0x00e6: 0x0057, # LATIN CAPITAL LETTER W
! 0x00e7: 0x0058, # LATIN CAPITAL LETTER X
! 0x00e8: 0x0059, # LATIN CAPITAL LETTER Y
! 0x00e9: 0x005a, # LATIN CAPITAL LETTER Z
! 0x00ea: 0x00b2, # SUPERSCRIPT TWO
! 0x00eb: 0x00d4, # LATIN CAPITAL LETTER O WITH CIRCUMFLEX
! 0x00ec: 0x00d6, # LATIN CAPITAL LETTER O WITH DIAERESIS
! 0x00ed: 0x00d2, # LATIN CAPITAL LETTER O WITH GRAVE
! 0x00ee: 0x00d3, # LATIN CAPITAL LETTER O WITH ACUTE
! 0x00ef: 0x00d5, # LATIN CAPITAL LETTER O WITH TILDE
! 0x00f0: 0x0030, # DIGIT ZERO
! 0x00f1: 0x0031, # DIGIT ONE
! 0x00f2: 0x0032, # DIGIT TWO
! 0x00f3: 0x0033, # DIGIT THREE
! 0x00f4: 0x0034, # DIGIT FOUR
! 0x00f5: 0x0035, # DIGIT FIVE
! 0x00f6: 0x0036, # DIGIT SIX
! 0x00f7: 0x0037, # DIGIT SEVEN
! 0x00f8: 0x0038, # DIGIT EIGHT
! 0x00f9: 0x0039, # DIGIT NINE
! 0x00fa: 0x00b3, # SUPERSCRIPT THREE
! 0x00fb: 0x00db, # LATIN CAPITAL LETTER U WITH CIRCUMFLEX
! 0x00fc: 0x00dc, # LATIN CAPITAL LETTER U WITH DIAERESIS
! 0x00fd: 0x00d9, # LATIN CAPITAL LETTER U WITH GRAVE
! 0x00fe: 0x00da, # LATIN CAPITAL LETTER U WITH ACUTE
! 0x00ff: 0x009f, # CONTROL
})
Index: cp1006.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/python-lib/encodings/cp1006.py,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** cp1006.py 1 Jul 2002 01:57:22 -0000 1.1.1.1
--- cp1006.py 10 Nov 2003 12:44:16 -0000 1.2
***************
*** 17,21 ****
return codecs.charmap_encode(input,errors,encoding_map)
!
def decode(self,input,errors='strict'):
--- 17,21 ----
return codecs.charmap_encode(input,errors,encoding_map)
!
def decode(self,input,errors='strict'):
***************
*** 24,28 ****
class StreamWriter(Codec,codecs.StreamWriter):
pass
!
class StreamReader(Codec,codecs.StreamReader):
pass
--- 24,28 ----
class StreamWriter(Codec,codecs.StreamWriter):
pass
!
class StreamReader(Codec,codecs.StreamReader):
pass
***************
*** 38,135 ****
decoding_map = codecs.make_identity_dict(range(256))
decoding_map.update({
! 0x00a1: 0x06f0, # EXTENDED ARABIC-INDIC DIGIT ZERO
! 0x00a2: 0x06f1, # EXTENDED ARABIC-INDIC DIGIT ONE
! 0x00a3: 0x06f2, # EXTENDED ARABIC-INDIC DIGIT TWO
! 0x00a4: 0x06f3, # EXTENDED ARABIC-INDIC DIGIT THREE
! 0x00a5: 0x06f4, # EXTENDED ARABIC-INDIC DIGIT FOUR
! 0x00a6: 0x06f5, # EXTENDED ARABIC-INDIC DIGIT FIVE
! 0x00a7: 0x06f6, # EXTENDED ARABIC-INDIC DIGIT SIX
! 0x00a8: 0x06f7, # EXTENDED ARABIC-INDIC DIGIT SEVEN
! 0x00a9: 0x06f8, # EXTENDED ARABIC-INDIC DIGIT EIGHT
! 0x00aa: 0x06f9, # EXTENDED ARABIC-INDIC DIGIT NINE
! 0x00ab: 0x060c, # ARABIC COMMA
! 0x00ac: 0x061b, # ARABIC SEMICOLON
! 0x00ae: 0x061f, # ARABIC QUESTION MARK
! 0x00af: 0xfe81, # ARABIC LETTER ALEF WITH MADDA ABOVE ISOLATED FORM
! 0x00b0: 0xfe8d, # ARABIC LETTER ALEF ISOLATED FORM
! 0x00b1: 0xfe8e, # ARABIC LETTER ALEF FINAL FORM
! 0x00b2: 0xfe8e, # ARABIC LETTER ALEF FINAL FORM
! 0x00b3: 0xfe8f, # ARABIC LETTER BEH ISOLATED FORM
! 0x00b4: 0xfe91, # ARABIC LETTER BEH INITIAL FORM
! 0x00b5: 0xfb56, # ARABIC LETTER PEH ISOLATED FORM
! 0x00b6: 0xfb58, # ARABIC LETTER PEH INITIAL FORM
! 0x00b7: 0xfe93, # ARABIC LETTER TEH MARBUTA ISOLATED FORM
! 0x00b8: 0xfe95, # ARABIC LETTER TEH ISOLATED FORM
! 0x00b9: 0xfe97, # ARABIC LETTER TEH INITIAL FORM
! 0x00ba: 0xfb66, # ARABIC LETTER TTEH ISOLATED FORM
! 0x00bb: 0xfb68, # ARABIC LETTER TTEH INITIAL FORM
! 0x00bc: 0xfe99, # ARABIC LETTER THEH ISOLATED FORM
! 0x00bd: 0xfe9b, # ARABIC LETTER THEH INITIAL FORM
! 0x00be: 0xfe9d, # ARABIC LETTER JEEM ISOLATED FORM
! 0x00bf: 0xfe9f, # ARABIC LETTER JEEM INITIAL FORM
! 0x00c0: 0xfb7a, # ARABIC LETTER TCHEH ISOLATED FORM
! 0x00c1: 0xfb7c, # ARABIC LETTER TCHEH INITIAL FORM
! 0x00c2: 0xfea1, # ARABIC LETTER HAH ISOLATED FORM
! 0x00c3: 0xfea3, # ARABIC LETTER HAH INITIAL FORM
! 0x00c4: 0xfea5, # ARABIC LETTER KHAH ISOLATED FORM
! 0x00c5: 0xfea7, # ARABIC LETTER KHAH INITIAL FORM
! 0x00c6: 0xfea9, # ARABIC LETTER DAL ISOLATED FORM
! 0x00c7: 0xfb84, # ARABIC LETTER DAHAL ISOLATED FORMN
! 0x00c8: 0xfeab, # ARABIC LETTER THAL ISOLATED FORM
! 0x00c9: 0xfead, # ARABIC LETTER REH ISOLATED FORM
! 0x00ca: 0xfb8c, # ARABIC LETTER RREH ISOLATED FORM
! 0x00cb: 0xfeaf, # ARABIC LETTER ZAIN ISOLATED FORM
! 0x00cc: 0xfb8a, # ARABIC LETTER JEH ISOLATED FORM
! 0x00cd: 0xfeb1, # ARABIC LETTER SEEN ISOLATED FORM
! 0x00ce: 0xfeb3, # ARABIC LETTER SEEN INITIAL FORM
! 0x00cf: 0xfeb5, # ARABIC LETTER SHEEN ISOLATED FORM
! 0x00d0: 0xfeb7, # ARABIC LETTER SHEEN INITIAL FORM
! 0x00d1: 0xfeb9, # ARABIC LETTER SAD ISOLATED FORM
! 0x00d2: 0xfebb, # ARABIC LETTER SAD INITIAL FORM
! 0x00d3: 0xfebd, # ARABIC LETTER DAD ISOLATED FORM
! 0x00d4: 0xfebf, # ARABIC LETTER DAD INITIAL FORM
! 0x00d5: 0xfec1, # ARABIC LETTER TAH ISOLATED FORM
! 0x00d6: 0xfec5, # ARABIC LETTER ZAH ISOLATED FORM
! 0x00d7: 0xfec9, # ARABIC LETTER AIN ISOLATED FORM
! 0x00d8: 0xfeca, # ARABIC LETTER AIN FINAL FORM
! 0x00d9: 0xfecb, # ARABIC LETTER AIN INITIAL FORM
! 0x00da: 0xfecc, # ARABIC LETTER AIN MEDIAL FORM
! 0x00db: 0xfecd, # ARABIC LETTER GHAIN ISOLATED FORM
! 0x00dc: 0xfece, # ARABIC LETTER GHAIN FINAL FORM
! 0x00dd: 0xfecf, # ARABIC LETTER GHAIN INITIAL FORM
! 0x00de: 0xfed0, # ARABIC LETTER GHAIN MEDIAL FORM
! 0x00df: 0xfed1, # ARABIC LETTER FEH ISOLATED FORM
! 0x00e0: 0xfed3, # ARABIC LETTER FEH INITIAL FORM
! 0x00e1: 0xfed5, # ARABIC LETTER QAF ISOLATED FORM
! 0x00e2: 0xfed7, # ARABIC LETTER QAF INITIAL FORM
! 0x00e3: 0xfed9, # ARABIC LETTER KAF ISOLATED FORM
! 0x00e4: 0xfedb, # ARABIC LETTER KAF INITIAL FORM
! 0x00e5: 0xfb92, # ARABIC LETTER GAF ISOLATED FORM
! 0x00e6: 0xfb94, # ARABIC LETTER GAF INITIAL FORM
! 0x00e7: 0xfedd, # ARABIC LETTER LAM ISOLATED FORM
! 0x00e8: 0xfedf, # ARABIC LETTER LAM INITIAL FORM
! 0x00e9: 0xfee0, # ARABIC LETTER LAM MEDIAL FORM
! 0x00ea: 0xfee1, # ARABIC LETTER MEEM ISOLATED FORM
! 0x00eb: 0xfee3, # ARABIC LETTER MEEM INITIAL FORM
! 0x00ec: 0xfb9e, # ARABIC LETTER NOON GHUNNA ISOLATED FORM
! 0x00ed: 0xfee5, # ARABIC LETTER NOON ISOLATED FORM
! 0x00ee: 0xfee7, # ARABIC LETTER NOON INITIAL FORM
! 0x00ef: 0xfe85, # ARABIC LETTER WAW WITH HAMZA ABOVE ISOLATED FORM
! 0x00f0: 0xfeed, # ARABIC LETTER WAW ISOLATED FORM
! 0x00f1: 0xfba6, # ARABIC LETTER HEH GOAL ISOLATED FORM
! 0x00f2: 0xfba8, # ARABIC LETTER HEH GOAL INITIAL FORM
! 0x00f3: 0xfba9, # ARABIC LETTER HEH GOAL MEDIAL FORM
! 0x00f4: 0xfbaa, # ARABIC LETTER HEH DOACHASHMEE ISOLATED FORM
! 0x00f5: 0xfe80, # ARABIC LETTER HAMZA ISOLATED FORM
! 0x00f6: 0xfe89, # ARABIC LETTER YEH WITH HAMZA ABOVE ISOLATED FORM
! 0x00f7: 0xfe8a, # ARABIC LETTER YEH WITH HAMZA ABOVE FINAL FORM
! 0x00f8: 0xfe8b, # ARABIC LETTER YEH WITH HAMZA ABOVE INITIAL FORM
! 0x00f9: 0xfef1, # ARABIC LETTER YEH ISOLATED FORM
! 0x00fa: 0xfef2, # ARABIC LETTER YEH FINAL FORM
! 0x00fb: 0xfef3, # ARABIC LETTER YEH INITIAL FORM
! 0x00fc: 0xfbb0, # ARABIC LETTER YEH BARREE WITH HAMZA ABOVE ISOLATED FORM
! 0x00fd: 0xfbae, # ARABIC LETTER YEH BARREE ISOLATED FORM
! 0x00fe: 0xfe7c, # ARABIC SHADDA ISOLATED FORM
! 0x00ff: 0xfe7d, # ARABIC SHADDA MEDIAL FORM
})
--- 38,135 ----
decoding_map = codecs.make_identity_dict(range(256))
decoding_map.update({
! 0x00a1: 0x06f0, # EXTENDED ARABIC-INDIC DIGIT ZERO
! 0x00a2: 0x06f1, # EXTENDED ARABIC-INDIC DIGIT ONE
! 0x00a3: 0x06f2, # EXTENDED ARABIC-INDIC DIGIT TWO
! 0x00a4: 0x06f3, # EXTENDED ARABIC-INDIC DIGIT THREE
! 0x00a5: 0x06f4, # EXTENDED ARABIC-INDIC DIGIT FOUR
! 0x00a6: 0x06f5, # EXTENDED ARABIC-INDIC DIGIT FIVE
! 0x00a7: 0x06f6, # EXTENDED ARABIC-INDIC DIGIT SIX
! 0x00a8: 0x06f7, # EXTENDED ARABIC-INDIC DIGIT SEVEN
! 0x00a9: 0x06f8, # EXTENDED ARABIC-INDIC DIGIT EIGHT
! 0x00aa: 0x06f9, # EXTENDED ARABIC-INDIC DIGIT NINE
! 0x00ab: 0x060c, # ARABIC COMMA
! 0x00ac: 0x061b, # ARABIC SEMICOLON
! 0x00ae: 0x061f, # ARABIC QUESTION MARK
! 0x00af: 0xfe81, # ARABIC LETTER ALEF WITH MADDA ABOVE ISOLATED FORM
! 0x00b0: 0xfe8d, # ARABIC LETTER ALEF ISOLATED FORM
! 0x00b1: 0xfe8e, # ARABIC LETTER ALEF FINAL FORM
! 0x00b2: 0xfe8e, # ARABIC LETTER ALEF FINAL FORM
! 0x00b3: 0xfe8f, # ARABIC LETTER BEH ISOLATED FORM
! 0x00b4: 0xfe91, # ARABIC LETTER BEH INITIAL FORM
! 0x00b5: 0xfb56, # ARABIC LETTER PEH ISOLATED FORM
! 0x00b6: 0xfb58, # ARABIC LETTER PEH INITIAL FORM
! 0x00b7: 0xfe93, # ARABIC LETTER TEH MARBUTA ISOLATED FORM
! 0x00b8: 0xfe95, # ARABIC LETTER TEH ISOLATED FORM
! 0x00b9: 0xfe97, # ARABIC LETTER TEH INITIAL FORM
! 0x00ba: 0xfb66, # ARABIC LETTER TTEH ISOLATED FORM
! 0x00bb: 0xfb68, # ARABIC LETTER TTEH INITIAL FORM
! 0x00bc: 0xfe99, # ARABIC LETTER THEH ISOLATED FORM
! 0x00bd: 0xfe9b, # ARABIC LETTER THEH INITIAL FORM
! 0x00be: 0xfe9d, # ARABIC LETTER JEEM ISOLATED FORM
! 0x00bf: 0xfe9f, # ARABIC LETTER JEEM INITIAL FORM
! 0x00c0: 0xfb7a, # ARABIC LETTER TCHEH ISOLATED FORM
! 0x00c1: 0xfb7c, # ARABIC LETTER TCHEH INITIAL FORM
! 0x00c2: 0xfea1, # ARABIC LETTER HAH ISOLATED FORM
! 0x00c3: 0xfea3, # ARABIC LETTER HAH INITIAL FORM
! 0x00c4: 0xfea5, # ARABIC LETTER KHAH ISOLATED FORM
! 0x00c5: 0xfea7, # ARABIC LETTER KHAH INITIAL FORM
! 0x00c6: 0xfea9, # ARABIC LETTER DAL ISOLATED FORM
! 0x00c7: 0xfb84, # ARABIC LETTER DAHAL ISOLATED FORMN
! 0x00c8: 0xfeab, # ARABIC LETTER THAL ISOLATED FORM
! 0x00c9: 0xfead, # ARABIC LETTER REH ISOLATED FORM
! 0x00ca: 0xfb8c, # ARABIC LETTER RREH ISOLATED FORM
! 0x00cb: 0xfeaf, # ARABIC LETTER ZAIN ISOLATED FORM
! 0x00cc: 0xfb8a, # ARABIC LETTER JEH ISOLATED FORM
! 0x00cd: 0xfeb1, # ARABIC LETTER SEEN ISOLATED FORM
! 0x00ce: 0xfeb3, # ARABIC LETTER SEEN INITIAL FORM
! 0x00cf: 0xfeb5, # ARABIC LETTER SHEEN ISOLATED FORM
! 0x00d0: 0xfeb7, # ARABIC LETTER SHEEN INITIAL FORM
! 0x00d1: 0xfeb9, # ARABIC LETTER SAD ISOLATED FORM
! 0x00d2: 0xfebb, # ARABIC LETTER SAD INITIAL FORM
! 0x00d3: 0xfebd, # ARABIC LETTER DAD ISOLATED FORM
! 0x00d4: 0xfebf, # ARABIC LETTER DAD INITIAL FORM
! 0x00d5: 0xfec1, # ARABIC LETTER TAH ISOLATED FORM
! 0x00d6: 0xfec5, # ARABIC LETTER ZAH ISOLATED FORM
! 0x00d7: 0xfec9, # ARABIC LETTER AIN ISOLATED FORM
! 0x00d8: 0xfeca, # ARABIC LETTER AIN FINAL FORM
! 0x00d9: 0xfecb, # ARABIC LETTER AIN INITIAL FORM
! 0x00da: 0xfecc, # ARABIC LETTER AIN MEDIAL FORM
! 0x00db: 0xfecd, # ARABIC LETTER GHAIN ISOLATED FORM
! 0x00dc: 0xfece, # ARABIC LETTER GHAIN FINAL FORM
! 0x00dd: 0xfecf, # ARABIC LETTER GHAIN INITIAL FORM
! 0x00de: 0xfed0, # ARABIC LETTER GHAIN MEDIAL FORM
! 0x00df: 0xfed1, # ARABIC LETTER FEH ISOLATED FORM
! 0x00e0: 0xfed3, # ARABIC LETTER FEH INITIAL FORM
! 0x00e1: 0xfed5, # ARABIC LETTER QAF ISOLATED FORM
! 0x00e2: 0xfed7, # ARABIC LETTER QAF INITIAL FORM
! 0x00e3: 0xfed9, # ARABIC LETTER KAF ISOLATED FORM
! 0x00e4: 0xfedb, # ARABIC LETTER KAF INITIAL FORM
! 0x00e5: 0xfb92, # ARABIC LETTER GAF ISOLATED FORM
! 0x00e6: 0xfb94, # ARABIC LETTER GAF INITIAL FORM
! 0x00e7: 0xfedd, # ARABIC LETTER LAM ISOLATED FORM
! 0x00e8: 0xfedf, # ARABIC LETTER LAM INITIAL FORM
! 0x00e9: 0xfee0, # ARABIC LETTER LAM MEDIAL FORM
! 0x00ea: 0xfee1, # ARABIC LETTER MEEM ISOLATED FORM
! 0x00eb: 0xfee3, # ARABIC LETTER MEEM INITIAL FORM
! 0x00ec: 0xfb9e, # ARABIC LETTER NOON GHUNNA ISOLATED FORM
! 0x00ed: 0xfee5, # ARABIC LETTER NOON ISOLATED FORM
! 0x00ee: 0xfee7, # ARABIC LETTER NOON INITIAL FORM
! 0x00ef: 0xfe85, # ARABIC LETTER WAW WITH HAMZA ABOVE ISOLATED FORM
! 0x00f0: 0xfeed, # ARABIC LETTER WAW ISOLATED FORM
! 0x00f1: 0xfba6, # ARABIC LETTER HEH GOAL ISOLATED FORM
! 0x00f2: 0xfba8, # ARABIC LETTER HEH GOAL INITIAL FORM
! 0x00f3: 0xfba9, # ARABIC LETTER HEH GOAL MEDIAL FORM
! 0x00f4: 0xfbaa, # ARABIC LETTER HEH DOACHASHMEE ISOLATED FORM
! 0x00f5: 0xfe80, # ARABIC LETTER HAMZA ISOLATED FORM
! 0x00f6: 0xfe89, # ARABIC LETTER YEH WITH HAMZA ABOVE ISOLATED FORM
! 0x00f7: 0xfe8a, # ARABIC LETTER YEH WITH HAMZA ABOVE FINAL FORM
! 0x00f8: 0xfe8b, # ARABIC LETTER YEH WITH HAMZA ABOVE INITIAL FORM
! 0x00f9: 0xfef1, # ARABIC LETTER YEH ISOLATED FORM
! 0x00fa: 0xfef2, # ARABIC LETTER YEH FINAL FORM
! 0x00fb: 0xfef3, # ARABIC LETTER YEH INITIAL FORM
! 0x00fc: 0xfbb0, # ARABIC LETTER YEH BARREE WITH HAMZA ABOVE ISOLATED FORM
! 0x00fd: 0xfbae, # ARABIC LETTER YEH BARREE ISOLATED FORM
! 0x00fe: 0xfe7c, # ARABIC SHADDA ISOLATED FORM
! 0x00ff: 0xfe7d, # ARABIC SHADDA MEDIAL FORM
})
Index: cp1026.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/python-lib/encodings/cp1026.py,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** cp1026.py 1 Jul 2002 01:57:22 -0000 1.1.1.1
--- cp1026.py 10 Nov 2003 12:44:16 -0000 1.2
***************
*** 17,21 ****
return codecs.charmap_encode(input,errors,encoding_map)
!
def decode(self,input,errors='strict'):
--- 17,21 ----
return codecs.charmap_encode(input,errors,encoding_map)
!
def decode(self,input,errors='strict'):
***************
*** 24,28 ****
class StreamWriter(Codec,codecs.StreamWriter):
pass
!
class StreamReader(Codec,codecs.StreamReader):
pass
--- 24,28 ----
class StreamWriter(Codec,codecs.StreamWriter):
pass
!
class StreamReader(Codec,codecs.StreamReader):
pass
***************
*** 38,277 ****
decoding_map = codecs.make_identity_dict(range(256))
decoding_map.update({
! 0x0004: 0x009c, # CONTROL
! 0x0005: 0x0009, # HORIZONTAL TABULATION
! 0x0006: 0x0086, # CONTROL
! 0x0007: 0x007f, # DELETE
! 0x0008: 0x0097, # CONTROL
! 0x0009: 0x008d, # CONTROL
! 0x000a: 0x008e, # CONTROL
! 0x0014: 0x009d, # CONTROL
! 0x0015: 0x0085, # CONTROL
! 0x0016: 0x0008, # BACKSPACE
! 0x0017: 0x0087, # CONTROL
! 0x001a: 0x0092, # CONTROL
! 0x001b: 0x008f, # CONTROL
! 0x0020: 0x0080, # CONTROL
! 0x0021: 0x0081, # CONTROL
! 0x0022: 0x0082, # CONTROL
! 0x0023: 0x0083, # CONTROL
! 0x0024: 0x0084, # CONTROL
! 0x0025: 0x000a, # LINE FEED
! 0x0026: 0x0017, # END OF TRANSMISSION BLOCK
! 0x0027: 0x001b, # ESCAPE
! 0x0028: 0x0088, # CONTROL
! 0x0029: 0x0089, # CONTROL
! 0x002a: 0x008a, # CONTROL
! 0x002b: 0x008b, # CONTROL
! 0x002c: 0x008c, # CONTROL
! 0x002d: 0x0005, # ENQUIRY
! 0x002e: 0x0006, # ACKNOWLEDGE
! 0x002f: 0x0007, # BELL
! 0x0030: 0x0090, # CONTROL
! 0x0031: 0x0091, # CONTROL
! 0x0032: 0x0016, # SYNCHRONOUS IDLE
! 0x0033: 0x0093, # CONTROL
! 0x0034: 0x0094, # CONTROL
! 0x0035: 0x0095, # CONTROL
! 0x0036: 0x0096, # CONTROL
! 0x0037: 0x0004, # END OF TRANSMISSION
! 0x0038: 0x0098, # CONTROL
! 0x0039: 0x0099, # CONTROL
! 0x003a: 0x009a, # CONTROL
! 0x003b: 0x009b, # CONTROL
! 0x003c: 0x0014, # DEVICE CONTROL FOUR
! 0x003d: 0x0015, # NEGATIVE ACKNOWLEDGE
! 0x003e: 0x009e, # CONTROL
! 0x003f: 0x001a, # SUBSTITUTE
! 0x0040: 0x0020, # SPACE
! 0x0041: 0x00a0, # NO-BREAK SPACE
! 0x0042: 0x00e2, # LATIN SMALL LETTER A WITH CIRCUMFLEX
! 0x0043: 0x00e4, # LATIN SMALL LETTER A WITH DIAERESIS
! 0x0044: 0x00e0, # LATIN SMALL LETTER A WITH GRAVE
! 0x0045: 0x00e1, # LATIN SMALL LETTER A WITH ACUTE
! 0x0046: 0x00e3, # LATIN SMALL LETTER A WITH TILDE
! 0x0047: 0x00e5, # LATIN SMALL LETTER A WITH RING ABOVE
! 0x0048: 0x007b, # LEFT CURLY BRACKET
! 0x0049: 0x00f1, # LATIN SMALL LETTER N WITH TILDE
! 0x004a: 0x00c7, # LATIN CAPITAL LETTER C WITH CEDILLA
! 0x004b: 0x002e, # FULL STOP
! 0x004c: 0x003c, # LESS-THAN SIGN
! 0x004d: 0x0028, # LEFT PARENTHESIS
! 0x004e: 0x002b, # PLUS SIGN
! 0x004f: 0x0021, # EXCLAMATION MARK
! 0x0050: 0x0026, # AMPERSAND
! 0x0051: 0x00e9, # LATIN SMALL LETT...
[truncated message content] |
Update of /cvsroot/wpdev/xmlscripts/python-lib/distutils
In directory sc8-pr-cvs1:/tmp/cvs-serv5168/distutils
Modified Files:
__init__.py archive_util.py bcppcompiler.py ccompiler.py
cmd.py core.py cygwinccompiler.py dep_util.py dir_util.py
dist.py errors.py extension.py fancy_getopt.py file_util.py
filelist.py msvccompiler.py mwerkscompiler.py spawn.py
sysconfig.py text_file.py unixccompiler.py util.py version.py
Log Message:
Updated to Python 2.3.2
Index: __init__.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/python-lib/distutils/__init__.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** __init__.py 21 Dec 2002 14:52:54 -0000 1.2
--- __init__.py 10 Nov 2003 12:44:16 -0000 1.3
***************
*** 9,12 ****
--- 9,14 ----
"""
+ # This module should be kept compatible with Python 1.5.2.
+
__revision__ = "$Id$"
Index: archive_util.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/python-lib/distutils/archive_util.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** archive_util.py 21 Dec 2002 14:52:54 -0000 1.2
--- archive_util.py 10 Nov 2003 12:44:16 -0000 1.3
***************
*** 4,8 ****
that sort of thing)."""
! # created 2000/04/03, Greg Ward (extracted from util.py)
__revision__ = "$Id$"
--- 4,8 ----
that sort of thing)."""
! # This module should be kept compatible with Python 1.5.2.
__revision__ = "$Id$"
***************
*** 12,15 ****
--- 12,16 ----
from distutils.spawn import spawn
from distutils.dir_util import mkpath
+ from distutils import log
def make_tarball (base_name, base_dir, compress="gzip",
***************
*** 43,53 ****
archive_name = base_name + ".tar"
! mkpath(os.path.dirname(archive_name), verbose=verbose, dry_run=dry_run)
cmd = ["tar", "-cf", archive_name, base_dir]
! spawn(cmd, verbose=verbose, dry_run=dry_run)
if compress:
spawn([compress] + compress_flags[compress] + [archive_name],
! verbose=verbose, dry_run=dry_run)
return archive_name + compress_ext[compress]
else:
--- 44,54 ----
archive_name = base_name + ".tar"
! mkpath(os.path.dirname(archive_name), dry_run=dry_run)
cmd = ["tar", "-cf", archive_name, base_dir]
! spawn(cmd, dry_run=dry_run)
if compress:
spawn([compress] + compress_flags[compress] + [archive_name],
! dry_run=dry_run)
return archive_name + compress_ext[compress]
else:
***************
*** 59,96 ****
def make_zipfile (base_name, base_dir, verbose=0, dry_run=0):
"""Create a zip file from all the files under 'base_dir'. The output
! zip file will be named 'base_dir' + ".zip". Uses either the InfoZIP
! "zip" utility (if installed and found on the default search path) or
! the "zipfile" Python module (if available). If neither tool is
! available, raises DistutilsExecError. Returns the name of the output
! zip file.
"""
- # This initially assumed the Unix 'zip' utility -- but
- # apparently InfoZIP's zip.exe works the same under Windows, so
- # no changes needed!
-
- zip_filename = base_name + ".zip"
- mkpath(os.path.dirname(zip_filename), verbose=verbose, dry_run=dry_run)
try:
! spawn(["zip", "-rq", zip_filename, base_dir],
! verbose=verbose, dry_run=dry_run)
! except DistutilsExecError:
! # XXX really should distinguish between "couldn't find
! # external 'zip' command" and "zip failed" -- shouldn't try
! # again in the latter case. (I think fixing this will
! # require some cooperation from the spawn module -- perhaps
! # a utility function to search the path, so we can fallback
! # on zipfile.py without the failed spawn.)
try:
! import zipfile
! except ImportError:
raise DistutilsExecError, \
! ("unable to create zip file '%s': " +
! "could neither find a standalone zip utility nor " +
! "import the 'zipfile' module") % zip_filename
! if verbose:
! print "creating '%s' and adding '%s' to it" % \
! (zip_filename, base_dir)
def visit (z, dirname, names):
--- 60,98 ----
def make_zipfile (base_name, base_dir, verbose=0, dry_run=0):
"""Create a zip file from all the files under 'base_dir'. The output
! zip file will be named 'base_dir' + ".zip". Uses either the "zipfile"
! Python module (if available) or the InfoZIP "zip" utility (if installed
! and found on the default search path). If neither tool is available,
! raises DistutilsExecError. Returns the name of the output zip file.
"""
try:
! import zipfile
! except ImportError:
! zipfile = None
!
! zip_filename = base_name + ".zip"
! mkpath(os.path.dirname(zip_filename), dry_run=dry_run)
! # If zipfile module is not available, try spawning an external
! # 'zip' command.
! if zipfile is None:
! if verbose:
! zipoptions = "-r"
! else:
! zipoptions = "-rq"
!
try:
! spawn(["zip", zipoptions, zip_filename, base_dir],
! dry_run=dry_run)
! except DistutilsExecError:
! # XXX really should distinguish between "couldn't find
! # external 'zip' command" and "zip failed".
raise DistutilsExecError, \
! ("unable to create zip file '%s': "
! "could neither import the 'zipfile' module nor "
! "find a standalone zip utility") % zip_filename
! else:
! log.info("creating '%s' and adding '%s' to it",
! zip_filename, base_dir)
def visit (z, dirname, names):
***************
*** 99,102 ****
--- 101,105 ----
if os.path.isfile(path):
z.write(path, path)
+ log.info("adding '%s'" % path)
if not dry_run:
***************
*** 142,147 ****
save_cwd = os.getcwd()
if root_dir is not None:
! if verbose:
! print "changing into '%s'" % root_dir
base_name = os.path.abspath(base_name)
if not dry_run:
--- 145,149 ----
save_cwd = os.getcwd()
if root_dir is not None:
! log.debug("changing into '%s'", root_dir)
base_name = os.path.abspath(base_name)
if not dry_run:
***************
*** 151,156 ****
base_dir = os.curdir
! kwargs = { 'verbose': verbose,
! 'dry_run': dry_run }
try:
--- 153,157 ----
base_dir = os.curdir
! kwargs = { 'dry_run': dry_run }
try:
***************
*** 165,170 ****
if root_dir is not None:
! if verbose:
! print "changing back to '%s'" % save_cwd
os.chdir(save_cwd)
--- 166,170 ----
if root_dir is not None:
! log.debug("changing back to '%s'", save_cwd)
os.chdir(save_cwd)
Index: bcppcompiler.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/python-lib/distutils/bcppcompiler.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** bcppcompiler.py 21 Dec 2002 14:52:54 -0000 1.2
--- bcppcompiler.py 10 Nov 2003 12:44:16 -0000 1.3
***************
*** 12,15 ****
--- 12,17 ----
# WindowsCCompiler! --GPW
+ # This module should be kept compatible with Python 1.5.2.
+
__revision__ = "$Id$"
***************
*** 23,26 ****
--- 25,29 ----
from distutils.file_util import write_file
from distutils.dep_util import newer
+ from distutils import log
class BCPPCompiler(CCompiler) :
***************
*** 80,100 ****
# -- Worker methods ------------------------------------------------
! def compile (self,
! sources,
! output_dir=None,
! macros=None,
! include_dirs=None,
! debug=0,
! extra_preargs=None,
! extra_postargs=None):
!
! (output_dir, macros, include_dirs) = \
! self._fix_compile_args (output_dir, macros, include_dirs)
! (objects, skip_sources) = self._prep_compile (sources, output_dir)
!
! if extra_postargs is None:
! extra_postargs = []
!
! pp_opts = gen_preprocess_options (macros, include_dirs)
compile_opts = extra_preargs or []
compile_opts.append ('-c')
--- 83,93 ----
# -- Worker methods ------------------------------------------------
! def compile(self, sources,
! output_dir=None, macros=None, include_dirs=None, debug=0,
! extra_preargs=None, extra_postargs=None, depends=None):
!
! macros, objects, extra_postargs, pp_opts, build = \
! self._setup_compile(output_dir, macros, include_dirs, sources,
! depends, extra_postargs)
compile_opts = extra_preargs or []
compile_opts.append ('-c')
***************
*** 104,151 ****
compile_opts.extend (self.compile_options)
! for i in range (len (sources)):
! src = sources[i] ; obj = objects[i]
! ext = (os.path.splitext (src))[1]
!
! if skip_sources[src]:
! self.announce ("skipping %s (%s up-to-date)" % (src, obj))
! else:
! src = os.path.normpath(src)
! obj = os.path.normpath(obj)
! self.mkpath(os.path.dirname(obj))
!
! if ext == '.res':
! # This is already a binary file -- skip it.
! continue # the 'for' loop
! if ext == '.rc':
! # This needs to be compiled to a .res file -- do it now.
! try:
! self.spawn (["brcc32", "-fo", obj, src])
! except DistutilsExecError, msg:
! raise CompileError, msg
! continue # the 'for' loop
!
! # The next two are both for the real compiler.
! if ext in self._c_extensions:
! input_opt = ""
! elif ext in self._cpp_extensions:
! input_opt = "-P"
! else:
! # Unknown file type -- no extra options. The compiler
! # will probably fail, but let it just in case this is a
! # file the compiler recognizes even if we don't.
! input_opt = ""
!
! output_opt = "-o" + obj
! # Compiler command line syntax is: "bcc32 [options] file(s)".
! # Note that the source file names must appear at the end of
! # the command line.
try:
! self.spawn ([self.cc] + compile_opts + pp_opts +
! [input_opt, output_opt] +
! extra_postargs + [src])
except DistutilsExecError, msg:
raise CompileError, msg
return objects
--- 97,141 ----
compile_opts.extend (self.compile_options)
! for obj, (src, ext) in build.items():
! # XXX why do the normpath here?
! src = os.path.normpath(src)
! obj = os.path.normpath(obj)
! # XXX _setup_compile() did a mkpath() too but before the normpath.
! # Is it possible to skip the normpath?
! self.mkpath(os.path.dirname(obj))
! if ext == '.res':
! # This is already a binary file -- skip it.
! continue # the 'for' loop
! if ext == '.rc':
! # This needs to be compiled to a .res file -- do it now.
try:
! self.spawn (["brcc32", "-fo", obj, src])
except DistutilsExecError, msg:
raise CompileError, msg
+ continue # the 'for' loop
+
+ # The next two are both for the real compiler.
+ if ext in self._c_extensions:
+ input_opt = ""
+ elif ext in self._cpp_extensions:
+ input_opt = "-P"
+ else:
+ # Unknown file type -- no extra options. The compiler
+ # will probably fail, but let it just in case this is a
+ # file the compiler recognizes even if we don't.
+ input_opt = ""
+
+ output_opt = "-o" + obj
+
+ # Compiler command line syntax is: "bcc32 [options] file(s)".
+ # Note that the source file names must appear at the end of
+ # the command line.
+ try:
+ self.spawn ([self.cc] + compile_opts + pp_opts +
+ [input_opt, output_opt] +
+ extra_postargs + [src])
+ except DistutilsExecError, msg:
+ raise CompileError, msg
return objects
***************
*** 159,164 ****
output_dir=None,
debug=0,
! extra_preargs=None,
! extra_postargs=None):
(objects, output_dir) = self._fix_object_args (objects, output_dir)
--- 149,153 ----
output_dir=None,
debug=0,
! target_lang=None):
(objects, output_dir) = self._fix_object_args (objects, output_dir)
***************
*** 170,177 ****
if debug:
pass # XXX what goes here?
- if extra_preargs:
- lib_args[:0] = extra_preargs
- if extra_postargs:
- lib_args.extend (extra_postargs)
try:
self.spawn ([self.lib] + lib_args)
--- 159,162 ----
***************
*** 179,183 ****
raise LibError, msg
else:
! self.announce ("skipping %s (up-to-date)" % output_filename)
# create_static_lib ()
--- 164,168 ----
raise LibError, msg
else:
! log.debug("skipping %s (up-to-date)", output_filename)
# create_static_lib ()
***************
*** 196,200 ****
extra_preargs=None,
extra_postargs=None,
! build_temp=None):
# XXX this ignores 'build_temp'! should follow the lead of
--- 181,186 ----
extra_preargs=None,
extra_postargs=None,
! build_temp=None,
! target_lang=None):
# XXX this ignores 'build_temp'! should follow the lead of
***************
*** 206,211 ****
if runtime_library_dirs:
! self.warn ("I don't know what to do with 'runtime_library_dirs': "
! + str (runtime_library_dirs))
if output_dir is not None:
--- 192,197 ----
if runtime_library_dirs:
! log.warn("I don't know what to do with 'runtime_library_dirs': %s",
! str(runtime_library_dirs))
if output_dir is not None:
***************
*** 286,290 ****
ld_args.append(lib)
# probably a BCPP internal library -- don't warn
- # self.warn('library %s not found.' % lib)
else:
# full name which prefers bcpp_xxx.lib over xxx.lib
--- 272,275 ----
***************
*** 314,318 ****
else:
! self.announce ("skipping %s (up-to-date)" % output_filename)
# link ()
--- 299,303 ----
else:
! log.debug("skipping %s (up-to-date)", output_filename)
# link ()
Index: ccompiler.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/python-lib/distutils/ccompiler.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** ccompiler.py 21 Dec 2002 14:52:54 -0000 1.2
--- ccompiler.py 10 Nov 2003 12:44:16 -0000 1.3
***************
*** 4,8 ****
for the Distutils compiler abstraction model."""
! # created 1999/07/05, Greg Ward
__revision__ = "$Id$"
--- 4,8 ----
for the Distutils compiler abstraction model."""
! # This module should be kept compatible with Python 1.5.2.
__revision__ = "$Id$"
***************
*** 16,21 ****
from distutils.dir_util import mkpath
from distutils.dep_util import newer_pairwise, newer_group
from distutils.util import split_quoted, execute
!
class CCompiler:
--- 16,22 ----
from distutils.dir_util import mkpath
from distutils.dep_util import newer_pairwise, newer_group
+ from distutils.sysconfig import python_build
from distutils.util import split_quoted, execute
! from distutils import log
class CCompiler:
***************
*** 75,78 ****
--- 76,92 ----
exe_extension = None # string
+ # Default language settings. language_map is used to detect a source
+ # file or Extension target language, checking source filenames.
+ # language_order is used to detect the language precedence, when deciding
+ # what language to use when mixing source types. For example, if some
+ # extension has two files with ".c" extension, and one with ".cpp", it
+ # is still linked as c++.
+ language_map = {".c" : "c",
+ ".cc" : "c++",
+ ".cpp" : "c++",
+ ".cxx" : "c++",
+ ".m" : "objc",
+ }
+ language_order = ["c++", "objc", "c"]
def __init__ (self,
***************
*** 81,87 ****
force=0):
- self.verbose = verbose
self.dry_run = dry_run
self.force = force
# 'output_dir': a common output directory for object, library,
--- 95,101 ----
force=0):
self.dry_run = dry_run
self.force = force
+ self.verbose = verbose
# 'output_dir': a common output directory for object, library,
***************
*** 162,166 ****
-
def _find_macro (self, name):
i = 0
--- 176,179 ----
***************
*** 320,326 ****
! # -- Priviate utility methods --------------------------------------
# (here for the convenience of subclasses)
def _fix_compile_args (self, output_dir, macros, include_dirs):
"""Typecheck and fix-up some of the arguments to the 'compile()'
--- 333,435 ----
! # -- Private utility methods --------------------------------------
# (here for the convenience of subclasses)
+ # Helper method to prep compiler in subclass compile() methods
+
+ def _setup_compile(self, outdir, macros, incdirs, sources, depends,
+ extra):
+ """Process arguments and decide which source files to compile.
+
+ Merges _fix_compile_args() and _prep_compile().
+ """
+ if outdir is None:
+ outdir = self.output_dir
+ elif type(outdir) is not StringType:
+ raise TypeError, "'output_dir' must be a string or None"
+
+ if macros is None:
+ macros = self.macros
+ elif type(macros) is ListType:
+ macros = macros + (self.macros or [])
+ else:
+ raise TypeError, "'macros' (if supplied) must be a list of tuples"
+
+ if incdirs is None:
+ incdirs = self.include_dirs
+ elif type(incdirs) in (ListType, TupleType):
+ incdirs = list(incdirs) + (self.include_dirs or [])
+ else:
+ raise TypeError, \
+ "'include_dirs' (if supplied) must be a list of strings"
+
+ if extra is None:
+ extra = []
+
+ # Get the list of expected output (object) files
+ objects = self.object_filenames(sources,
+ strip_dir=python_build,
+ output_dir=outdir)
+ assert len(objects) == len(sources)
+
+ # XXX should redo this code to eliminate skip_source entirely.
+ # XXX instead create build and issue skip messages inline
+
+ if self.force:
+ skip_source = {} # rebuild everything
+ for source in sources:
+ skip_source[source] = 0
+ elif depends is None:
+ # If depends is None, figure out which source files we
+ # have to recompile according to a simplistic check. We
+ # just compare the source and object file, no deep
+ # dependency checking involving header files.
+ skip_source = {} # rebuild everything
+ for source in sources: # no wait, rebuild nothing
+ skip_source[source] = 1
+
+ n_sources, n_objects = newer_pairwise(sources, objects)
+ for source in n_sources: # no really, only rebuild what's
+ skip_source[source] = 0 # out-of-date
+ else:
+ # If depends is a list of files, then do a different
+ # simplistic check. Assume that each object depends on
+ # its source and all files in the depends list.
+ skip_source = {}
+ # L contains all the depends plus a spot at the end for a
+ # particular source file
+ L = depends[:] + [None]
+ for i in range(len(objects)):
+ source = sources[i]
+ L[-1] = source
+ if newer_group(L, objects[i]):
+ skip_source[source] = 0
+ else:
+ skip_source[source] = 1
+
+ pp_opts = gen_preprocess_options(macros, incdirs)
+
+ build = {}
+ for i in range(len(sources)):
+ src = sources[i]
+ obj = objects[i]
+ ext = os.path.splitext(src)[1]
+ self.mkpath(os.path.dirname(obj))
+ if skip_source[src]:
+ log.debug("skipping %s (%s up-to-date)", src, obj)
+ else:
+ build[obj] = src, ext
+
+ return macros, objects, extra, pp_opts, build
+
+ def _get_cc_args(self, pp_opts, debug, before):
+ # works for unixccompiler, emxccompiler, cygwinccompiler
+ cc_args = pp_opts + ['-c']
+ if debug:
+ cc_args[:0] = ['-g']
+ if before:
+ cc_args[:0] = before
+ return cc_args
+
def _fix_compile_args (self, output_dir, macros, include_dirs):
"""Typecheck and fix-up some of the arguments to the 'compile()'
***************
*** 343,348 ****
macros = macros + (self.macros or [])
else:
! raise TypeError, \
! "'macros' (if supplied) must be a list of tuples"
if include_dirs is None:
--- 452,456 ----
macros = macros + (self.macros or [])
else:
! raise TypeError, "'macros' (if supplied) must be a list of tuples"
if include_dirs is None:
***************
*** 354,372 ****
"'include_dirs' (if supplied) must be a list of strings"
! return (output_dir, macros, include_dirs)
# _fix_compile_args ()
! def _prep_compile (self, sources, output_dir):
! """Determine the list of object files corresponding to 'sources',
! and figure out which ones really need to be recompiled. Return a
! list of all object files and a dictionary telling which source
! files can be skipped.
"""
# Get the list of expected output (object) files
! objects = self.object_filenames (sources,
! strip_dir=1,
! output_dir=output_dir)
if self.force:
--- 462,482 ----
"'include_dirs' (if supplied) must be a list of strings"
! return output_dir, macros, include_dirs
# _fix_compile_args ()
! def _prep_compile(self, sources, output_dir, depends=None):
! """Decide which souce files must be recompiled.
!
! Determine the list of object files corresponding to 'sources',
! and figure out which ones really need to be recompiled.
! Return a list of all object files and a dictionary telling
! which source files can be skipped.
"""
# Get the list of expected output (object) files
! objects = self.object_filenames(sources, strip_dir=python_build,
! output_dir=output_dir)
! assert len(objects) == len(sources)
if self.force:
***************
*** 374,391 ****
for source in sources:
skip_source[source] = 0
! else:
! # Figure out which source files we have to recompile according
! # to a simplistic check -- we just compare the source and
! # object file, no deep dependency checking involving header
! # files.
skip_source = {} # rebuild everything
for source in sources: # no wait, rebuild nothing
skip_source[source] = 1
! (n_sources, n_objects) = newer_pairwise (sources, objects)
for source in n_sources: # no really, only rebuild what's
skip_source[source] = 0 # out-of-date
! return (objects, skip_source)
# _prep_compile ()
--- 484,516 ----
for source in sources:
skip_source[source] = 0
! elif depends is None:
! # If depends is None, figure out which source files we
! # have to recompile according to a simplistic check. We
! # just compare the source and object file, no deep
! # dependency checking involving header files.
skip_source = {} # rebuild everything
for source in sources: # no wait, rebuild nothing
skip_source[source] = 1
! n_sources, n_objects = newer_pairwise(sources, objects)
for source in n_sources: # no really, only rebuild what's
skip_source[source] = 0 # out-of-date
+ else:
+ # If depends is a list of files, then do a different
+ # simplistic check. Assume that each object depends on
+ # its source and all files in the depends list.
+ skip_source = {}
+ # L contains all the depends plus a spot at the end for a
+ # particular source file
+ L = depends[:] + [None]
+ for i in range(len(objects)):
+ source = sources[i]
+ L[-1] = source
+ if newer_group(L, objects[i]):
+ skip_source[source] = 0
+ else:
+ skip_source[source] = 1
! return objects, skip_source
# _prep_compile ()
***************
*** 464,467 ****
--- 589,613 ----
# _need_link ()
+ def detect_language (self, sources):
+ """Detect the language of a given file, or list of files. Uses
+ language_map, and language_order to do the job.
+ """
+ if type(sources) is not ListType:
+ sources = [sources]
+ lang = None
+ index = len(self.language_order)
+ for source in sources:
+ base, ext = os.path.splitext(source)
+ extlang = self.language_map.get(ext)
+ try:
+ extindex = self.language_order.index(extlang)
+ if extindex < index:
+ lang = extlang
+ index = extindex
+ except ValueError:
+ pass
+ return lang
+
+ # detect_language ()
# -- Worker methods ------------------------------------------------
***************
*** 486,505 ****
pass
! def compile (self,
! sources,
! output_dir=None,
! macros=None,
! include_dirs=None,
! debug=0,
! extra_preargs=None,
! extra_postargs=None):
! """Compile one or more source files. 'sources' must be a list of
! filenames, most likely C/C++ files, but in reality anything that
! can be handled by a particular compiler and compiler class
! (eg. MSVCCompiler can handle resource files in 'sources'). Return
! a list of object filenames, one per source filename in 'sources'.
! Depending on the implementation, not all source files will
! necessarily be compiled, but all corresponding object filenames
! will be returned.
If 'output_dir' is given, object files will be put under it, while
--- 632,648 ----
pass
! def compile(self, sources, output_dir=None, macros=None,
! include_dirs=None, debug=0, extra_preargs=None,
! extra_postargs=None, depends=None):
! """Compile one or more source files.
!
! 'sources' must be a list of filenames, most likely C/C++
! files, but in reality anything that can be handled by a
! particular compiler and compiler class (eg. MSVCCompiler can
! handle resource files in 'sources'). Return a list of object
! filenames, one per source filename in 'sources'. Depending on
! the implementation, not all source files will necessarily be
! compiled, but all corresponding object filenames will be
! returned.
If 'output_dir' is given, object files will be put under it, while
***************
*** 532,539 ****
cut the mustard.
Raises CompileError on failure.
"""
- pass
def create_static_lib (self,
--- 675,707 ----
cut the mustard.
+ 'depends', if given, is a list of filenames that all targets
+ depend on. If a source file is older than any file in
+ depends, then the source file will be recompiled. This
+ supports dependency tracking, but only at a coarse
+ granularity.
+
Raises CompileError on failure.
"""
+ # A concrete compiler class can either override this method
+ # entirely or implement _compile().
+
+ macros, objects, extra_postargs, pp_opts, build = \
+ self._setup_compile(output_dir, macros, include_dirs, sources,
+ depends, extra_postargs)
+ cc_args = self._get_cc_args(pp_opts, debug, extra_preargs)
+
+ for obj, (src, ext) in build.items():
+ self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
+
+ # Return *all* object filenames, not just the ones we just built.
+ return objects
+
+ def _compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts):
+ """Compile 'src' to product 'obj'."""
+
+ # A concrete compiler class that does not override compile()
+ # should implement _compile().
+ pass
def create_static_lib (self,
***************
*** 541,545 ****
output_libname,
output_dir=None,
! debug=0):
"""Link a bunch of stuff together to create a static library file.
The "bunch of stuff" consists of the list of object files supplied
--- 709,714 ----
output_libname,
output_dir=None,
! debug=0,
! target_lang=None):
"""Link a bunch of stuff together to create a static library file.
The "bunch of stuff" consists of the list of object files supplied
***************
*** 558,561 ****
--- 727,734 ----
just for consistency).
+ 'target_lang' is the target language for which the given objects
+ are being compiled. This allows specific linkage time treatment of
+ certain languages.
+
Raises LibError on failure.
"""
***************
*** 580,584 ****
extra_preargs=None,
extra_postargs=None,
! build_temp=None):
"""Link a bunch of stuff together to create an executable or
shared library file.
--- 753,758 ----
extra_preargs=None,
extra_postargs=None,
! build_temp=None,
! target_lang=None):
"""Link a bunch of stuff together to create an executable or
shared library file.
***************
*** 618,621 ****
--- 792,799 ----
particular linker being used).
+ 'target_lang' is the target language for which the given objects
+ are being compiled. This allows specific linkage time treatment of
+ certain languages.
+
Raises LinkError on failure.
"""
***************
*** 636,640 ****
extra_preargs=None,
extra_postargs=None,
! build_temp=None):
self.link(CCompiler.SHARED_LIBRARY, objects,
self.library_filename(output_libname, lib_type='shared'),
--- 814,819 ----
extra_preargs=None,
extra_postargs=None,
! build_temp=None,
! target_lang=None):
self.link(CCompiler.SHARED_LIBRARY, objects,
self.library_filename(output_libname, lib_type='shared'),
***************
*** 642,646 ****
libraries, library_dirs, runtime_library_dirs,
export_symbols, debug,
! extra_preargs, extra_postargs, build_temp)
--- 821,825 ----
libraries, library_dirs, runtime_library_dirs,
export_symbols, debug,
! extra_preargs, extra_postargs, build_temp, target_lang)
***************
*** 656,665 ****
extra_preargs=None,
extra_postargs=None,
! build_temp=None):
self.link(CCompiler.SHARED_OBJECT, objects,
output_filename, output_dir,
libraries, library_dirs, runtime_library_dirs,
export_symbols, debug,
! extra_preargs, extra_postargs, build_temp)
--- 835,845 ----
extra_preargs=None,
extra_postargs=None,
! build_temp=None,
! target_lang=None):
self.link(CCompiler.SHARED_OBJECT, objects,
output_filename, output_dir,
libraries, library_dirs, runtime_library_dirs,
export_symbols, debug,
! extra_preargs, extra_postargs, build_temp, target_lang)
***************
*** 673,681 ****
debug=0,
extra_preargs=None,
! extra_postargs=None):
self.link(CCompiler.EXECUTABLE, objects,
self.executable_filename(output_progname), output_dir,
libraries, library_dirs, runtime_library_dirs, None,
! debug, extra_preargs, extra_postargs, None)
--- 853,862 ----
debug=0,
extra_preargs=None,
! extra_postargs=None,
! target_lang=None):
self.link(CCompiler.EXECUTABLE, objects,
self.executable_filename(output_progname), output_dir,
libraries, library_dirs, runtime_library_dirs, None,
! debug, extra_preargs, extra_postargs, None, target_lang)
***************
*** 703,706 ****
--- 884,932 ----
raise NotImplementedError
+ def has_function(self, funcname,
+ includes=None,
+ include_dirs=None,
+ libraries=None,
+ library_dirs=None):
+ """Return a boolean indicating whether funcname is supported on
+ the current platform. The optional arguments can be used to
+ augment the compilation environment.
+ """
+
+ # this can't be included at module scope because it tries to
+ # import math which might not be available at that point - maybe
+ # the necessary logic should just be inlined?
+ import tempfile
+ if includes is None:
+ includes = []
+ if include_dirs is None:
+ include_dirs = []
+ if libraries is None:
+ libraries = []
+ if library_dirs is None:
+ library_dirs = []
+ fd, fname = tempfile.mkstemp(".c", funcname, text=True)
+ f = os.fdopen(fd, "w")
+ for incl in includes:
+ f.write("""#include "%s"\n""" % incl)
+ f.write("""\
+ main (int argc, char **argv) {
+ %s();
+ }
+ """ % funcname)
+ f.close()
+ try:
+ objects = self.compile([fname], include_dirs=include_dirs)
+ except CompileError:
+ return False
+
+ try:
+ self.link_executable(objects, "a.out",
+ libraries=libraries,
+ library_dirs=library_dirs)
+ except (LinkError, TypeError):
+ return False
+ return True
+
def find_library_file (self, dirs, lib, debug=0):
"""Search the specified list of directories for a static or shared
***************
*** 712,716 ****
raise NotImplementedError
-
# -- Filename generation methods -----------------------------------
--- 938,941 ----
***************
*** 747,807 ****
# extension for executable files, eg. '' or '.exe'
! def object_filenames (self,
! source_filenames,
! strip_dir=0,
! output_dir=''):
! if output_dir is None: output_dir = ''
obj_names = []
for src_name in source_filenames:
! (base, ext) = os.path.splitext (src_name)
if ext not in self.src_extensions:
raise UnknownFileError, \
! "unknown file type '%s' (from '%s')" % \
! (ext, src_name)
if strip_dir:
! base = os.path.basename (base)
! obj_names.append (os.path.join (output_dir,
! base + self.obj_extension))
return obj_names
! # object_filenames ()
!
!
! def shared_object_filename (self,
! basename,
! strip_dir=0,
! output_dir=''):
! if output_dir is None: output_dir = ''
if strip_dir:
basename = os.path.basename (basename)
! return os.path.join (output_dir, basename + self.shared_lib_extension)
! def executable_filename (self,
! basename,
! strip_dir=0,
! output_dir=''):
! if output_dir is None: output_dir = ''
if strip_dir:
basename = os.path.basename (basename)
return os.path.join(output_dir, basename + (self.exe_extension or ''))
! def library_filename (self,
! libname,
! lib_type='static', # or 'shared'
! strip_dir=0,
! output_dir=''):
!
! if output_dir is None: output_dir = ''
! if lib_type not in ("static","shared","dylib"):
raise ValueError, "'lib_type' must be \"static\", \"shared\" or \"dylib\""
! fmt = getattr (self, lib_type + "_lib_format")
! ext = getattr (self, lib_type + "_lib_extension")
! (dir, base) = os.path.split (libname)
filename = fmt % (base, ext)
if strip_dir:
dir = ''
! return os.path.join (output_dir, dir, filename)
--- 972,1018 ----
# extension for executable files, eg. '' or '.exe'
! def object_filenames(self, source_filenames, strip_dir=0, output_dir=''):
! if output_dir is None:
! output_dir = ''
obj_names = []
for src_name in source_filenames:
! base, ext = os.path.splitext(src_name)
! base = os.path.splitdrive(base)[1] # Chop off the drive
! base = base[os.path.isabs(base):] # If abs, chop off leading /
if ext not in self.src_extensions:
raise UnknownFileError, \
! "unknown file type '%s' (from '%s')" % (ext, src_name)
if strip_dir:
! base = os.path.basename(base)
! obj_names.append(os.path.join(output_dir,
! base + self.obj_extension))
return obj_names
! def shared_object_filename(self, basename, strip_dir=0, output_dir=''):
! assert output_dir is not None
if strip_dir:
basename = os.path.basename (basename)
! return os.path.join(output_dir, basename + self.shared_lib_extension)
! def executable_filename(self, basename, strip_dir=0, output_dir=''):
! assert output_dir is not None
if strip_dir:
basename = os.path.basename (basename)
return os.path.join(output_dir, basename + (self.exe_extension or ''))
! def library_filename(self, libname, lib_type='static', # or 'shared'
! strip_dir=0, output_dir=''):
! assert output_dir is not None
! if lib_type not in ("static", "shared", "dylib"):
raise ValueError, "'lib_type' must be \"static\", \"shared\" or \"dylib\""
! fmt = getattr(self, lib_type + "_lib_format")
! ext = getattr(self, lib_type + "_lib_extension")
! dir, base = os.path.split (libname)
filename = fmt % (base, ext)
if strip_dir:
dir = ''
! return os.path.join(output_dir, dir, filename)
***************
*** 809,817 ****
def announce (self, msg, level=1):
! if self.verbose >= level:
! print msg
def debug_print (self, msg):
! from distutils.core import DEBUG
if DEBUG:
print msg
--- 1020,1027 ----
def announce (self, msg, level=1):
! log.debug(msg)
def debug_print (self, msg):
! from distutils.debug import DEBUG
if DEBUG:
print msg
***************
*** 821,834 ****
def execute (self, func, args, msg=None, level=1):
! execute(func, args, msg, self.verbose >= level, self.dry_run)
def spawn (self, cmd):
! spawn (cmd, verbose=self.verbose, dry_run=self.dry_run)
def move_file (self, src, dst):
! return move_file (src, dst, verbose=self.verbose, dry_run=self.dry_run)
def mkpath (self, name, mode=0777):
! mkpath (name, mode, self.verbose, self.dry_run)
--- 1031,1044 ----
def execute (self, func, args, msg=None, level=1):
! execute(func, args, msg, self.dry_run)
def spawn (self, cmd):
! spawn (cmd, dry_run=self.dry_run)
def move_file (self, src, dst):
! return move_file (src, dst, dry_run=self.dry_run)
def mkpath (self, name, mode=0777):
! mkpath (name, mode, self.dry_run)
***************
*** 847,850 ****
--- 1057,1061 ----
# compiler
('cygwin.*', 'unix'),
+ ('os2emx', 'emx'),
# OS name mappings
***************
*** 893,896 ****
--- 1104,1109 ----
'mwerks': ('mwerkscompiler', 'MWerksCompiler',
"MetroWerks CodeWarrior"),
+ 'emx': ('emxccompiler', 'EMXCCompiler',
+ "EMX port of GNU C Compiler for OS/2"),
}
***************
*** 955,959 ****
"in module '%s'") % (class_name, module_name)
! return klass (verbose, dry_run, force)
--- 1168,1175 ----
"in module '%s'") % (class_name, module_name)
! # XXX The None is necessary to preserve backwards compatibility
! # with classes that expect verbose to be the first positional
! # argument.
! return klass (None, dry_run, force)
Index: cmd.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/python-lib/distutils/cmd.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** cmd.py 21 Dec 2002 14:52:54 -0000 1.2
--- cmd.py 10 Nov 2003 12:44:16 -0000 1.3
***************
*** 5,10 ****
"""
! # created 2000/04/03, Greg Ward
! # (extricated from core.py; actually dates back to the beginning)
__revision__ = "$Id$"
--- 5,9 ----
"""
! # This module should be kept compatible with Python 1.5.2.
__revision__ = "$Id$"
***************
*** 14,18 ****
from distutils.errors import *
from distutils import util, dir_util, file_util, archive_util, dep_util
!
class Command:
--- 13,17 ----
from distutils.errors import *
from distutils import util, dir_util, file_util, archive_util, dep_util
! from distutils import log
class Command:
***************
*** 73,81 ****
# "not defined, check self.distribution's copy", while 0 or 1 mean
# false and true (duh). Note that this means figuring out the real
! # value of each flag is a touch complicated -- hence "self.verbose"
! # (etc.) will be handled by __getattr__, below.
! self._verbose = None
self._dry_run = None
# Some commands define a 'self.force' option to ignore file
# timestamps, but methods defined *here* assume that
--- 72,84 ----
# "not defined, check self.distribution's copy", while 0 or 1 mean
# false and true (duh). Note that this means figuring out the real
! # value of each flag is a touch complicated -- hence "self._dry_run"
! # will be handled by __getattr__, below.
! # XXX This needs to be fixed.
self._dry_run = None
+ # verbose is largely ignored, but needs to be set for
+ # backwards compatibility (I think)?
+ self.verbose = dist.verbose
+
# Some commands define a 'self.force' option to ignore file
# timestamps, but methods defined *here* assume that
***************
*** 97,102 ****
def __getattr__ (self, attr):
! if attr in ('verbose', 'dry_run'):
myval = getattr(self, "_" + attr)
if myval is None:
--- 100,107 ----
+ # XXX A more explicit way to customize dry_run would be better.
+
def __getattr__ (self, attr):
! if attr == 'dry_run':
myval = getattr(self, "_" + attr)
if myval is None:
***************
*** 187,193 ****
'level' print 'msg' to stdout.
"""
! if self.verbose >= level:
! print msg
! sys.stdout.flush()
def debug_print (self, msg):
--- 192,196 ----
'level' print 'msg' to stdout.
"""
! log.log(level, msg)
def debug_print (self, msg):
***************
*** 195,199 ****
DISTUTILS_DEBUG environment variable) flag is true.
"""
! from distutils.core import DEBUG
if DEBUG:
print msg
--- 198,202 ----
DISTUTILS_DEBUG environment variable) flag is true.
"""
! from distutils.debug import DEBUG
if DEBUG:
print msg
***************
*** 353,362 ****
def execute (self, func, args, msg=None, level=1):
! util.execute(func, args, msg, self.verbose >= level, self.dry_run)
def mkpath (self, name, mode=0777):
! dir_util.mkpath(name, mode,
! self.verbose, self.dry_run)
--- 356,364 ----
def execute (self, func, args, msg=None, level=1):
! util.execute(func, args, msg, dry_run=self.dry_run)
def mkpath (self, name, mode=0777):
! dir_util.mkpath(name, mode, dry_run=self.dry_run)
***************
*** 372,377 ****
not self.force,
link,
! self.verbose >= level,
! self.dry_run)
--- 374,378 ----
not self.force,
link,
! dry_run=self.dry_run)
***************
*** 386,413 ****
preserve_mode,preserve_times,preserve_symlinks,
not self.force,
! self.verbose >= level,
! self.dry_run)
!
def move_file (self, src, dst, level=1):
! """Move a file respecting verbose and dry-run flags."""
! return file_util.move_file(src, dst,
! self.verbose >= level,
! self.dry_run)
!
def spawn (self, cmd, search_path=1, level=1):
! """Spawn an external command respecting verbose and dry-run flags."""
from distutils.spawn import spawn
! spawn(cmd, search_path,
! self.verbose >= level,
! self.dry_run)
!
def make_archive (self, base_name, format,
root_dir=None, base_dir=None):
return archive_util.make_archive(
! base_name, format, root_dir, base_dir,
! self.verbose, self.dry_run)
--- 387,405 ----
preserve_mode,preserve_times,preserve_symlinks,
not self.force,
! dry_run=self.dry_run)
def move_file (self, src, dst, level=1):
! """Move a file respectin dry-run flag."""
! return file_util.move_file(src, dst, dry_run = self.dry_run)
def spawn (self, cmd, search_path=1, level=1):
! """Spawn an external command respecting dry-run flag."""
from distutils.spawn import spawn
! spawn(cmd, search_path, dry_run= self.dry_run)
def make_archive (self, base_name, format,
root_dir=None, base_dir=None):
return archive_util.make_archive(
! base_name, format, root_dir, base_dir, dry_run=self.dry_run)
***************
*** 444,448 ****
# Otherwise, print the "skip" message
else:
! self.announce(skip_msg, level)
# make_file ()
--- 436,440 ----
# Otherwise, print the "skip" message
else:
! log.debug(skip_msg)
# make_file ()
Index: core.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/python-lib/distutils/core.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** core.py 21 Dec 2002 14:52:54 -0000 1.2
--- core.py 10 Nov 2003 12:44:16 -0000 1.3
***************
*** 7,11 ****
"""
! # created 1999/03/01, Greg Ward
__revision__ = "$Id$"
--- 7,11 ----
"""
! # This module should be kept compatible with Python 1.5.2.
__revision__ = "$Id$"
***************
*** 13,16 ****
--- 13,18 ----
import sys, os
from types import *
+
+ from distutils.debug import DEBUG
from distutils.errors import *
from distutils.util import grok_environment_error
***************
*** 21,25 ****
from distutils.extension import Extension
-
# This is a barebones help message generated displayed when the user
# runs the setup script with no arguments at all. More useful help
--- 23,26 ----
***************
*** 33,41 ****
"""
-
- # If DISTUTILS_DEBUG is anything other than the empty string, we run in
- # debug mode.
- DEBUG = os.environ.get('DISTUTILS_DEBUG')
-
def gen_usage (script_name):
script = os.path.basename(script_name)
--- 34,37 ----
***************
*** 47,50 ****
--- 43,59 ----
_setup_distribution = None
+ # Legal keyword arguments for the setup() function
+ setup_keywords = ('distclass', 'script_name', 'script_args', 'options',
+ 'name', 'version', 'author', 'author_email',
+ 'maintainer', 'maintainer_email', 'url', 'license',
+ 'description', 'long_description', 'keywords',
+ 'platforms', 'classifiers', 'download_url')
+
+ # Legal keyword arguments for the Extension constructor
+ extension_keywords = ('name', 'sources', 'include_dirs',
+ 'define_macros', 'undef_macros',
+ 'library_dirs', 'libraries', 'runtime_library_dirs',
+ 'extra_objects', 'extra_compile_args', 'extra_link_args',
+ 'export_symbols', 'depends', 'language')
def setup (**attrs):
***************
*** 92,96 ****
if not attrs.has_key('script_name'):
! attrs['script_name'] = sys.argv[0]
if not attrs.has_key('script_args'):
attrs['script_args'] = sys.argv[1:]
--- 101,105 ----
if not attrs.has_key('script_name'):
! attrs['script_name'] = os.path.basename(sys.argv[0])
if not attrs.has_key('script_args'):
attrs['script_args'] = sys.argv[1:]
***************
*** 101,105 ****
_setup_distribution = dist = klass(attrs)
except DistutilsSetupError, msg:
! raise SystemExit, "error in setup script: %s" % msg
if _setup_stop_after == "init":
--- 110,118 ----
_setup_distribution = dist = klass(attrs)
except DistutilsSetupError, msg:
! if attrs.has_key('name'):
! raise SystemExit, "error in %s setup command: %s" % \
! (attrs['name'], msg)
! else:
! raise SystemExit, "error in setup command: %s" % msg
if _setup_stop_after == "init":
***************
*** 122,128 ****
ok = dist.parse_command_line()
except DistutilsArgError, msg:
! script = os.path.basename(dist.script_name)
! raise SystemExit, \
! gen_usage(dist.script_name) + "\nerror: %s" % msg
if DEBUG:
--- 135,139 ----
ok = dist.parse_command_line()
except DistutilsArgError, msg:
! raise SystemExit, gen_usage(dist.script_name) + "\nerror: %s" % msg
if DEBUG:
***************
*** 148,154 ****
raise SystemExit, error
! except (DistutilsExecError,
! DistutilsFileError,
! DistutilsOptionError,
CCompilerError), msg:
if DEBUG:
--- 159,163 ----
raise SystemExit, error
! except (DistutilsError,
CCompilerError), msg:
if DEBUG:
***************
*** 230,231 ****
--- 239,241 ----
# run_setup ()
+
Index: cygwinccompiler.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/python-lib/distutils/cygwinccompiler.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** cygwinccompiler.py 21 Dec 2002 14:52:54 -0000 1.2
--- cygwinccompiler.py 10 Nov 2003 12:44:16 -0000 1.3
***************
*** 41,46 ****
# in the dlls.
# *** only the version of June 2000 shows these problems
! # created 2000/05/05, Rene Liebscher
__revision__ = "$Id$"
--- 41,50 ----
# in the dlls.
# *** only the version of June 2000 shows these problems
+ # * cygwin gcc 3.2/ld 2.13.90 works
+ # (ld supports -shared)
+ # * mingw gcc 3.2/ld 2.13 works
+ # (ld supports -shared)
! # This module should be kept compatible with Python 1.5.2.
__revision__ = "$Id$"
***************
*** 51,54 ****
--- 55,59 ----
from distutils.file_util import write_file
from distutils.errors import DistutilsExecError, CompileError, UnknownFileError
+ from distutils import log
class CygwinCCompiler (UnixCCompiler):
***************
*** 62,69 ****
exe_extension = ".exe"
! def __init__ (self,
! verbose=0,
! dry_run=0,
! force=0):
UnixCCompiler.__init__ (self, verbose, dry_run, force)
--- 67,71 ----
exe_extension = ".exe"
! def __init__ (self, verbose=0, dry_run=0, force=0):
UnixCCompiler.__init__ (self, verbose, dry_run, force)
***************
*** 74,82 ****
if status is not CONFIG_H_OK:
self.warn(
! "Python's pyconfig.h doesn't seem to support your compiler. " +
! ("Reason: %s." % details) +
! "Compiling may fail because of undefined preprocessor macros.")
! (self.gcc_version, self.ld_version, self.dllwrap_version) = \
get_versions()
self.debug_print(self.compiler_type + ": gcc %s, ld %s, dllwrap %s\n" %
--- 76,85 ----
if status is not CONFIG_H_OK:
self.warn(
! "Python's pyconfig.h doesn't seem to support your compiler. "
! "Reason: %s. "
! "Compiling may fail because of undefined preprocessor macros."
! % details)
! self.gcc_version, self.ld_version, self.dllwrap_version = \
get_versions()
self.debug_print(self.compiler_type + ": gcc %s, ld %s, dllwrap %s\n" %
***************
*** 85,89 ****
self.dllwrap_version) )
! # ld_version >= "2.10.90" should also be able to use
# gcc -mdll instead of dllwrap
# Older dllwraps had own version numbers, newer ones use the
--- 88,92 ----
self.dllwrap_version) )
! # ld_version >= "2.10.90" and < "2.13" should also be able to use
# gcc -mdll instead of dllwrap
# Older dllwraps had own version numbers, newer ones use the
***************
*** 95,98 ****
--- 98,108 ----
self.linker_dll = "dllwrap"
+ # ld_version >= "2.13" support -shared so use it instead of
+ # -mdll -static
+ if self.ld_version >= "2.13":
+ shared_option = "-shared"
+ else:
+ shared_option = "-mdll -static"
+
# Hard-code GCC because that's what this is all about.
# XXX optimization, warnings etc. should be customizable.
***************
*** 100,105 ****
compiler_so='gcc -mcygwin -mdll -O -Wall',
linker_exe='gcc -mcygwin',
! linker_so=('%s -mcygwin -mdll -static' %
! self.linker_dll))
# cygwin and mingw32 need different sets of libraries
--- 110,115 ----
compiler_so='gcc -mcygwin -mdll -O -Wall',
linker_exe='gcc -mcygwin',
! linker_so=('%s -mcygwin %s' %
! (self.linker_dll, shared_option)))
# cygwin and mingw32 need different sets of libraries
***************
*** 115,174 ****
# __init__ ()
- # not much different of the compile method in UnixCCompiler,
- # but we have to insert some lines in the middle of it, so
- # we put here a adapted version of it.
- # (If we would call compile() in the base class, it would do some
- # initializations a second time, this is why all is done here.)
- def compile (self,
- sources,
- output_dir=None,
- macros=None,
- include_dirs=None,
- debug=0,
- extra_preargs=None,
- extra_postargs=None):
-
- (output_dir, macros, include_dirs) = \
- self._fix_compile_args (output_dir, macros, include_dirs)
- ...
[truncated message content] |
Update of /cvsroot/wpdev/xmlscripts/python-lib/distutils/command
In directory sc8-pr-cvs1:/tmp/cvs-serv5168/distutils/command
Modified Files:
__init__.py bdist.py bdist_dumb.py bdist_rpm.py
bdist_wininst.py build.py build_clib.py build_ext.py
build_py.py build_scripts.py clean.py command_template
config.py install.py install_data.py install_headers.py
install_lib.py install_scripts.py sdist.py
Log Message:
Updated to Python 2.3.2
Index: __init__.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/python-lib/distutils/command/__init__.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** __init__.py 21 Dec 2002 14:52:55 -0000 1.2
--- __init__.py 10 Nov 2003 12:44:16 -0000 1.3
***************
*** 4,7 ****
--- 4,9 ----
commands."""
+ # This module should be kept compatible with Python 1.5.2.
+
__revision__ = "$Id$"
***************
*** 18,24 ****
--- 20,33 ----
'install_data',
'sdist',
+ 'register',
'bdist',
'bdist_dumb',
'bdist_rpm',
'bdist_wininst',
+ # These two are reserved for future use:
+ #'bdist_sdux',
+ #'bdist_pkgtool',
+ # Note:
+ # bdist_packager is not included because it only provides
+ # an abstract base class
]
Index: bdist.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/python-lib/distutils/command/bdist.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** bdist.py 21 Dec 2002 14:52:55 -0000 1.2
--- bdist.py 10 Nov 2003 12:44:16 -0000 1.3
***************
*** 4,8 ****
distribution)."""
! # created 2000/03/29, Greg Ward
__revision__ = "$Id$"
--- 4,8 ----
distribution)."""
! # This module should be kept compatible with Python 1.5.2.
__revision__ = "$Id$"
***************
*** 41,46 ****
--- 41,50 ----
"directory to put final built distributions in "
"[default: dist]"),
+ ('skip-build', None,
+ "skip rebuilding everything (for testing/debugging)"),
]
+ boolean_options = ['skip-build']
+
help_options = [
('help-formats', None,
***************
*** 49,65 ****
# The following commands do not take a format option from bdist
! no_format_option = ('bdist_rpm',)
# This won't do in reality: will need to distinguish RPM-ish Linux,
# Debian-ish Linux, Solaris, FreeBSD, ..., Windows, Mac OS.
default_format = { 'posix': 'gztar',
! 'nt': 'zip', }
# Establish the preferred order (for the --help-formats option).
format_commands = ['rpm', 'gztar', 'bztar', 'ztar', 'tar',
! 'wininst', 'zip']
# And the real information.
format_command = { 'rpm': ('bdist_rpm', "RPM distribution"),
'gztar': ('bdist_dumb', "gzip'ed tar file"),
'bztar': ('bdist_dumb', "bzip2'ed tar file"),
--- 53,75 ----
# The following commands do not take a format option from bdist
! no_format_option = ('bdist_rpm',
! #'bdist_sdux', 'bdist_pkgtool'
! )
# This won't do in reality: will need to distinguish RPM-ish Linux,
# Debian-ish Linux, Solaris, FreeBSD, ..., Windows, Mac OS.
default_format = { 'posix': 'gztar',
! 'nt': 'zip',
! 'os2': 'zip', }
# Establish the preferred order (for the --help-formats option).
format_commands = ['rpm', 'gztar', 'bztar', 'ztar', 'tar',
! 'wininst', 'zip',
! #'pkgtool', 'sdux'
! ]
# And the real information.
format_command = { 'rpm': ('bdist_rpm', "RPM distribution"),
+ 'zip': ('bdist_dumb', "ZIP file"),
'gztar': ('bdist_dumb', "gzip'ed tar file"),
'bztar': ('bdist_dumb', "bzip2'ed tar file"),
***************
*** 69,73 ****
"Windows executable installer"),
'zip': ('bdist_dumb', "ZIP file"),
! }
--- 79,86 ----
"Windows executable installer"),
'zip': ('bdist_dumb', "ZIP file"),
! #'pkgtool': ('bdist_pkgtool',
! # "Solaris pkgtool distribution"),
! #'sdux': ('bdist_sdux', "HP-UX swinstall depot"),
! }
***************
*** 77,80 ****
--- 90,94 ----
self.formats = None
self.dist_dir = None
+ self.skip_build = 0
# initialize_options()
***************
*** 125,131 ****
if cmd_name not in self.no_format_option:
sub_cmd.format = self.formats[i]
-
- print ("bdist.run: format=%s, command=%s, rest=%s" %
- (self.formats[i], cmd_name, commands[i+1:]))
# If we're going to need to run this command again, tell it to
--- 139,142 ----
Index: bdist_dumb.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/python-lib/distutils/command/bdist_dumb.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** bdist_dumb.py 21 Dec 2002 14:52:55 -0000 1.2
--- bdist_dumb.py 10 Nov 2003 12:44:16 -0000 1.3
***************
*** 5,9 ****
$exec_prefix)."""
! # created 2000/03/29, Greg Ward
__revision__ = "$Id$"
--- 5,9 ----
$exec_prefix)."""
! # This module should be kept compatible with Python 1.5.2.
__revision__ = "$Id$"
***************
*** 12,17 ****
from distutils.core import Command
from distutils.util import get_platform
! from distutils.dir_util import create_tree, remove_tree
from distutils.errors import *
class bdist_dumb (Command):
--- 12,18 ----
from distutils.core import Command
from distutils.util import get_platform
! from distutils.dir_util import create_tree, remove_tree, ensure_relative
from distutils.errors import *
+ from distutils import log
class bdist_dumb (Command):
***************
*** 31,40 ****
('dist-dir=', 'd',
"directory to put final built distributions in"),
]
! boolean_options = ['keep-temp']
default_format = { 'posix': 'gztar',
! 'nt': 'zip', }
--- 32,47 ----
('dist-dir=', 'd',
"directory to put final built distributions in"),
+ ('skip-build', None,
+ "skip rebuilding everything (for testing/debugging)"),
+ ('relative', None,
+ "build the archive using relative paths"
+ "(default: false)"),
]
! boolean_options = ['keep-temp', 'skip-build', 'relative']
default_format = { 'posix': 'gztar',
! 'nt': 'zip',
! 'os2': 'zip' }
***************
*** 45,49 ****
self.keep_temp = 0
self.dist_dir = None
!
# initialize_options()
--- 52,58 ----
self.keep_temp = 0
self.dist_dir = None
! self.skip_build = 0
! self.relative = 0
!
# initialize_options()
***************
*** 72,82 ****
def run (self):
! self.run_command('build')
install = self.reinitialize_command('install', reinit_subcommands=1)
install.root = self.bdist_dir
install.warn_dir = 0
! self.announce("installing to %s" % self.bdist_dir)
self.run_command('install')
--- 81,93 ----
def run (self):
! if not self.skip_build:
! self.run_command('build')
install = self.reinitialize_command('install', reinit_subcommands=1)
install.root = self.bdist_dir
+ install.skip_build = self.skip_build
install.warn_dir = 0
! log.info("installing to %s" % self.bdist_dir)
self.run_command('install')
***************
*** 85,94 ****
archive_basename = "%s.%s" % (self.distribution.get_fullname(),
self.plat_name)
! self.make_archive(os.path.join(self.dist_dir, archive_basename),
! self.format,
! root_dir=self.bdist_dir)
if not self.keep_temp:
! remove_tree(self.bdist_dir, self.verbose, self.dry_run)
# run()
--- 96,126 ----
archive_basename = "%s.%s" % (self.distribution.get_fullname(),
self.plat_name)
!
! # OS/2 objects to any ":" characters in a filename (such as when
! # a timestamp is used in a version) so change them to hyphens.
! if os.name == "os2":
! archive_basename = archive_basename.replace(":", "-")
!
! pseudoinstall_root = os.path.join(self.dist_dir, archive_basename)
! if not self.relative:
! archive_root = self.bdist_dir
! else:
! if (self.distribution.has_ext_modules() and
! (install.install_base != install.install_platbase)):
! raise DistutilsPlatformError, \
! ("can't make a dumb built distribution where "
! "base and platbase are different (%s, %s)"
! % (repr(install.install_base),
! repr(install.install_platbase)))
! else:
! archive_root = os.path.join(self.bdist_dir,
! ensure_relative(install.install_base))
!
! # Make the archive
! self.make_archive(pseudoinstall_root,
! self.format, root_dir=archive_root)
if not self.keep_temp:
! remove_tree(self.bdist_dir, dry_run=self.dry_run)
# run()
Index: bdist_rpm.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/python-lib/distutils/command/bdist_rpm.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** bdist_rpm.py 21 Dec 2002 14:52:55 -0000 1.2
--- bdist_rpm.py 10 Nov 2003 12:44:16 -0000 1.3
***************
*** 4,8 ****
distributions)."""
! # created 2000/04/25, by Harry Henry Gebel
__revision__ = "$Id$"
--- 4,8 ----
distributions)."""
! # This module should be kept compatible with Python 1.5.2.
__revision__ = "$Id$"
***************
*** 11,18 ****
import glob
from types import *
! from distutils.core import Command, DEBUG
from distutils.util import get_platform
from distutils.file_util import write_file
from distutils.errors import *
class bdist_rpm (Command):
--- 11,20 ----
import glob
from types import *
! from distutils.core import Command
! from distutils.debug import DEBUG
from distutils.util import get_platform
from distutils.file_util import write_file
from distutils.errors import *
+ from distutils import log
class bdist_rpm (Command):
***************
*** 67,71 ****
"list of documentation files (space or comma-separated)"),
('changelog=', None,
! "path to RPM changelog"),
('icon=', None,
"name of icon file"),
--- 69,73 ----
"list of documentation files (space or comma-separated)"),
('changelog=', None,
! "RPM changelog"),
('icon=', None,
"name of icon file"),
***************
*** 128,131 ****
--- 130,134 ----
self.install_script = None
self.clean_script = None
+ self.verify_script = None
self.pre_install = None
self.post_install = None
***************
*** 207,210 ****
--- 210,214 ----
self.ensure_filename('install_script')
self.ensure_filename('clean_script')
+ self.ensure_filename('verify_script')
self.ensure_filename('pre_install')
self.ensure_filename('post_install')
***************
*** 279,283 ****
# build package
! self.announce('building RPMs')
rpm_cmd = ['rpm']
if os.path.exists('/usr/bin/rpmbuild') or \
--- 283,287 ----
# build package
! log.info("building RPMs")
rpm_cmd = ['rpm']
if os.path.exists('/usr/bin/rpmbuild') or \
***************
*** 351,355 ****
spec_file.extend([
! 'Copyright: ' + self.distribution.get_license(),
'Group: ' + self.group,
'BuildRoot: %{_tmppath}/%{name}-buildroot',
--- 355,359 ----
spec_file.extend([
! 'License: ' + self.distribution.get_license(),
'Group: ' + self.group,
'BuildRoot: %{_tmppath}/%{name}-buildroot',
***************
*** 423,426 ****
--- 427,431 ----
"--record=INSTALLED_FILES") % self.python),
('clean', 'clean_script', "rm -rf $RPM_BUILD_ROOT"),
+ ('verifyscript', 'verify_script', None),
('pre', 'pre_install', None),
('post', 'post_install', None),
***************
*** 430,434 ****
for (rpm_opt, attr, default) in script_options:
! # Insert contents of file referred to, if no file is refered to
# use 'default' as contents of script
val = getattr(self, attr)
--- 435,439 ----
for (rpm_opt, attr, default) in script_options:
! # Insert contents of file referred to, if no file is referred to
# use 'default' as contents of script
val = getattr(self, attr)
Index: bdist_wininst.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/python-lib/distutils/command/bdist_wininst.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** bdist_wininst.py 21 Dec 2002 14:52:55 -0000 1.2
--- bdist_wininst.py 10 Nov 2003 12:44:16 -0000 1.3
***************
*** 4,8 ****
exe-program."""
! # created 2000/06/02, Thomas Heller
__revision__ = "$Id$"
--- 4,8 ----
exe-program."""
! # This module should be kept compatible with Python 1.5.2.
__revision__ = "$Id$"
***************
*** 13,16 ****
--- 13,18 ----
from distutils.dir_util import create_tree, remove_tree
from distutils.errors import *
+ from distutils.sysconfig import get_python_version
+ from distutils import log
class bdist_wininst (Command):
***************
*** 37,40 ****
--- 39,47 ----
('title=', 't',
"title to display on the installer background instead of default"),
+ ('skip-build', None,
+ "skip rebuilding everything (for testing/debugging)"),
+ ('install-script=', None,
+ "basename of installation script to be run after"
+ "installation or before deinstallation"),
]
***************
*** 51,54 ****
--- 58,63 ----
self.bitmap = None
self.title = None
+ self.skip_build = 0
+ self.install_script = None
# initialize_options()
***************
*** 62,66 ****
self.target_version = ""
if self.distribution.has_ext_modules():
! short_version = sys.version[:3]
if self.target_version and self.target_version != short_version:
raise DistutilsOptionError, \
--- 71,75 ----
self.target_version = ""
if self.distribution.has_ext_modules():
! short_version = get_python_version()
if self.target_version and self.target_version != short_version:
raise DistutilsOptionError, \
***************
*** 70,73 ****
--- 79,90 ----
self.set_undefined_options('bdist', ('dist_dir', 'dist_dir'))
+ if self.install_script:
+ for script in self.distribution.scripts:
+ if self.install_script == os.path.basename(script):
+ break
+ else:
+ raise DistutilsOptionError, \
+ "install_script '%s' not found in scripts" % \
+ self.install_script
# finalize_options()
***************
*** 81,88 ****
"must be compiled on a Windows 32 platform")
! self.run_command('build')
! install = self.reinitialize_command('install')
install.root = self.bdist_dir
install.warn_dir = 0
--- 98,107 ----
"must be compiled on a Windows 32 platform")
! if not self.skip_build:
! self.run_command('build')
! install = self.reinitialize_command('install', reinit_subcommands=1)
install.root = self.bdist_dir
+ install.skip_build = self.skip_build
install.warn_dir = 0
***************
*** 102,106 ****
value)
! self.announce("installing to %s" % self.bdist_dir)
install.ensure_finalized()
--- 121,125 ----
value)
! log.info("installing to %s", self.bdist_dir)
install.ensure_finalized()
***************
*** 123,131 ****
self.create_exe(arcname, fullname, self.bitmap)
# remove the zip-file again
! self.announce("removing temporary file '%s'" % arcname)
os.remove(arcname)
if not self.keep_temp:
! remove_tree(self.bdist_dir, self.verbose, self.dry_run)
# run()
--- 142,150 ----
self.create_exe(arcname, fullname, self.bitmap)
# remove the zip-file again
! log.debug("removing temporary file '%s'", arcname)
os.remove(arcname)
if not self.keep_temp:
! remove_tree(self.bdist_dir, dry_run=self.dry_run)
# run()
***************
*** 157,160 ****
--- 176,181 ----
# the installer runtime.
lines.append("\n[Setup]")
+ if self.install_script:
+ lines.append("install_script=%s" % self.install_script)
lines.append("info=%s" % repr(info)[1:-1])
lines.append("target_compile=%d" % (not self.no_target_compile))
***************
*** 215,570 ****
def get_exe_bytes (self):
! import base64
! return base64.decodestring(EXEDATA)
# class bdist_wininst
-
- if __name__ == '__main__':
- # recreate EXEDATA from wininst.exe by rewriting this file
- import re, base64
- moddata = open("bdist_wininst.py", "r").read()
- exedata = open("../../misc/wininst.exe", "rb").read()
- print "wininst.exe length is %d bytes" % len(exedata)
- print "wininst.exe encoded length is %d bytes" % len(base64.encodestring(exedata))
- exp = re.compile('EXE'+'DATA = """\\\\(\n.*)*\n"""', re.M)
- data = exp.sub('EXE' + 'DATA = """\\\\\n%s"""' %
- base64.encodestring(exedata), moddata)
- open("bdist_wininst.py", "w").write(data)
- print "bdist_wininst.py recreated"
-
- EXEDATA = """\
- TVqQAAMAAAAEAAAA//8AALgAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
- AAAA8AAAAA4fug4AtAnNIbgBTM0hVGhpcyBwcm9ncmFtIGNhbm5vdCBiZSBydW4gaW4gRE9TIG1v
- ZGUuDQ0KJAAAAAAAAAA/SHa+eykY7XspGO17KRjtADUU7XkpGO0UNhLtcCkY7fg1Fu15KRjtFDYc
- 7XkpGO0ZNgvtcykY7XspGe0GKRjteykY7XYpGO19ChLteSkY7bwvHu16KRjtUmljaHspGO0AAAAA
- AAAAAAAAAAAAAAAAUEUAAEwBAwCUrh88AAAAAAAAAADgAA8BCwEGAABQAAAAEAAAAKAAANDuAAAA
- sAAAAAABAAAAQAAAEAAAAAIAAAQAAAAAAAAABAAAAAAAAAAAEAEAAAQAAAAAAAACAAAAAAAQAAAQ
- AAAAABAAABAAAAAAAAAQAAAAAAAAAAAAAAAwAQEAbAEAAAAAAQAwAQAAAAAAAAAAAAAAAAAAAAAA
- AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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0VSTkVMMzIuRExMAEFEVkFQSTMyLmRsbABDT01DVEwzMi5kbGwAR0RJMzIuZGxs
- AE1TVkNSVC5kbGwAVVNFUjMyLmRsbAAATG9hZExpYnJhcnlBAABHZXRQcm9jQWRkcmVzcwAARXhp
- dFByb2Nlc3MAAABSZWdDbG9zZUtleQAAAFByb3BlcnR5U2hlZXRBAABUZXh0T3V0QQAAZXhpdAAA
- R2V0REMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
- AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
- AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
- AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
- AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
- AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
- AAAAAAAAAAAAAAAAAAAAAAAAAAA=
- """
-
- # --- EOF ---
--- 236,242 ----
def get_exe_bytes (self):
! # wininst.exe is in the same directory as this file
! directory = os.path.dirname(__file__)
! filename = os.path.join(directory, "wininst.exe")
! return open(filename, "rb").read()
# class bdist_wininst
Index: build.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/python-lib/distutils/command/build.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** build.py 21 Dec 2002 14:52:55 -0000 1.2
--- build.py 10 Nov 2003 12:44:16 -0000 1.3
***************
*** 3,7 ****
Implements the Distutils 'build' command."""
! # created 1999/03/08, Greg Ward
__revision__ = "$Id$"
--- 3,7 ----
Implements the Distutils 'build' command."""
! # This module should be kept compatible with Python 1.5.2.
__revision__ = "$Id$"
Index: build_clib.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/python-lib/distutils/command/build_clib.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** build_clib.py 21 Dec 2002 14:52:55 -0000 1.2
--- build_clib.py 10 Nov 2003 12:44:16 -0000 1.3
***************
*** 5,10 ****
module."""
! # created (an empty husk) 1999/12/18, Greg Ward
! # fleshed out 2000/02/03-04
__revision__ = "$Id$"
--- 5,9 ----
module."""
! # This module should be kept compatible with Python 1.5.2.
__revision__ = "$Id$"
***************
*** 25,29 ****
from distutils.errors import *
from distutils.sysconfig import customize_compiler
!
def show_compilers ():
--- 24,28 ----
from distutils.errors import *
from distutils.sysconfig import customize_compiler
! from distutils import log
def show_compilers ():
***************
*** 112,116 ****
from distutils.ccompiler import new_compiler
self.compiler = new_compiler(compiler=self.compiler,
- verbose=self.verbose,
dry_run=self.dry_run,
force=self.force)
--- 111,114 ----
***************
*** 214,218 ****
sources = list(sources)
! self.announce("building '%s' library" % lib_name)
# First, compile the source code to object files in the library
--- 212,216 ----
sources = list(sources)
! log.info("building '%s' library", lib_name)
# First, compile the source code to object files in the library
Index: build_ext.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/python-lib/distutils/command/build_ext.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** build_ext.py 21 Dec 2002 14:52:55 -0000 1.2
--- build_ext.py 10 Nov 2003 12:44:16 -0000 1.3
***************
*** 5,9 ****
extensions ASAP)."""
! # created 1999/08/09, Greg Ward
__revision__ = "$Id$"
--- 5,9 ----
extensions ASAP)."""
! # This module should be kept compatible with Python 1.5.2.
__revision__ = "$Id$"
***************
*** 13,19 ****
from distutils.core import Command
from distutils.errors import *
! from distutils.sysconfig import customize_compiler
from distutils.dep_util import newer_group
from distutils.extension import Extension
# An extension name is just a dot-separated list of Python NAMEs (ie.
--- 13,20 ----
from distutils.core import Command
from distutils.errors import *
! from distutils.sysconfig import customize_compiler, get_python_version
from distutils.dep_util import newer_group
from distutils.extension import Extension
+ from distutils import log
# An extension name is just a dot-separated list of Python NAMEs (ie.
***************
*** 168,177 ****
self.build_temp = os.path.join(self.build_temp, "Release")
! # for extensions under Cygwin Python's library directory must be
# appended to library_dirs
! if sys.platform[:6] == 'cygwin':
if string.find(sys.executable, sys.exec_prefix) != -1:
# building third party extensions
! self.library_dirs.append(os.path.join(sys.prefix, "lib", "python" + sys.version[:3], "config"))
else:
# building python standard extensions
--- 169,190 ----
self.build_temp = os.path.join(self.build_temp, "Release")
! # Append the source distribution include and library directories,
! # this allows distutils on windows to work in the source tree
! self.include_dirs.append(os.path.join(sys.exec_prefix, 'PC'))
! self.library_dirs.append(os.path.join(sys.exec_prefix, 'PCBuild'))
!
! # OS/2 (EMX) doesn't support Debug vs Release builds, but has the
! # import libraries in its "Config" subdirectory
! if os.name == 'os2':
! self.library_dirs.append(os.path.join(sys.exec_prefix, 'Config'))
!
! # for extensions under Cygwin and AtheOS Python's library directory must be
# appended to library_dirs
! if sys.platform[:6] == 'cygwin' or sys.platform[:6] == 'atheos':
if string.find(sys.executable, sys.exec_prefix) != -1:
# building third party extensions
! self.library_dirs.append(os.path.join(sys.prefix, "lib",
! "python" + get_python_version(),
! "config"))
else:
# building python standard extensions
***************
*** 280,286 ****
(ext_name, build_info) = ext
! self.warn(("old-style (ext_name, build_info) tuple found in "
! "ext_modules for extension '%s'"
! "-- please convert to Extension instance" % ext_name))
if type(ext) is not TupleType and len(ext) != 2:
raise DistutilsSetupError, \
--- 293,299 ----
(ext_name, build_info) = ext
! log.warn(("old-style (ext_name, build_info) tuple found in "
! "ext_modules for extension '%s'"
! "-- please convert to Extension instance" % ext_name))
if type(ext) is not TupleType and len(ext) != 2:
raise DistutilsSetupError, \
***************
*** 318,323 ****
ext.runtime_library_dirs = build_info.get('rpath')
if build_info.has_key('def_file'):
! self.warn("'def_file' element of build info dict "
! "no longer supported")
# Non-trivial stuff: 'macros' split into 'define_macros'
--- 331,336 ----
ext.runtime_library_dirs = build_info.get('rpath')
if build_info.has_key('def_file'):
! log.warn("'def_file' element of build info dict "
! "no longer supported")
# Non-trivial stuff: 'macros' split into 'define_macros'
***************
*** 376,380 ****
def build_extensions(self):
-
# First, sanity-check the 'extensions' list
self.check_extensions_list(self.extensions)
--- 389,392 ----
***************
*** 384,388 ****
def build_extension(self, ext):
-
sources = ext.sources
if sources is None or type(sources) not in (ListType, TupleType):
--- 396,399 ----
***************
*** 409,419 ****
ext_filename = os.path.join(self.build_lib,
self.get_ext_filename(fullname))
!
! if not (self.force or newer_group(sources, ext_filename, 'newer')):
! self.announce("skipping '%s' extension (up-to-date)" %
! ext.name)
return
else:
! self.announce("building '%s' extension" % ext.name)
# First, scan the sources for SWIG definition files (.i), run
--- 420,429 ----
ext_filename = os.path.join(self.build_lib,
self.get_ext_filename(fullname))
! depends = sources + ext.depends
! if not (self.force or newer_group(depends, ext_filename, 'newer')):
! log.debug("skipping '%s' extension (up-to-date)", ext.name)
return
else:
! log.info("building '%s' extension", ext.name)
# First, scan the sources for SWIG definition files (.i), run
***************
*** 442,453 ****
macros.append((undef,))
- # XXX and if we support CFLAGS, why not CC (compiler
- # executable), CPPFLAGS (pre-processor options), and LDFLAGS
- # (linker options) too?
- # XXX should we use shlex to properly parse CFLAGS?
-
- if os.environ.has_key('CFLAGS'):
- extra_args.extend(string.split(os.environ['CFLAGS']))
-
objects = self.compiler.compile(sources,
output_dir=self.build_temp,
--- 452,455 ----
***************
*** 455,459 ****
include_dirs=ext.include_dirs,
debug=self.debug,
! extra_postargs=extra_args)
# XXX -- this is a Vile HACK!
--- 457,462 ----
include_dirs=ext.include_dirs,
debug=self.debug,
! extra_postargs=extra_args,
! depends=ext.depends)
# XXX -- this is a Vile HACK!
***************
*** 475,478 ****
--- 478,483 ----
extra_args = ext.extra_link_args or []
+ # Detect target language, if not provided
+ language = ext.language or self.compiler.detect_language(sources)
self.compiler.link_shared_object(
***************
*** 484,488 ****
export_symbols=self.get_export_symbols(ext),
debug=self.debug,
! build_temp=self.build_temp)
--- 489,494 ----
export_symbols=self.get_export_symbols(ext),
debug=self.debug,
! build_temp=self.build_temp,
! target_lang=language)
***************
*** 512,516 ****
(base, ext) = os.path.splitext(source)
if ext == ".i": # SWIG interface file
! new_sources.append(base + target_ext)
swig_sources.append(source)
swig_targets[source] = new_sources[-1]
--- 518,522 ----
(base, ext) = os.path.splitext(source)
if ext == ".i": # SWIG interface file
! new_sources.append(base + '_wrap' + target_ext)
swig_sources.append(source)
swig_targets[source] = new_sources[-1]
***************
*** 522,526 ****
swig = self.find_swig()
! swig_cmd = [swig, "-python", "-dnone", "-ISWIG"]
if self.swig_cpp:
swig_cmd.append("-c++")
--- 528,532 ----
swig = self.find_swig()
! swig_cmd = [swig, "-python"]
if self.swig_cpp:
swig_cmd.append("-c++")
***************
*** 528,532 ****
for source in swig_sources:
target = swig_targets[source]
! self.announce("swigging %s to %s" % (source, target))
self.spawn(swig_cmd + ["-o", target, source])
--- 534,538 ----
for source in swig_sources:
target = swig_targets[source]
! log.info("swigging %s to %s", source, target)
self.spawn(swig_cmd + ["-o", target, source])
***************
*** 555,558 ****
--- 561,568 ----
return "swig.exe"
+ elif os.name == "os2":
+ # assume swig available in the PATH.
+ return "swig.exe"
+
else:
raise DistutilsPlatformError, \
***************
*** 579,582 ****
--- 589,595 ----
from distutils.sysconfig import get_config_var
ext_path = string.split(ext_name, '.')
+ # OS/2 has an 8 character module (extension) limit :-(
+ if os.name == "os2":
+ ext_path[len(ext_path) - 1] = ext_path[len(ext_path) - 1][:8]
# extensions in debug_mode are named 'module_d.pyd' under windows
so_ext = get_config_var('SO')
***************
*** 600,604 ****
"""Return the list of libraries to link against when building a
shared extension. On most platforms, this is just 'ext.libraries';
! on Windows, we add the Python library (eg. python20.dll).
"""
# The python library is always needed on Windows. For MSVC, this
--- 613,617 ----
"""Return the list of libraries to link against when building a
shared extension. On most platforms, this is just 'ext.libraries';
! on Windows and OS/2, we add the Python library (eg. python20.dll).
"""
# The python library is always needed on Windows. For MSVC, this
***************
*** 607,616 ****
# to need it mentioned explicitly, though, so that's what we do.
# Append '_d' to the python import library on debug builds.
! from distutils.msvccompiler import MSVCCompiler
! if sys.platform == "win32" and \
! not isinstance(self.compiler, MSVCCompiler):
template = "python%d%d"
! if self.debug:
! template = template + '_d'
pythonlib = (template %
(sys.hexversion >> 24, (sys.hexversion >> 16) & 0xff))
--- 620,644 ----
# to need it mentioned explicitly, though, so that's what we do.
# Append '_d' to the python import library on debug builds.
! if sys.platform == "win32":
! from distutils.msvccompiler import MSVCCompiler
! if not isinstance(self.compiler, MSVCCompiler):
! template = "python%d%d"
! if self.debug:
! template = template + '_d'
! pythonlib = (template %
! (sys.hexversion >> 24, (sys.hexversion >> 16) & 0xff))
! # don't extend ext.libraries, it may be shared with other
! # extensions, it is a reference to the original list
! return ext.libraries + [pythonlib]
! else:
! return ext.libraries
! elif sys.platform == "os2emx":
! # EMX/GCC requires the python library explicitly, and I
! # believe VACPP does as well (though not confirmed) - AIM Apr01
template = "python%d%d"
! # debug versions of the main DLL aren't supported, at least
! # not at this time - AIM Apr01
! #if self.debug:
! ...
[truncated message content] |
|
From: <co...@us...> - 2003-11-10 12:44:21
|
Update of /cvsroot/wpdev/xmlscripts/python-lib/xml/parsers In directory sc8-pr-cvs1:/tmp/cvs-serv5168/xml/parsers Modified Files: expat.py Log Message: Updated to Python 2.3.2 Index: expat.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/python-lib/xml/parsers/expat.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** expat.py 21 Dec 2002 14:52:55 -0000 1.2 --- expat.py 10 Nov 2003 12:44:17 -0000 1.3 *************** *** 2,13 **** __version__ = '$Revision$' ! import sys ! ! try: ! from pyexpat import * ! except ImportError: ! del sys.modules[__name__] ! del sys ! raise ! ! del sys --- 2,4 ---- __version__ = '$Revision$' ! from pyexpat import * |
|
From: <co...@us...> - 2003-11-10 12:44:21
|
Update of /cvsroot/wpdev/xmlscripts/python-lib/xml/dom
In directory sc8-pr-cvs1:/tmp/cvs-serv5168/xml/dom
Modified Files:
__init__.py domreg.py minidom.py pulldom.py
Log Message:
Updated to Python 2.3.2
Index: __init__.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/python-lib/xml/dom/__init__.py,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** __init__.py 1 Jul 2002 02:00:11 -0000 1.1.1.1
--- __init__.py 10 Nov 2003 12:44:16 -0000 1.2
***************
*** 56,59 ****
--- 56,60 ----
NAMESPACE_ERR = 14
INVALID_ACCESS_ERR = 15
+ VALIDATION_ERR = 16
***************
*** 66,70 ****
raise RuntimeError(
"DOMException should not be instantiated directly")
! apply(Exception.__init__, (self,) + args, kw)
def _get_code(self):
--- 67,71 ----
raise RuntimeError(
"DOMException should not be instantiated directly")
! Exception.__init__(self, *args, **kw)
def _get_code(self):
***************
*** 117,120 ****
--- 118,133 ----
code = INVALID_ACCESS_ERR
+ class ValidationErr(DOMException):
+ code = VALIDATION_ERR
+
+ class UserDataHandler:
+ """Class giving the operation constants for UserDataHandler.handle()."""
+
+ # Based on DOM Level 3 (WD 9 April 2002)
+
+ NODE_CLONED = 1
+ NODE_IMPORTED = 2
+ NODE_DELETED = 3
+ NODE_RENAMED = 4
XML_NAMESPACE = "http://www.w3.org/XML/1998/namespace"
***************
*** 122,125 ****
--- 135,139 ----
XHTML_NAMESPACE = "http://www.w3.org/1999/xhtml"
EMPTY_NAMESPACE = None
+ EMPTY_PREFIX = None
from domreg import getDOMImplementation,registerDOMImplementation
Index: domreg.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/python-lib/xml/dom/domreg.py,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** domreg.py 1 Jul 2002 02:00:10 -0000 1.1.1.1
--- domreg.py 10 Nov 2003 12:44:16 -0000 1.2
***************
*** 3,6 ****
--- 3,8 ----
registerDOMImplementation should be imported from xml.dom."""
+ from xml.dom.minicompat import * # isinstance, StringTypes
+
# This is a list of well-known implementations. Well-known names
# should be published by posting to xm...@py..., and are
***************
*** 25,29 ****
or a new one (e.g. if that implementation supports some
customization)."""
!
registered[name] = factory
--- 27,31 ----
or a new one (e.g. if that implementation supports some
customization)."""
!
registered[name] = factory
***************
*** 47,51 ****
be found, raise an ImportError. The features list must be a sequence
of (feature, version) pairs which are passed to hasFeature."""
!
import os
creator = None
--- 49,53 ----
be found, raise an ImportError. The features list must be a sequence
of (feature, version) pairs which are passed to hasFeature."""
!
import os
creator = None
***************
*** 61,64 ****
--- 63,68 ----
# User did not specify a name, try implementations in arbitrary
# order, returning the one that has the required features
+ if isinstance(features, StringTypes):
+ features = _parse_feature_string(features)
for creator in registered.values():
dom = creator()
***************
*** 75,76 ****
--- 79,99 ----
raise ImportError,"no suitable DOM implementation found"
+
+ def _parse_feature_string(s):
+ features = []
+ parts = s.split()
+ i = 0
+ length = len(parts)
+ while i < length:
+ feature = parts[i]
+ if feature[0] in "0123456789":
+ raise ValueError, "bad feature name: " + `feature`
+ i = i + 1
+ version = None
+ if i < length:
+ v = parts[i]
+ if v[0] in "0123456789":
+ i = i + 1
+ version = v
+ features.append((feature, version))
+ return tuple(features)
Index: minidom.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/python-lib/xml/dom/minidom.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** minidom.py 21 Dec 2002 14:52:55 -0000 1.2
--- minidom.py 10 Nov 2003 12:44:16 -0000 1.3
***************
*** 15,90 ****
"""
- import string
- _string = string
- del string
-
- from xml.dom import HierarchyRequestErr, EMPTY_NAMESPACE
-
- # localize the types, and allow support for Unicode values if available:
- import types
[...2467 lines suppressed...]
! {'parser': parser, 'bufsize': bufsize})
! def parseString(string, parser=None):
"""Parse a file into a DOM from a string."""
! if parser is None:
! from xml.dom import expatbuilder
! return expatbuilder.parseString(string)
! else:
! from xml.dom import pulldom
! return _do_pulldom_parse(pulldom.parseString, (string,),
! {'parser': parser})
! def getDOMImplementation(features=None):
! if features:
! if isinstance(features, StringTypes):
! features = domreg._parse_feature_string(features)
! for f, v in features:
! if not Document.implementation.hasFeature(f, v):
! return None
return Document.implementation
Index: pulldom.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/python-lib/xml/dom/pulldom.py,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** pulldom.py 1 Jul 2002 02:00:11 -0000 1.1.1.1
--- pulldom.py 10 Nov 2003 12:44:16 -0000 1.2
***************
*** 22,25 ****
--- 22,26 ----
def __init__(self, documentFactory=None):
+ from xml.dom import XML_NAMESPACE
self.documentFactory = documentFactory
self.firstEvent = [None, None]
***************
*** 32,36 ****
# use class' pop instead
pass
! self._ns_contexts = [{}] # contains uri -> prefix dicts
self._current_context = self._ns_contexts[-1]
self.pending_events = []
--- 33,37 ----
# use class' pop instead
pass
! self._ns_contexts = [{XML_NAMESPACE:'xml'}] # contains uri -> prefix dicts
self._current_context = self._ns_contexts[-1]
self.pending_events = []
***************
*** 227,230 ****
--- 228,240 ----
return rc
raise IndexError
+
+ def next(self):
+ rc = self.getEvent()
+ if rc:
+ return rc
+ raise StopIteration
+
+ def __iter__(self):
+ return self
def expandNode(self, node):
|