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

All Samples(16)  |  Call(12)  |  Derive(0)  |  Import(4)

src/s/p/Spacelog-HEAD/backend/stats_porn.py   Spacelog(Download)
from backend.api import Mission, Act, KeyScene, LogLine
from backend.util import seconds_to_timestamp
class StatsPornGenerator(object):
                if height > 0:
                    image_map.append('<area shape="rect" coords="%(coords)s" href="%(url)s" alt="%(alt)s">' % {
                        "url":    '/%s/%s/#show-selection' % (seconds_to_timestamp(start), seconds_to_timestamp(end)),
                        "alt":    '%d lines between %s and %s' % (count, seconds_to_timestamp(start), seconds_to_timestamp(end)),
                        "coords": '%s,%s,%s,%s' % (top_left_x, top_left_y, bottom_right_x, bottom_right_y),

src/s/p/Spacelog-HEAD/backend/indexer.py   Spacelog(Download)
from backend.parser import TranscriptParser, MetaParser
from backend.api import Act, KeyScene, Character, Glossary, LogLine
from backend.util import seconds_to_timestamp
search_db = xappy.IndexerConnection(
            log_line_id = "%s:%i" % (self.transcript_name, timestamp)
            if timestamp <= previous_timestamp:
                raise Exception, "%s should be after %s" % (seconds_to_timestamp(timestamp), seconds_to_timestamp(previous_timestamp))
            # See if there's transcript page info, and update it if so
            if chunk['meta'].get('_page', 0):
                print "Error: No act for timestamp %s" % seconds_to_timestamp(timestamp)
            # If we've filled up the current page, go to a new one

src/s/p/Spacelog-HEAD/backend/reformat.py   Spacelog(Download)
import sys
from backend.parser import TranscriptParser
from backend.util import seconds_to_timestamp
def reformat(filename):
    parser = TranscriptParser(filename)
    for chunk in parser.get_chunks():
        timestamp = seconds_to_timestamp(chunk['timestamp'])

src/s/p/Spacelog-HEAD/backend/parser.py   Spacelog(Download)
except ImportError:
    import simplejson as json
from backend.util import timestamp_to_seconds, seconds_to_timestamp
class TranscriptParser(object):
                        except ValueError:
                            print "Error: Invalid json at timestamp %s, key %s" % \
                                            (seconds_to_timestamp(timestamp), name)
                    current_chunk['meta'][name.strip()] = data

src/s/p/Spacelog-HEAD/backend/api.py   Spacelog(Download)
    def _load(self):
        data = self.redis_conn.hgetall(u"log_line:%s:info" % self.id)
        if not data:
            raise ValueError("No such LogLine: %s at %s [%s]" % (self.transcript_name, backend.util.seconds_to_timestamp(self.timestamp), self.timestamp))
        # Load onto our attributes