'Return list of rules sorted by priority.
If kind is empty, then all the rules apply.'

@classmethod
def get_rules(self, subreddit, kind=None):

    try:
        query = self._cf.get(subreddit._id36)
    except tdb_cassandra.NotFoundException:
        return []
    result = []
    for (uuid, json_blob) in query.iteritems():
        payload = json.loads(json_blob)
        if (not payload.get('created_utc')):
            payload['created_utc'] = time.mktime(datetime.strptime(payload.pop('when')[:(-6)], '%Y-%m-%d    %H:%M:%S.%f').timetuple())
        payload['short_name'] = uuid
        if (not kind):
            result.append(payload)
        elif (kind in payload.get('kind', kind)):
            result.append(payload)
    return sorted(result, key=(lambda t: t['priority']))
