All Samples(10417) | Call(9831) | Derive(0) | Import(586)
join(list [,sep]) -> string Return a string composed of the words in list, with intervening occurrences of sep. The default separator is a single space. (joinfields and join are synonymous)
def join(words, sep = ' '):
"""join(list [,sep]) -> string
Return a string composed of the words in list, with
intervening occurrences of sep. The default separator is a
single space.
(joinfields and join are synonymous)
"""
return sep.join(words)
i = j+1
if is_header:
body = string.join(body, "\n ")
else:
body = string.join(body, "\n")
return body
src/c/l/clearsilver-0.10.1/clearsilver/python/examples/base/odb.py clearsilver(Download)
def _createTableSQL(self):
defs = []
for colname, coltype, options in self.__column_list:
defs.append(self._colTypeToSQLType(colname, coltype, options))
defs = string.join(defs, ", ")
primarykeys = self.getPrimaryKeyList()
primarykey_str = ""
if primarykeys:
primarykey_str = ", PRIMARY KEY (" + string.join(primarykeys, ",") + ")"
def addIndex(self, columns, indexName=None, unique=0):
if indexName is None:
indexName = self.getTableName() + "_index_" + string.join(columns, "_")
self.__indices[indexName] = (columns, unique)
def createIndex(self, columns, indexName=None, unique=0, cursor=None):
if cursor is None: cursor = self.db.defaultCursor()
cols = string.join(columns, ",")
if indexName is None:
indexName = self.getTableName() + "_index_" + string.join(columns, "_")
eInvalidJoinSpec, "can't find table %s in defined relations for %s" % (a_table,self.__table_name)
# start buildling SQL
sql = "select %s from %s" % (string.join(sql_columns,","),
self.__table_name)
# add join clause
if join_clauses:
sql = sql + string.join(join_clauses," ")
# add where clause elements
sql_where_list = self.__buildWhereClause (col_match_spec,where)
if sql_where_list:
sql = sql + " where %s" % (string.join(sql_where_list," and "))
# add order by clause
if order_by:
sql = sql + " order by %s " % string.join(order_by,",")
# add limit
if not limit_to is None:
sql_where_list = self.__buildWhereClause (match_spec)
sql = "delete from %s where %s" % (self.__table_name,
string.join(sql_where_list," and "))
dlog(DEV_UPDATE,sql)
cursor.execute(sql)
if sql_set_list:
sql = "update %s set %s where %s" % (self.__table_name,
string.join(sql_set_list,","),
string.join(sql_where_list," and "))
dlog(DEV_UPDATE,sql)
if replace:
sql = "replace into %s (%s) values (%s)" % (self.__table_name,
string.join(sql_col_list,","),
string.join(sql_data_list,","))
else:
sql = "insert into %s (%s) values (%s)" % (self.__table_name,
string.join(sql_col_list,","),
string.join(sql_data_list,","))
if not sql_where_list:
return
sql = "delete from %s where %s" % (self.__table_name, string.join(sql_where_list," and "))
dlog(DEV_UPDATE,sql)
cursor.execute(sql)
def fetchRowCount (self, col_match_spec = None,
cursor = None, where = None):
n_match_spec = self._fixColMatchSpec(col_match_spec)
sql_where_list = self.__buildWhereClause (n_match_spec,where)
sql = "select count(*) from %s" % self.__table_name
if sql_where_list:
sql = "%s where %s" % (sql,string.join(sql_where_list," and "))
src/s/h/shedskin-HEAD/examples/msp_ss.py shedskin(Download)
self.reqNo = (self.seqNo + 1) % MAX_FRAME_COUNT
txFrame = txFrame + string.join(dataOut,'')
checksum = self.calcChecksum(txFrame, length + 4)
txFrame = txFrame + chr(checksum & 0xff)
txFrame = txFrame + chr((checksum >> 8) & 0xff)
if type == 0x00:
if currentAddr != address:
if segmentdata:
self.segments.append( Segment(startAddr, string.join(segmentdata,'')) )
startAddr = currentAddr = address
segmentdata = []
for i in range(length):
else:
sys.stderr.write("Ignored unknown field (type 0x%02x) in ihex file.\n" % type)
if segmentdata:
self.segments.append( Segment(startAddr, string.join(segmentdata,'')) )
def loadTIText(self, file):
"""load data from a (opened) file in TI-Text format"""
elif l[0] == '@': #if @ => new address => send frame and set new addr.
#create a new segment
if segmentdata:
self.segments.append( Segment(startAddr, string.join(segmentdata,'')) )
startAddr = int(l[1:],16)
segmentdata = []
else:
for i in string.split(l):
segmentdata.append(chr(int(i,16)))
if segmentdata:
self.segments.append( Segment(startAddr, string.join(segmentdata,'')) )
src/c/l/clearversion-HEAD/trunk/clearVersion/etc/subversion/hooks/examples/mailer.py clearversion(Download)
except ImportError:
sys.stderr.write(
"You need version %s or better of the Subversion Python bindings.\n" \
% string.join(map(lambda x: str(x), _MIN_SVN_VERSION), '.'))
sys.exit(1)
if _MIN_SVN_VERSION > [svn.core.SVN_VER_MAJOR,
svn.core.SVN_VER_MINOR,
svn.core.SVN_VER_PATCH]:
sys.stderr.write(
"You need version %s or better of the Subversion Python bindings.\n" \
% string.join(map(lambda x: str(x), _MIN_SVN_VERSION), '.'))
'MIME-Version: 1.0\n' \
'Content-Type: text/plain; charset=UTF-8\n' \
'Content-Transfer-Encoding: 8bit\n' \
% (self.from_addr, string.join(self.to_addrs, ', '), subject)
if self.reply_to:
hdrs = '%sReply-To: %s\n' % (hdrs, self.reply_to)
return hdrs + '\n'
# compose the basic subject line. later, we can prefix it.
dirlist.sort()
dirlist = string.join(dirlist)
if commondir:
self.output.subject = 'r%d - in %s: %s' % (repos.rev, commondir, dirlist)
else:
if i == len(parts) or common[i] != parts[i]:
del common[i:]
break
commondir = string.join(common, '/')
if commondir:
# strip the common portion from each directory
l = len(commondir) + 1
# compose the basic subject line. later, we can prefix it.
dirlist.sort()
dirlist = string.join(dirlist)
if commondir:
self.output.subject = '%s: %s' % (commondir, dirlist)
else:
src/c/l/clearsilver-0.10.1/clearsilver/python/examples/trans/trans.py clearsilver(Download)
fp = open("map", 'w')
for (s, locs) in uniq.items():
locs = map(lambda x: "%s:%s:%d" % x, locs)
fp.write('#: %s\n' % (string.join(locs, ',')))
fp.write('msgid=%s\n\n' % repr(s))
log("Loading strings/locations into database")
break
if n > x:
out.append(data[x:])
odata = string.join(out, '')
open(fname, 'w').write(odata)
if lang == "hdf":
src/c/l/clearversion-HEAD/clearVersion/etc/subversion/hooks/examples/mailer.py clearversion(Download)
except ImportError:
sys.stderr.write(
"You need version %s or better of the Subversion Python bindings.\n" \
% string.join(map(lambda x: str(x), _MIN_SVN_VERSION), '.'))
sys.exit(1)
if _MIN_SVN_VERSION > [svn.core.SVN_VER_MAJOR,
svn.core.SVN_VER_MINOR,
svn.core.SVN_VER_PATCH]:
sys.stderr.write(
"You need version %s or better of the Subversion Python bindings.\n" \
% string.join(map(lambda x: str(x), _MIN_SVN_VERSION), '.'))
'MIME-Version: 1.0\n' \
'Content-Type: text/plain; charset=UTF-8\n' \
'Content-Transfer-Encoding: 8bit\n' \
% (self.from_addr, string.join(self.to_addrs, ', '), subject)
if self.reply_to:
hdrs = '%sReply-To: %s\n' % (hdrs, self.reply_to)
return hdrs + '\n'
# compose the basic subject line. later, we can prefix it.
dirlist.sort()
dirlist = string.join(dirlist)
if commondir:
self.output.subject = 'r%d - in %s: %s' % (repos.rev, commondir, dirlist)
else:
if i == len(parts) or common[i] != parts[i]:
del common[i:]
break
commondir = string.join(common, '/')
if commondir:
# strip the common portion from each directory
l = len(commondir) + 1
# compose the basic subject line. later, we can prefix it.
dirlist.sort()
dirlist = string.join(dirlist)
if commondir:
self.output.subject = '%s: %s' % (commondir, dirlist)
else:
src/e/b/ebmodule-HEAD/examples/test.py ebmodule(Download)
data = string.replace(data, "⇒→", "⇒")
data = string.replace(data, "⇔→", "⇔")
buffer.append(data)
data = string.join(buffer, "")
if packed:
data = string.replace(data, "\n", "") + "\n"
if folded < 0:
i = i + n
if end < j - 1:
buffer.append(data[end:])
return string.join(buffer, "\n") + "\n"
def hook_font(book, appendix, container, code, argv):
gaiji = {
if len(args) == 0:
word = string.strip(sys.stdin.read())
else:
word = string.join(args)
for word in make_candidates(word):
found = 0
eb_search_exactword(book, unicode(word,'utf-8').encode('euc-jp'))
src/e/b/ebmodule-HEAD/examples/chujiten.py ebmodule(Download)
data = string.replace(data, "¢Í¢ª", "¢Í")
data = string.replace(data, "¢Î¢ª", "¢Î")
buffer.append(data)
data = string.join(buffer, "")
if packed:
data = string.replace(data, "\n", "") + "\n"
if folded < 0:
i = i + n
if end < j - 1:
buffer.append(data[end:])
return string.join(buffer, "\n") + "\n"
def hook_font(book, appendix, container, code, argv):
gaiji = {
if len(args) == 0:
word = string.strip(sys.stdin.read())
else:
word = string.join(args)
for word in make_candidates(word):
found = 0
eb_search_exactword(book, word)
src/g/a/gaius-framework-HEAD/Agents/trunk/Amadeus/samples/P_Supervisor/manipulatives/Glue.py gaius-framework(Download)
primitive_location = '' primitive_location = os.path.dirname(os.path.abspath(__file__)) primitive_location = string.join(string.split(primitive_location, os.path.sep)[:-1], os.path.sep) ## start the manipulative manipulative = Input(primitive_location)
src/g/a/gaius-framework-HEAD/Agents/trunk/Amadeus/samples/P_Supervisor/manipulatives/Feedback.py gaius-framework(Download)
primitive_location = '' primitive_location = os.path.dirname(os.path.abspath(__file__)) primitive_location = string.join(string.split(primitive_location, os.path.sep)[:-1], os.path.sep) ## start the manipulative manipulative = Output(primitive_location)
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 Next