Ejemplo n.º 1
0
Eric Petersen @Ruckusist <*****@*****.**>
"""

__author__ = "Eric Petersen @Ruckusist"
__copyright__ = "Copyright 2017, The Alpha Griffin Project"
__credits__ = ["Eric Petersen", "Shawn Wilson", "@alphagriffin"]
__license__ = "***"
__version__ = "0.0.3"
__maintainer__ = "Eric Petersen"
__email__ = "*****@*****.**"
__status__ = "Alpha"

import sys
import ag.logging as log
import redis
log.set(5)


class Database(object):
    """A Redis Database manage."""
    def __init__(self, host='192.168.1.2', pass_=' ', db=0):
        """Allow for many instances of itself."""
        if pass_ is not ' ':
            self.database = redis.Redis(host=host, password=pass_, db=db)
        else:
            self.database = redis.Redis(host=host, db=db)

    def main(self):
        """Test of connection settings."""
        if self.database:
            log.debug("found that database")
Ejemplo n.º 2
0
from config.__options__ import Options
from database_interface import Database
from utils import DataReader
from network import Model
import ag.logging as log

__author__ = "Eric Petersen @Ruckusist"
__copyright__ = "Copyright 2017, The Alpha Griffin Project"
__credits__ = ["Eric Petersen", "Shawn Wilson", "@alphagriffin"]
__license__ = "***"
__version__ = "0.0.1"
__maintainer__ = "Eric Petersen"
__email__ = "*****@*****.**"
__status__ = "Alpha"

log.set(3)

class Chatter(object):
    """Chatter App."""

    def __init__(self, options):
        """Gonna need a db, and some creds."""
        log.info("Starting AG Chatter Bot.")
        self.options = options
        # Build Constructors
        self.idx2word = Database(
                host=options.redis_host, pass_=options.redis_pass, db=0
            )
        self.word2idx = Database(
                host=options.redis_host, pass_=options.redis_pass, db=1
            )
Ejemplo n.º 3
0
#!/usr/bin/env python
#
# Copyright (C) 2017 Alpha Griffin
# @%@~LICENSE~@%@

__author__ = 'lannocc'

import ag.logging as log
log.set(log.DEBUG)

from flask import Flask, request
flask = Flask(__name__)

chatservice = None


@flask.route('/')
def interface():
    #return "you got the web interface"
    html = '<html><body><form action="/talk" method="GET"><input type="text" name="text"><input type="submit"></form></body></html>'
    return html


@flask.route('/talk', methods=['GET', 'POST'])
def talk():
    text = request.args.get('text')

    if text is None or text == '':
        text = request.get_data().decode('us-ascii')

    #log.debug("you said: ", text)
Ejemplo n.º 4
0
# Copyright (C) 2017 Alpha Griffin
# @%@~LICENSE~@%@
"""Alpha Griffin Python Starter Project

Python Steemit bot for automatically following people posting with specified tags.

.. module:: ag.boiler
   :platform: Unix
   :synopsis: Python Steemit bot for automatically following people posting with specified tags
.. moduleauthor:: Shawn Wilson <*****@*****.**>
"""

from ag.boiler.__version__ import __version__
print("Steemit Boiler %s detected" % (__version__))

import ag.logging as log
log.set(log.INFO)