Example #1
0
    def __init__(self, conf):

        self.conf = conf
        self.db = db.SQLite3(conf.get('general', 'dbpath'), conf)
        self.signer = URLSafeTimedSerializer(
            self.db.preferences.get("session-key"))
        self.markup = html.Markup(conf.section('markup'))
        self.hasher = hash.new(conf.section("hash"))
        self.author = self.hasher.uhash(conf.get('general', 'author'))

        super(Isso, self).__init__(conf)

        subscribers = []
        for backend in conf.getlist("general", "notify"):
            if backend == "stdout":
                subscribers.append(Stdout(None))
            elif backend in ("smtp", "SMTP"):
                subscribers.append(SMTP(self))
            else:
                logger.warn("unknown notification backend '%s'", backend)

        self.signal = ext.Signal(*subscribers)

        self.urls = Map()

        views.Info(self)
        comments.API(self, self.hasher)
Example #2
0
    def __init__(self, conf):

        self.conf = conf
        self.db = db.SQLite3(conf.get('general', 'dbpath'), conf)
        self.signer = URLSafeTimedSerializer(self.db.preferences.get("session-key"))
        self.markup = html.Markup(conf.section('markup'))
        self.hasher = hash.new(conf.section("hash"))

        super(Isso, self).__init__(conf)

        subscribers = []
        for backend in conf.getlist("general", "notify"):
            if backend == "stdout":
                subscribers.append(Stdout(None))
            elif backend in ("smtp", "SMTP"):
                subscribers.append(SMTP(self))
            else:
                logger.warn("unknown notification backend '%s'", backend)

        self.signal = ext.Signal(*subscribers)

        self.urls = Map()

        views.Info(self)
        comments.API(self, self.hasher)
Example #3
0
    def __init__(self, conf):

        self.conf = conf
        db_type = conf.get('general', 'db-type')
        if db_type == 'sqlite':
            self.db = db.SQLite3(conf.get('general', 'dbpath'), conf)
        elif db_type == 'psql':
            self.db = db_psql.PSQL(conf.get('general', 'dbpath'), conf)
        self.signer = URLSafeTimedSerializer(
            self.db.preferences.get("session-key"))
        self.markup = html.Markup(conf.section('markup'))
        self.hasher = hash.new(conf.section("hash"))

        super(Isso, self).__init__(conf)

        subscribers = []
        smtp_backend = False
        for backend in conf.getlist("general", "notify"):
            if backend == "stdout":
                subscribers.append(Stdout(None))
            elif backend in ("smtp", "SMTP"):
                smtp_backend = True
            else:
                logger.warn("unknown notification backend '%s'", backend)
        if smtp_backend or conf.getboolean("general", "reply-notifications"):
            subscribers.append(SMTP(self))

        self.signal = ext.Signal(*subscribers)

        self.urls = Map()

        views.Info(self)
        views.Metrics(self)
        comments.API(self, self.hasher)
Example #4
0
 def _new(val):
     conf = config.new({
         "hash": {
             "algorithm": val,
             "salt": ""
         }
     })
     return new(conf.section("hash"))
Example #5
0
    def __init__(self, conf):

        self.conf = conf

        if self.conf.has_option("mysql",
                                "host") or os.getenv("MYSQL_HOST") is not None:
            logger.info("Using mysql database connector")
            self.db = mysql.MySQL(conf)
            logger.info("MySQL version: %s" % self.db.version)
        else:
            logger.info("Using sqlite database connector")
            self.db = db.SQLite3(conf.get('general', 'dbpath'), conf)

        self.signer = URLSafeTimedSerializer(
            self.db.preferences.get("session-key"))
        self.markup = html.Markup(conf.section('markup'))
        self.hasher = hash.new(conf.section("hash"))

        super(Isso, self).__init__(conf)

        subscribers = []
        smtp_backend = False
        for backend in conf.getlist("general", "notify"):
            if backend == "stdout":
                subscribers.append(Stdout(None))
            elif backend in ("smtp", "SMTP"):
                smtp_backend = True
            else:
                logger.warn("unknown notification backend '%s'", backend)
        if smtp_backend or conf.getboolean("general", "reply-notifications"):
            subscribers.append(SMTP(self))

        self.signal = ext.Signal(*subscribers)

        self.urls = Map()

        views.Info(self)
        comments.API(self, self.hasher)