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

All Samples(12321)  |  Call(12231)  |  Derive(0)  |  Import(90)
unlink(path)

Remove a file (same as remove(path)).

src/p/i/pity-HEAD/examples/pity-pdf.py   pity(Download)
import sys
import pity
from tempfile import mkstemp
from os import listdir, unlink, path, fdopen
from lxml import etree
import subprocess
 
		# some other working SVG -> PDF renderer, use it here
		subprocess.check_call(["rsvg-convert", "-f", "svg", "-o", temp_svg2, temp_svg])
		subprocess.check_call(["rsvg-convert", "-f", "pdf", "-o", temp_pdf, temp_svg2])
		unlink(temp_svg)
		unlink(temp_svg2)
	# use pdfjoin from pdfjam package; '-' is not handled correctly as output, so you should 
	# write output to another tempfile an then cat it to stdout
	#subprocess.check_call(["pdfjoin", "--outfile", sys.argv[3]] + temps)
	# or use pdftk from pdftk package; it's slightly faster and '-' handling is ok
	subprocess.check_call(["pdftk",] + temps + [ "cat", "output", sys.argv[3]])
 
	for t in temps:
		unlink(t)

src/g/a/gajim-HEAD/setup_osx.py   gajim(Download)
 
from setuptools import setup
import sys, glob, os, commands, types
from os import system, unlink, symlink, getcwd, mkdir, utime
from shutil import move, copy, copytree, rmtree
 
###
def stageInstall():
	check(system("make DATADIR=%s/build/inst LIBDIR=%s/build/inst prefix=%s/build/inst DOCDIR=%s/build/inst/share/doc install" % (PWD, PWD, PWD, PWD)))
	force(lambda:unlink("src/osx/growl/_growl.so"))
	force(lambda:unlink("src/osx/growl/_growlImage.so"))
	force(lambda:unlink("src/osx/idle.so"))
	force(lambda:unlink("src/osx/nsapp.so"))
	force(lambda:unlink("src/osx/syncmenu.so"))
	force(lambda:unlink("src/gtkspell.so"))
			new.write("    import prep_py2app\n")
	new.close()
	org.close()
	unlink("dist/Gajim.app/Contents/Resources/__boot__.py.org")
	return
 
 
def finishApp():
	# setup gajim dirs
	copytree("build/inst/share/gajim/data", APP_RS + "/data")
	copy("data/pixmaps/gajim.icns", APP_RS + "/data/pixmaps")
	copytree("build/inst/share/locale", APP_RS + "/locale")
	copytree("build/inst/share/man", APP_RS + "/man")
	force(lambda:unlink("dist/Gajim.app/Contents/data"))

src/j/a/jah-HEAD/trunk/lib/jah/store/storage_server.py   jah(Download)
from jah.store.utils import int4_to_str, str_to_int4, str_to_int8, read, write
from jah.store.utils import read_int4, read_int4_str, write_int4_str
from grp import getgrnam, getgrgid
from os import unlink, stat, chown, geteuid, getegid, umask, getpid
from os.path import exists
from pwd import getpwnam, getpwuid
from time import sleep
                if connected:
                    connected.close()
                    raise
                unlink(self.filename)
                s.bind(self.filename)
            else:
                raise
    def close(self, s):
        s.close()
        if exists(self.filename):
            unlink(self.filename)
 
 
class StorageServer (object):

src/j/a/jah-HEAD/lib/jah/store/storage_server.py   jah(Download)
from jah.store.utils import int4_to_str, str_to_int4, str_to_int8, read, write
from jah.store.utils import read_int4, read_int4_str, write_int4_str
from grp import getgrnam, getgrgid
from os import unlink, stat, chown, geteuid, getegid, umask, getpid
from os.path import exists
from pwd import getpwnam, getpwuid
from time import sleep
                if connected:
                    connected.close()
                    raise
                unlink(self.filename)
                s.bind(self.filename)
            else:
                raise
    def close(self, s):
        s.close()
        if exists(self.filename):
            unlink(self.filename)
 
 
class StorageServer (object):

src/e/u/eurasia-HEAD/Eurasia/daemon.py   eurasia(Download)
	SimpleXMLRPCRequestHandler, SimpleXMLRPCServer
from xmlrpclib import Fault, Transport, dumps as xmlrpc_dumps, \
	_Method as _XMLRPCMethod, ServerProxy as ServerProxy_N___G
from os import execv, chdir, chmod, dup2, fork, geteuid, getpid, \
	kill, setgid, setuid, umask, unlink, waitpid, \
	error as OSError, WNOHANG
 
 
		if isinstance(address, str):
			try:
				unlink(address)
			except OSError:
				pass
 
	def stop(self):
		if not self.pid:
			self.running = False
			if hasattr(self, 'pidfile'):
				try:
					unlink(self.pidfile)
				except OSError:
		self.running = False
		if hasattr(self, 'pidfile'):
			try:
				unlink(self.pidfile)
			except OSError:
				pass
 

src/d/i/distribute-0.6.14/pkg_resources.py   distribute(Download)
# capture these to bypass sandboxing
from os import utime
try:
    from os import mkdir, rename, unlink
    WRITE_SUPPORT = True
except ImportError:
    # no write support, probably under GAE
                        # us, so we're done
                        return real_path
                    elif os.name=='nt':     # Windows, del old file and retry
                        unlink(real_path)
                        rename(tmpnam, real_path)
                        return real_path
                raise

src/e/d/Editra-0.5.72/src/extern/pkg_resources.py   Editra(Download)
except NameError:
    from sets import ImmutableSet
 
from os import utime, rename, unlink    # capture these to bypass sandboxing
from os import open as os_open
 
def get_supported_platform():
                        # us, so we're done
                        return real_path
                    elif os.name=='nt':     # Windows, del old file and retry
                        unlink(real_path)
                        rename(tmpnam, real_path)
                        return real_path
                raise

src/c/o/codepy-0.91/codepy/jit.py   codepy(Download)
def _erase_dir(dir):
    from os import listdir, unlink, rmdir
    from os.path import join
    for name in listdir(dir):
        unlink(join(dir, name))
    rmdir(dir)
 
    def clean_up(self):
        import os
        os.close(self.fd)
        os.unlink(self.lock_file)
 
    def error_clean_up(self):
        pass

src/m/e/merlin-1-1.0/merlin/__init__.py   merlin(Download)
 
import sys, os, zipimport, time, re, imp, new
from sets import ImmutableSet
from os import utime, rename, unlink    # capture these to bypass sandboxing
from os import open as os_open
 
def get_supported_platform():
                        # us, so we're done
                        return real_path
                    elif os.name=='nt':     # Windows, del old file and retry
                        unlink(real_path)
                        rename(tmpnam, real_path)
                        return real_path
                raise

src/m/o/morphix-HEAD/trunk/ibuild/src/intellibuild/clientlib/accessors/fs.py   morphix(Download)
# from stat import *
from os import lstat
from os import removedirs
from os import unlink
from os import makedirs
 
import exceptions
          if os.path.isdir(file_name) and not os.path.islink(file_name):
            os.removedirs(file_name)
          else:
            os.unlink(file_name)
          if self.path.exists(file_name):
            self.log.warn("Object not removed: " + file_name)
            if fail:

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