• Facebook
  • Twitter
  • Reddit
  • StumbleUpon
  • Digg
  • email

All Samples(1661)  |  Call(1494)  |  Derive(0)  |  Import(167)
Accessor for tempfile.tempdir.

        def gettempdir():
    """Accessor for tempfile.tempdir."""
    global tempdir
    if tempdir is None:
        _once_lock.acquire()
        try:
            if tempdir is None:
                tempdir = _get_default_tempdir()
        finally:
            _once_lock.release()
    return tempdir
        


src/p/y/pyfusion-HEAD/examples/test_savez.py   pyfusion(Download)
# now see how fast it is for a little one
small=arange(10)
st=time()
from tempfile import gettempdir, gettempprefix, mkstemp
 
#tmp=gettempdir()+gettempprefix()
tmpfd=mkstemp(suffix='.npz')

src/w/s/WsgiDAV-0.4.0b2/wsgidav/server/server_sample.py   WsgiDAV(Download)
# (c) 2009 Martin Wendt and contributors; see WsgiDAV http://wsgidav.googlecode.com/
# Author of original PyFileServer: Ho Chun Wei, fuzzybr80(at)gmail.com
# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
"""
Simple example how to a run WsgiDAV in a 3rd-party WSGI server.
"""
from tempfile import gettempdir
__docformat__ = "reStructuredText"
 
 
rootpath = gettempdir()
provider = FilesystemProvider(rootpath)
 
config = DEFAULT_CONFIG.copy()

src/p/r/prdg.util-0.0.7/prdg/util/file.py   prdg.util(Download)
from tempfile import gettempdir, gettempprefix
from datetime import datetime
from os.path import join, splitext, dirname
from os import remove, access, F_OK, chdir
 
def exists(path):
    return access(path, F_OK)
 
def get_temp_filename():
    return join(gettempdir(), gettempprefix() + str(datetime.now().microsecond)) 

src/g/a/gajim-HEAD/src/features_window.py   gajim(Download)
from common import helpers
 
import random
from tempfile import gettempdir
from subprocess import Popen
 
class FeaturesWindow:
	def latex_available(self):
		'''check is latex is available and if it can create a picture.'''
 
		exitcode = 0
		random.seed()
		tmpfile = os.path.join(gettempdir(), "gajimtex_" + \
			random.randint(0,100).__str__())
		file.close()
		try:
			p = Popen(['latex', '--interaction=nonstopmode', tmpfile + '.tex'],
				cwd=gettempdir())
			exitcode = p.wait()
		except Exception:
			exitcode = 1
		if exitcode == 0:
			try:
				p = Popen(['dvipng', '-bg', 'white', '-T', 'tight',
					tmpfile + '.dvi', '-o', tmpfile + '.png'], cwd=gettempdir())

src/g/a/gajim-HEAD/src/conversation_textview.py   gajim(Download)
##
 
import random
from tempfile import gettempdir
from subprocess import Popen
from threading import Timer # for smooth scrolling
 
 
		if exitcode == 0:
			random.seed()
			tmpfile = os.path.join(gettempdir(), 'gajimtex_' + random.randint(0,
				100).__str__())
 
			# build latex string
			file.close()
 
			p = Popen(['latex', '--interaction=nonstopmode', tmpfile + '.tex'],
				cwd=gettempdir())
			exitcode = p.wait()
 
		if exitcode == 0:
			latex_png_dpi = gajim.config.get('latex_png_dpi')
			p = Popen(['dvipng', '-bg', 'white', '-T', 'tight', '-D',
				latex_png_dpi, tmpfile + '.dvi', '-o', tmpfile + '.png'],
				cwd=gettempdir())

src/m/a/mapfish-2.0/mapfish/controllers/printer.py   mapfish(Download)
from os import unlink, listdir, sep, stat
import time
from subprocess import Popen, PIPE
from tempfile import NamedTemporaryFile, gettempdir
import re
import simplejson
import urlparse
    def get(self, id):
        """
        To get the PDF created previously.
        """
        name = gettempdir() + sep + self.TEMP_FILE_PREFIX + id + self.TEMP_FILE_SUFFIX
        headers = {
            'Content-Length' : getsize(name),
    def _purgeOldFiles(self):
        """
        Delete temp files that are more than TEMP_FILE_PURGE_SECONDS seconds old
        """
        files=listdir(gettempdir())
        for file in files:
            if file.startswith(self.TEMP_FILE_PREFIX) and file.endswith(self.TEMP_FILE_SUFFIX):
                fullname = gettempdir() + sep + file

src/g/v/gve-HEAD/trunk/gvehtml/templateEngine/Template.py   gve(Download)
import os.path                    # used in Template.normalizePath()
from os.path import getmtime, exists
from random import randrange
from tempfile import gettempdir, mktemp
import imp
import traceback
 
        if self._filePath:
            moduleDir = self._fileDirName
        else:
            moduleDir = gettempdir()
 
        packageName = self._makeDummyPackageForDir(moduleDir)
        mod = self._impModFromDummyPackage(packageName, tmpFilename)            

src/p/y/python-cuda-HEAD/cuda/sugar/kernel/compiler.py   python-cuda(Download)
                return os.getenv('USERNAME')
            os.getuid = getuid
 
        from tempfile import gettempdir
        cache_dir = join(gettempdir(), 
                "python-cuda-compiler-cache-v1-uid%s" % os.getuid())
 

src/z/a/zamboni-lib-HEAD/lib/python/suds/cache.py   zamboni-lib(Download)
"""
 
import os
from tempfile import gettempdir as tmp
from suds.transport import *
from datetime import datetime as dt
from datetime import timedelta
        @type duration: {unit:value}
        """
        if location is None:
            location = os.path.join(tmp(), 'suds')
        self.location = location
        self.duration = (None, 0)
        self.setduration(**duration)

src/g/v/gve-HEAD/gvehtml/templateEngine/Template.py   gve(Download)
import os.path                    # used in Template.normalizePath()
from os.path import getmtime, exists
from random import randrange
from tempfile import gettempdir, mktemp
import imp
import traceback
 
        if self._filePath:
            moduleDir = self._fileDirName
        else:
            moduleDir = gettempdir()
 
        packageName = self._makeDummyPackageForDir(moduleDir)
        mod = self._impModFromDummyPackage(packageName, tmpFilename)            

  1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9  Next