def setUp(self): from time import time from reportlab.lib.utils import get_rl_tempdir self._tempdir = get_rl_tempdir('reportlab_test','tmp_%d' % time()) _testmodulename = os.path.join(self._tempdir,'test_module_%d.py' % time()) f = open(_testmodulename,'w') f.write('__all__=[]\n') f.close() self._testmodulename = os.path.splitext(os.path.basename(_testmodulename))[0]
def setUp(self): from time import time from reportlab.lib.utils import get_rl_tempdir self._tempdir = get_rl_tempdir("reportlab_test", "tmp_%d" % time()) _testmodulename = os.path.join(self._tempdir, "test_module_%d.py" % time()) f = open(_testmodulename, "w") f.write("__all__=[]\n") f.close() self._testmodulename = os.path.splitext(os.path.basename(_testmodulename))[0]
def setUp(self): from time import time from reportlab.lib.utils import get_rl_tempdir s = repr(int(time())) + repr(self.count) self.__class__.count += 1 self._tempdir = get_rl_tempdir('reportlab_test','tmp_%s' % s) _testmodulename = os.path.join(self._tempdir,'test_module_%s.py' % s) f = open(_testmodulename,'w') f.write('__all__=[]\n') f.close() self._testmodulename = os.path.splitext(os.path.basename(_testmodulename))[0]
def setUp(self): from time import time from reportlab.lib.utils import get_rl_tempdir s = repr(int(time())) + repr(self.count) self.__class__.count += 1 self._tempdir = get_rl_tempdir('reportlab_test', 'tmp_%s' % s) _testmodulename = os.path.join(self._tempdir, 'test_module_%s.py' % s) f = open(_testmodulename, 'w') f.write('__all__=[]\n') f.close() self._testmodulename = os.path.splitext( os.path.basename(_testmodulename))[0]
def outputfile(fn): """This works out where to write test output. If running code in a zip file or a locked down file system, this will be a temp directory; otherwise, the output of 'test_foo.py' will normally be a file called 'test_foo.pdf', next door. """ if canWriteTestOutputHere(): D = _OUTDIR else: from reportlab.lib.utils import isSourceDistro, get_rl_tempdir D = get_rl_tempdir('wordaxe_test') if fn: D = os.path.join(D, fn) return D
def setUpClass(cls): from reportlab.lib.utils import get_rl_tempdir cls._value = float(repr(time.time())) s = int(cls._value) cls._tempdir = get_rl_tempdir('reportlab_test','tmp_%s' % s) if not os.path.isdir(cls._tempdir): os.makedirs(cls._tempdir,0o700) _testmodulename = os.path.join(cls._tempdir,'test_module_%s.py' % s) with open(_testmodulename,'w') as f: f.write('__all__=[]\nvalue=%s\n' % repr(cls._value)) if sys.platform=='darwin' and isPy3: time.sleep(0.3) cls._testmodulename = os.path.splitext(os.path.basename(_testmodulename))[0]
def setUp(self): from reportlab.lib.utils import get_rl_tempdir s = repr(int(time.time())) + repr(self.count) self.__class__.count += 1 self._tempdir = get_rl_tempdir('reportlab_test','tmp_%s' % s) if not os.path.isdir(self._tempdir): os.makedirs(self._tempdir,0o700) _testmodulename = os.path.join(self._tempdir,'test_module_%s.py' % s) f = open(_testmodulename,'w') f.write('__all__=[]\n') f.close() if sys.platform=='darwin' and isPy3: time.sleep(0.3) self._testmodulename = os.path.splitext(os.path.basename(_testmodulename))[0]
def __init__(self, name, useCache=1): self.name = name self._mapFileHash = None self._codeSpaceRanges = [] self._notDefRanges = [] self._cmap = {} self.source = None if useCache: from reportlab.lib.utils import get_rl_tempdir fontmapdir = get_rl_tempdir('FastCMAPS') if os.path.isfile(fontmapdir + os.sep + name + '.fastmap'): self.fastLoad(fontmapdir) self.source = fontmapdir + os.sep + name + '.fastmap' else: self.parseCMAPFile(name) self.source = 'CMAP: ' + name self.fastSave(fontmapdir) else: self.parseCMAPFile(name)
def __init__(self, name, useCache=1): self.name = name self._mapFileHash = None self._codeSpaceRanges = [] self._notDefRanges = [] self._cmap = {} self.source = None if not DISABLE_CMAP: if useCache: from reportlab.lib.utils import get_rl_tempdir fontmapdir = get_rl_tempdir('FastCMAPS') if os.path.isfile(fontmapdir + os.sep + name + '.fastmap'): self.fastLoad(fontmapdir) self.source = fontmapdir + os.sep + name + '.fastmap' else: self.parseCMAPFile(name) self.source = 'CMAP: ' + name self.fastSave(fontmapdir) else: self.parseCMAPFile(name)
def outputfile(fn): from reportlab.lib.utils import get_rl_tempdir D = get_rl_tempdir('reportlab_test') if fn: D = os.path.join(D,fn) return D
def stagingArea(suffix=''): from reportlab.lib.utils import get_rl_tempdir return get_rl_tempdir('SA_'+suffix)