import urlparse
from limits.storage import Storage
from redislite import Redis
import time

class LimitsRedisLite(Storage): # For Python Limits
    STORAGE_SCHEME = "redislite"
    def __init__(self, uri, **options):
        self.redis_instance = Redis(urlparse.urlparse(uri).netloc)

    def check(self):
        return True

    def get_expiry(self, key):
        return self.redis_instance.ttl(key)

    def incr(self, key, expiry, elastic_expiry=False):
        if not self.redis_instance.exists(key):
            self.redis_instance.set(key, 1)
            self.redis_instance.expireat(key, int(time.time() + expiry))
        else:
            oldexp = self.get_expiry(key)
            self.redis_instance.set(key, int(self.redis_instance.get(key))+1)
            self.redis_instance.expireat(key, int(time.time() + oldexp))
        return

    def get(self, key):
        return int(self.redis_instance.get(key))

    def reset(self):
        return self.redis_instance.flushdb()

@@ -394,16 +394,21 @@
 ttl(key)
+ or 0
 %0A%0A    de
@@ -550,82 +550,20 @@
 y, 1
-)%0A            self.redis_instance.expireat(key, int(time.time() + 
+, ex=
 expiry)
-)
 %0A   
@@ -695,82 +695,20 @@
 ))+1
-)%0A            self.redis_instance.expireat(key, int(time.time() + 
+, ex=
 oldexp)
-)
 %0A   

Fix custom redislite to account for the none errors