mirror of
https://github.com/python/cpython.git
synced 2025-11-02 03:01:58 +00:00
Apply diff2.txt from SF patch http://www.python.org/sf/572113
(with one small bugfix in bgen/bgen/scantools.py) This replaces string module functions with string methods for the stuff in the Tools directory. Several uses of string.letters etc. are still remaining.
This commit is contained in:
parent
6a0477b099
commit
aaab30e00c
70 changed files with 271 additions and 346 deletions
|
|
@ -20,7 +20,6 @@
|
|||
import sys
|
||||
import os
|
||||
import varsubst
|
||||
import string
|
||||
|
||||
error = 'genmodule.error'
|
||||
|
||||
|
|
@ -43,7 +42,7 @@ class writer:
|
|||
if not self._subst:
|
||||
if not self.__dict__.has_key('abbrev'):
|
||||
self.abbrev = self.name
|
||||
self.Abbrev = string.upper(self.abbrev[0])+self.abbrev[1:]
|
||||
self.Abbrev = self.abbrev[0].upper()+self.abbrev[1:]
|
||||
subst = varsubst.Varsubst(self.__dict__)
|
||||
subst.useindent(1)
|
||||
self._subst = subst.subst
|
||||
|
|
|
|||
|
|
@ -223,7 +223,7 @@ class UI_module:
|
|||
rv = rv + (name+'.name = '+`self.name_entry.get()`+'\n')
|
||||
rv = rv + (name+'.abbrev = '+`self.abbrev_entry.get()`+'\n')
|
||||
rv = rv + (name+'.methodlist = '+`getlistlist(self.method_list)`+'\n')
|
||||
rv = rv + (name+'.objects = ['+string.joinfields(onames, ',')+']\n')
|
||||
rv = rv + (name+'.objects = ['+','.join(onames)+']\n')
|
||||
rv = rv + ('\n')
|
||||
return rv
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
#
|
||||
# Variable substitution. Variables are $delimited$
|
||||
#
|
||||
import string
|
||||
import re
|
||||
|
||||
error = 'varsubst.error'
|
||||
|
|
@ -37,7 +36,7 @@ class Varsubst:
|
|||
rv = rv + value
|
||||
|
||||
def _modindent(self, value, old):
|
||||
lastnl = string.rfind(old, '\n', 0) + 1
|
||||
lastnl = old.rfind('\n', 0) + 1
|
||||
lastnl = len(old) - lastnl
|
||||
sub = '\n' + (' '*lastnl)
|
||||
return re.sub('\n', sub, value)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue