Coder Social home page Coder Social logo

ssdb-py's People

Contributors

wrongwaycn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ssdb-py's Issues

ttl方法出错

使用ttl方法是报错:

  File "C:\Python27\lib\site-packages\ssdb\client.py", line 398, in ttl
    if isinstance(time, datetime.timedelta):
UnboundLocalError: local variable 'time' referenced before assignment
def ttl(self, name):
        """
        Returns the number of seconds until the key ``name`` will expire.

        Like **Redis.TTL**

        .. note:: ``ttl`` **can only** be used to the `Key/Value`_ .
           
        :param string name: the key name
        :return: the number of seconds, or ``-1`` if the key doesn't
         exist or have no ttl
        :rtype: int

        >>> ssdb.ttl('set_abc')
        6
        >>> ssdb.ttl('not_exist')
        -1
        """
        if isinstance(time, datetime.timedelta):
            time = time.seconds + time.days * 24 * 3600        
        return self.execute_command('expire', name, ttl)

函数里面用了一个名为time的对象,但是没有初始化

hset 对某个 key进行 修改value操作

你好,ssdbcli 是可以进行 hset的key 更新 value的操作。

ssdb.hset("hash_3", 'yellow', '#FFFF00')
True
ssdb.hset("hash_3", 'yellow', '#FFFF00')
True

但是在python 客户端中无法进行修改哦。

ssdb.hset("hash_3", 'yellow', '#FFFF00')
True
ssdb.hset("hash_3", 'yellow', '#FFFF00')
False

另外,ssdb 支持Queue OPERATION 了。这个也可以增加支持吗? 谢谢!

一个zset 返回错误

对相同的name key 设置返回False,但实际已经设置成功

>>> db.zincr('test', 'a', 1)
3
>>> db.zincr('test', 'a', 1)
4
>>> db.zset('test', 'a', 6)
False
>>> db.zdel('test', 'a')
True
>>> db.zset('test', 'a', 6)
True
>>> db.zset('test', 'a', 9)
False
>>> db.zincr('test', 'a', 1)
10
>>> db.zset('test', 'a', 99)
False
>>> db.zget('test', 'a')
99
>>> 

centos 6.5 安装时遇到语法错误

File "setup.py", line 5, in
from ssdb import version
File "/ssdb-py/ssdb/init.py", line 2, in
from ssdb.client import StrictSSDB, SSDB
File "
/ssdb-py/ssdb/client.py", line 74
return {k:int(v) for k,v in list_to_dict(lst).items()}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.