All Samples(578) | Call(572) | Derive(0) | Import(6)
zfill(x, width) -> string Pad a numeric string x with zeros on the left, to fill a field of the specified width. The string x is never truncated.
def zfill(x, width):
"""zfill(x, width) -> string
Pad a numeric string x with zeros on the left, to fill a field
of the specified width. The string x is never truncated.
"""
if not isinstance(x, basestring):
x = repr(x)
return x.zfill(width)
from time import time, strftime, localtime from types import StringType, ClassType, InstanceType, FileType, TupleType from string import zfill, atoi, lower, upper, join, replace, split, strip from re import sub from ConfigParser import ConfigParser, NoOptionError from os import stat, rename
timedifflaststep = "%.3f" % (currenttime - self.__Logger_timelaststep)
self.__Logger_timelaststep = currenttime
milliseconds = int(round((currenttime - long(currenttime)) * 1000))
timeformat = sub("%S", "%S." + (zfill(milliseconds, 3)), self.__Logger_timeformat)
currentformattedtime = strftime(timeformat, localtime(currenttime))
line = self.__Logger_formatstring
src/g/i/gimini-HEAD/new_stuff/gimini2/src/log4py.py gimini(Download)
from time import time, strftime, localtime from types import StringType, ClassType, InstanceType, FileType, TupleType from string import zfill, atoi, lower, upper, join, replace, split, strip from re import sub from ConfigParser import ConfigParser, NoOptionError from os import stat, rename
timedifflaststep = "%.3f" % (currenttime - self.__Logger_timelaststep)
self.__Logger_timelaststep = currenttime
milliseconds = int(round((currenttime - long(currenttime)) * 1000))
timeformat = sub("%S", "%S." + (zfill(milliseconds, 3)), self.__Logger_timeformat)
currentformattedtime = strftime(timeformat, localtime(currenttime))
line = self.__Logger_formatstring
src/s/n/snavtofamix-HEAD/src/log4py.py snavtofamix(Download)
from time import time, strftime, localtime from types import StringType, ClassType, InstanceType, FileType, TupleType from string import zfill, atoi, lower, upper, join, replace, split, strip from re import sub from ConfigParser import ConfigParser, NoOptionError from os import stat, rename
timedifflaststep = "%.3f" % (currenttime - self.__Logger_timelaststep)
self.__Logger_timelaststep = currenttime
milliseconds = int(round((currenttime - long(currenttime)) * 1000))
timeformat = sub("%S", "%S." + (zfill(milliseconds, 3)), self.__Logger_timeformat)
currentformattedtime = strftime(timeformat, localtime(currenttime))
line = self.__Logger_formatstring
src/p/r/Products.OAICore-2.3/Products/OAICore/fakeserver.py Products.OAICore(Download)
from oaipmh import server
import os.path
from urllib import urlencode
from string import zfill
class FakeServerProxy(server.XMLTreeServer):
def __init__(self, mapping_path):
for request, response in self._mapping.items():
f.write(request)
f.write('\n')
filename = zfill(str(i), 5) + '.xml'
f.write(filename)
f.write('\n')
response_f = open(os.path.join(mapping_path, filename), 'w')
src/p/y/pyoai-HEAD/src/oaipmh/tests/fakeclient.py pyoai(Download)
from oaipmh import client, common import os.path from datetime import datetime from urllib import urlencode from string import zfill class FakeClient(client.BaseClient):
for request, response in self._mapping.items():
f.write(request)
f.write('\n')
filename = zfill(str(i), 5) + '.xml'
f.write(filename)
f.write('\n')
response_f = open(os.path.join(mapping_path, filename), 'w')
src/p/y/pyoai-2.4.4/src/oaipmh/tests/fakeclient.py pyoai(Download)
from oaipmh import client, common import os.path from datetime import datetime from urllib import urlencode from string import zfill class FakeClient(client.BaseClient):
for request, response in self._mapping.items():
f.write(request)
f.write('\n')
filename = zfill(str(i), 5) + '.xml'
f.write(filename)
f.write('\n')
response_f = open(os.path.join(mapping_path, filename), 'w')