Jesper Nøhr committed e22fd55

using sdiff instead now

Comments (0)

Files changed (1)


         self.conn = redis.Redis(host=host, port=port, password=password)
         curried = [ 'hmset', 'exists', 'hgetall',
-                    'sadd', 'srem', 'smembers', 'sdiff',
+                    'sadd', 'srem', 'smembers',
                     'set', 'get',
                     'zadd', 'zrem', 'zcard', 'zrange' ]
         def _wrap(*args, **kwargs):
             return fun(self.prefix+args[0], *args[1:], **kwargs)
         return _wrap
+    def sdiff(self, args):
+        return self.conn.sdiff([ self.prefix+arg for arg in args ])
 class DictAbstracted(object):
     def __init__(self, network, **kwargs):
     # -- 
     def following(self):
-        follows =
-        blocked =
+        follows_key = User.FOLLOWS_KEY+self.key()
+        blocked_key = User.BLOCKED_KEY+self.key()
-        for user in follows.difference(blocked):
+        for user in, blocked_key)):
             yield User(, **
     def followers(self):
-        followers =
-        blocks =
+        followers_key = User.FOLLOWERS_KEY+self.key()
+        blocks_key = User.BLOCKS_KEY+self.key()
-        for user in followers.difference(blocks):
+        for user in, blocks_key)):
             yield User(, **
     def key(self, extra=''):
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.