Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(98)  |  Call(89)  |  Derive(0)  |  Import(9)

            def unlock(file):
        fcntl.flock(file.fileno(), fcntl.LOCK_UN)
        


src/f/l/flask-example-HEAD/dal.py   flask-example(Download)
        if fileobj:
            if have_portalocker and unlock:
                portalocker.unlock(fileobj)
            fileobj.close()
 

src/s/o/sonospy-HEAD/web2py/gluon/sql.py   sonospy(Download)
                portalocker.lock(tfile, portalocker.LOCK_EX)
                cPickle.dump(sql_fields, tfile)
                portalocker.unlock(tfile)
                tfile.close()
            if self._dbt:
            portalocker.lock(tfile, portalocker.LOCK_SH)
            sql_fields_old = cPickle.load(tfile)
            portalocker.unlock(tfile)
            tfile.close()
            if sql_fields != sql_fields_old:
        portalocker.lock(tfile, portalocker.LOCK_EX)
        cPickle.dump(sql_fields_old, tfile)
        portalocker.unlock(tfile)
        tfile.close()
 
                portalocker.lock(tfile, portalocker.LOCK_EX)
                cPickle.dump(sql_fields, tfile)
                portalocker.unlock(tfile)
                tfile.close()
            if self._dbt:
            portalocker.lock(tfile, portalocker.LOCK_SH)
            sql_fields_old = cPickle.load(tfile)
            portalocker.unlock(tfile)
            tfile.close()
            if sql_fields != sql_fields_old:

src/s/o/sonospy-HEAD/web2py/gluon/dal.py   sonospy(Download)
        portalocker.lock(self.file,portalocker.LOCK_EX)
        ret = self.file.write(data)
        portalocker.unlock(self.file)
        return ret
 
                portalocker.lock(tfile, portalocker.LOCK_EX)
                cPickle.dump(sql_fields, tfile)
                portalocker.unlock(tfile)
                tfile.close()
            if self._dbt:
            portalocker.lock(tfile, portalocker.LOCK_SH)
            sql_fields_old = cPickle.load(tfile)
            portalocker.unlock(tfile)
            tfile.close()
            if sql_fields != sql_fields_old:
        portalocker.lock(tfile, portalocker.LOCK_EX)
        cPickle.dump(sql_fields_old, tfile)
        portalocker.unlock(tfile)
        tfile.close()
 

src/s/o/sonospy-HEAD/web2py/gluon/cache.py   sonospy(Download)
            logging.error('corrupted file: %s' % self.shelve_name)
        if locker_locked:
            portalocker.unlock(locker)
        if locker:
            locker.close()
            }
        storage.sync()
        portalocker.unlock(locker)
        locker.close()
 
        storage.sync()
 
        portalocker.unlock(locker)
        locker.close()
 
        storage.sync()
 
        portalocker.unlock(locker)
        locker.close()
 
            storage.sync()
        except BaseException, e:
            portalocker.unlock(locker)
            locker.close()
            raise e

src/s/o/sonospy-HEAD/web2py/gluon/languages.py   sonospy(Download)
def read_dict(filename):
    fp = open(filename, 'r')
    portalocker.lock(fp, portalocker.LOCK_SH)
    lang_text = fp.read().replace('\r\n', '\n')
    portalocker.unlock(fp)
        fp.write('%s: %s,\n' % (repr(key), repr(contents[key])))
    fp.write('}\n')
    portalocker.unlock(fp)
    fp.close()
 
        portalocker.lock(fp, portalocker.LOCK_SH)
        data = fp.read()
        portalocker.unlock(fp)
        fp.close()
        items = regex_translate.findall(data)

src/w/e/web2cms-HEAD/web2py/gluon/cache.py   web2cms(Download)
                    logger.warn('unable to delete file %s' % self.shelve_name)
            if locker_locked:
                portalocker.unlock(locker)
            if locker:
                locker.close()
        finally:
            storage.close()
        portalocker.unlock(locker)
        locker.close()
 
        storage.sync()
 
        portalocker.unlock(locker)
        locker.close()
 
 
        storage.close()
        portalocker.unlock(locker)
        locker.close()
 
        finally:
            storage.close()
            portalocker.unlock(locker)
            locker.close()
        return value

src/m/o/MobileBlur-HEAD/gluon/cache.py   MobileBlur(Download)
                    logger.warn('unable to delete file %s' % self.shelve_name)
            if locker_locked:
                portalocker.unlock(locker)
            if locker:
                locker.close()
        finally:
            storage.close()
        portalocker.unlock(locker)
        locker.close()
 
        storage.sync()
 
        portalocker.unlock(locker)
        locker.close()
 
 
        storage.close()
        portalocker.unlock(locker)
        locker.close()
 
        finally:
            storage.close()
            portalocker.unlock(locker)
            locker.close()
        return value

src/s/o/sonospy-HEAD/web2py/gluon/storage.py   sonospy(Download)
def load_storage(filename):
    fp = open(filename, 'rb')
    portalocker.lock(fp, portalocker.LOCK_EX)
    storage = cPickle.load(fp)
    portalocker.unlock(fp)
def save_storage(storage, filename):
    fp = open(filename, 'wb')
    portalocker.lock(fp, portalocker.LOCK_EX)
    cPickle.dump(dict(storage), fp)
    portalocker.unlock(fp)

src/w/e/web2cms-HEAD/web2py/gluon/newcron.py   web2cms(Download)
                cPickle.dump((self.now,0),self.master)
        finally:
            portalocker.unlock(self.master)
        if not ret:
            # do this so no need to release
                self.master.seek(0)
                cPickle.dump((self.now,time.time()),self.master)
            portalocker.unlock(self.master)
            self.master.close()
 

src/w/e/web2cms-HEAD/web2py/gluon/storage.py   web2cms(Download)
        portalocker.lock(fp, portalocker.LOCK_EX)
        storage = cPickle.load(fp)
        portalocker.unlock(fp)
    finally:
        fp.close()
        portalocker.lock(fp, portalocker.LOCK_EX)
        cPickle.dump(dict(storage), fp)
        portalocker.unlock(fp)
    finally:
        fp.close()

  1 | 2 | 3 | 4 | 5  Next