Did I find the right examples for you? yes no

All Samples(56)  |  Call(0)  |  Derive(0)  |  Import(56)
int(x=0) -> int or long
int(x, base=10) -> int or long

Convert a number or string to an integer, or return 0 if no arguments
are given.  If x is floating point, the conversion truncates towards zero.
If x is outside the integer range, the function returns a long instead.

If x is not a number or if base is given, then x must be a string or
Unicode object representing an integer literal in the given base.  The
literal can be preceded by '+' or '-' and be surrounded by whitespace.(more...)

src/l/l/llfuse-0.40/examples/tmpfs.py   llfuse(Download)
        self.cursor.execute("INSERT INTO inodes (id,mode,uid,gid,mtime,atime,ctime) "
                            "VALUES (?,?,?,?,?,?,?)",
                            (llfuse.ROOT_INODE, stat.S_IFDIR | stat.S_IRUSR | stat.S_IWUSR
                              | stat.S_IXUSR | stat.S_IRGRP | stat.S_IXGRP | stat.S_IROTH 
                              | stat.S_IXOTH, os.getuid(), os.getgid(), time(), 

src/f/u/fusepy-HEAD/examples/memoryll.py   fusepy(Download)
#!/usr/bin/env python
 
from collections import defaultdict
from errno import ENOENT, EROFS
from stat import S_IFMT, S_IMODE, S_IFDIR, S_IFREG
        self.children = defaultdict(dict)
 
        self.attr[1] = {'st_ino': 1, 'st_mode': S_IFDIR | 0777, 'st_nlink': 2}
        self.parent[1] = 1
 
        attr = {
            'st_ino': ino,
            'st_mode': S_IFDIR | mode,
            'st_nlink': 2,
            'st_uid': ctx['uid'],
    def readdir(self, req, ino, size, off, fi):
        print 'readdir:', ino
        parent = self.parent[ino]
        entries = [('.', {'st_ino': ino, 'st_mode': S_IFDIR}),
            ('..', {'st_ino': parent, 'st_mode': S_IFDIR})]

src/f/u/fusepy-HEAD/examples/memory.py   fusepy(Download)
from collections import defaultdict
from errno import ENOENT
from stat import S_IFDIR, S_IFLNK, S_IFREG
from sys import argv, exit
from time import time
        self.fd = 0
        now = time()
        self.files['/'] = dict(st_mode=(S_IFDIR | 0755), st_ctime=now,
                               st_mtime=now, st_atime=now, st_nlink=2)
 
    def mkdir(self, path, mode):
        self.files[path] = dict(st_mode=(S_IFDIR | mode), st_nlink=2,
                                st_size=0, st_ctime=time(), st_mtime=time(),
                                st_atime=time())
 

src/f/u/fusepy-HEAD/examples/context.py   fusepy(Download)
#!/usr/bin/env python
 
from errno import ENOENT
from stat import S_IFDIR, S_IFREG
from sys import argv, exit
    def getattr(self, path, fh=None):
        uid, gid, pid = fuse_get_context()
        if path == '/':
            st = dict(st_mode=(S_IFDIR | 0755), st_nlink=2)
        elif path == '/uid':

src/c/b/cbdfs-HEAD/fuse-python-cvs/example/hello.py   cbdfs(Download)
    def getattr(self, path):
        st = MyStat()
        if path == '/':
            st.st_mode = stat.S_IFDIR | 0755
            st.st_nlink = 2

src/f/u/fuse-python-0.2/example/hello.py   fuse-python(Download)
    def getattr(self, path):
        st = MyStat()
        if path == '/':
            st.st_mode = stat.S_IFDIR | 0755
            st.st_nlink = 2

src/g/d/GDAL-1.10.0/samples/ogr2ogr.py   GDAL(Download)
                try:
                    mode = os.stat(pszDestDataSource).st_mode
                    if (mode & stat.S_IFDIR) == 0:
                        pszNewLayerName = os.path.splitext(os.path.basename(pszDestDataSource))[0]
                except:
            try:
                mode = os.stat(pszDestDataSource).st_mode
                if (mode & stat.S_IFDIR) == 0:
                    pszNewLayerName = os.path.splitext(os.path.basename(pszDestDataSource))[0]
            except:
                try:
                    mode = os.stat(pszDestDataSource).st_mode
                    if (mode & stat.S_IFDIR) == 0:
                        pszNewLayerName = os.path.splitext(os.path.basename(pszDestDataSource))[0]
                except:

src/l/i/lib-pyFreenet-staging-HEAD/fcp/freenetfs.py   lib-pyFreenet-staging(Download)
        mode = kw.get('mode', 0)
        if kw.get('isdir', False):
            mode |= stat.S_IFDIR
        if kw.get('ischr', False):
            mode |= stat.S_IFCHR
        mode = kw.pop('mode', 0)
        if kw.pop('isdir', False):
            mode |= stat.S_IFDIR
        if kw.pop('ischr', False):
            mode |= stat.S_IFCHR
        if attr == 'isdir':
            if val:
                self[stat.ST_MODE] |= stat.S_IFDIR
            else:
                self[stat.ST_MODE] &= ~stat.S_IFDIR

src/m/e/mercurial-2.9.1/mercurial/pure/osutil.py   Mercurial(Download)
def _mode_to_kind(mode):
    if statmod.S_ISREG(mode):
        return statmod.S_IFREG
    if statmod.S_ISDIR(mode):
        return statmod.S_IFDIR

src/h/g/hg-HEAD/mercurial/pure/osutil.py   hg(Download)
def _mode_to_kind(mode):
    if statmod.S_ISREG(mode):
        return statmod.S_IFREG
    if statmod.S_ISDIR(mode):
        return statmod.S_IFDIR

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