All Samples(1634) | Call(1146) | Derive(171) | Import(317)
A string class for supporting $-substitutions.
src/p/y/Pydev-HEAD/plugins/org.python.pydev.parser/src/org/python/pydev/parser/grammarcommon/make_replace.py Pydev(Download)
from string import Template import os import sys grammar_common_dir = os.path.split(__file__)[0] parent_dir = os.path.split(grammar_common_dir)[0]
'''
DICTMAKER = Template(DICTMAKER)
substituted = str(DICTMAKER.substitute(**definitions))
return substituted
'''
DICTMAKER = Template(DICTMAKER)
substituted = str(DICTMAKER.substitute(**definitions))
return substituted
'''
IF = Template(IF)
substituted = str(IF.substitute(**definitions))
return substituted
{ test() [$COMMA test()] }
'''
ASSERT = Template(ASSERT)
substituted = str(ASSERT.substitute(**definitions))
return substituted
{ temporaryToken=<EXEC>{this.addSpecialTokenToLastOpened(temporaryToken);} expr() [temporaryToken=<IN>{this.addSpecialToken(temporaryToken);} test() [$COMMA test()]] }
'''
EXEC = Template(EXEC)
substituted = str(EXEC.substitute(**definitions))
return substituted
{ test() [$AS2 expr()]}
'''
PY3K_WITH_STMT = Template(PY3K_WITH_STMT)
substituted = str(PY3K_WITH_STMT.substitute(**definitions))
return substituted
{ temporaryToken=<WHILE>{this.addSpecialToken(temporaryToken,STRATEGY_BEFORE_NEXT);} {this.markLastAsSuiteStart();}
}
'''
WHILE = Template(WHILE)
substituted = str(WHILE.substitute(**definitions))
return substituted
def CreateBeginElseWithDeps(definitions):
BEGIN_ELSE = '''
Object[] begin_else_stmt(): {Object o1, o2;}
{ o1=<ELSE> o2=<COLON>{return new Object[]{o1, o2};}
}
'''
BEGIN_ELSE = Template(BEGIN_ELSE)
else:
definitions['STMT'] = CreateStmt()
s = Template(open(file, 'r').read())
s = s.substitute(**definitions)
f = open(file[:-len('_template')], 'w')
f.write(s)
src/s/o/softgridhelper-HEAD/OSD Helper/src/OSDHelper.py softgridhelper(Download)
import uuid import subprocess import re from string import Template import win32gui, win32con import OSDRegCleanup as osdrg
destPath = os.path.join(destPath, destFolder)
x = copyPackage(sourcePath, destPath)
listFiles = os.listdir(destPath)
appApp = Template('sftmime add app:"$OSD_NAME" /osd "$OSD_FILE" /icon "$ICON_FILE"')
publishApp = Template('sftmime publish app:"$OSD_NAME $OSD_VER" /TARGET "$PUBLISH_LOCATION"')
for files in listFiles:
ext = string.lower(os.path.splitext(files)[1])
src/s/p/spike-HEAD/vendor/stackless/v2.5.1/Misc/Vim/vim_syntax.py spike(Download)
from __future__ import with_statement import keyword import exceptions import __builtin__ from string import Template
def str_regexes():
"""Generator to yield various combinations of strings regexes"""
regex_template = Template('matchgroup=Normal ' +
'start=+[uU]\=${raw}${sep}+ ' +
'end=+${sep}+ ' +
'${skip} ' +
'${contains}')
skip_regex = Template(r'skip=+\\\\\|\\${sep}+')
src/s/p/spike-HEAD/vendor/stackless/current/Misc/Vim/vim_syntax.py spike(Download)
from __future__ import with_statement import keyword import exceptions import __builtin__ from string import Template
def str_regexes():
"""Generator to yield various combinations of strings regexes"""
regex_template = Template('matchgroup=Normal ' +
'start=+[uU]\=${raw}${sep}+ ' +
'end=+${sep}+ ' +
'${skip} ' +
'${contains}')
skip_regex = Template(r'skip=+\\\\\|\\${sep}+')
src/s/p/spike-HEAD/vendor/Python/v2.5.1/Misc/Vim/vim_syntax.py spike(Download)
from __future__ import with_statement import keyword import exceptions import __builtin__ from string import Template
def str_regexes():
"""Generator to yield various combinations of strings regexes"""
regex_template = Template('matchgroup=Normal ' +
'start=+[uU]\=${raw}${sep}+ ' +
'end=+${sep}+ ' +
'${skip} ' +
'${contains}')
skip_regex = Template(r'skip=+\\\\\|\\${sep}+')
src/s/p/spike-HEAD/vendor/Python/current/Misc/Vim/vim_syntax.py spike(Download)
from __future__ import with_statement import keyword import exceptions import __builtin__ from string import Template
def str_regexes():
"""Generator to yield various combinations of strings regexes"""
regex_template = Template('matchgroup=Normal ' +
'start=+[uU]\=${raw}${sep}+ ' +
'end=+${sep}+ ' +
'${skip} ' +
'${contains}')
skip_regex = Template(r'skip=+\\\\\|\\${sep}+')
src/u/n/unixpiger-HEAD/trunk/monitor/api/python/Misc/Vim/vim_syntax.py unixpiger(Download)
from __future__ import with_statement import keyword import exceptions import __builtin__ from string import Template
def str_regexes():
"""Generator to yield various combinations of strings regexes"""
regex_template = Template('matchgroup=Normal ' +
'start=+[uU]\=${raw}${sep}+ ' +
'end=+${sep}+ ' +
'${skip} ' +
'${contains}')
skip_regex = Template(r'skip=+\\\\\|\\${sep}+')
src/u/n/unladen-swallow-HEAD/Misc/Vim/vim_syntax.py unladen-swallow(Download)
from __future__ import with_statement import keyword import exceptions import __builtin__ from string import Template from sys import subversion
def str_regexes():
"""Generator to yield various combinations of strings regexes"""
regex_template = Template('matchgroup=Normal ' +
'start=+[uU]\=${raw}${sep}+ ' +
'end=+${sep}+ ' +
'${skip} ' +
'${contains}')
skip_regex = Template(r'skip=+\\\\\|\\${sep}+')
src/p/y/python2.6-HEAD/Misc/Vim/vim_syntax.py python2.6(Download)
from __future__ import with_statement import keyword import exceptions import __builtin__ from string import Template from sys import subversion
def str_regexes():
"""Generator to yield various combinations of strings regexes"""
regex_template = Template('matchgroup=Normal ' +
'start=+[uU]\=${raw}${sep}+ ' +
'end=+${sep}+ ' +
'${skip} ' +
'${contains}')
skip_regex = Template(r'skip=+\\\\\|\\${sep}+')
src/s/l/SlopPy-HEAD/Misc/Vim/vim_syntax.py SlopPy(Download)
from __future__ import with_statement import keyword import exceptions import __builtin__ from string import Template from sys import subversion
def str_regexes():
"""Generator to yield various combinations of strings regexes"""
regex_template = Template('matchgroup=Normal ' +
'start=+[uU]\=${raw}${sep}+ ' +
'end=+${sep}+ ' +
'${skip} ' +
'${contains}')
skip_regex = Template(r'skip=+\\\\\|\\${sep}+')
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 Next