def __init__(self):
     BaseService.__init__(self)
     self.redis_presence_channel = "presence.buddies"
     self.redis_presence_ctx = redis.StrictRedis(
         host=os.environ['REDIS_SERV'],
         port=int(os.environ['REDIS_PORT']),
         db=5)
Example #2
0
 def __init__(self):
     BaseService.__init__(self)
     self.valid_characters = "1234567890#_-`()$-=;/@+&abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
     self.redis_presence_channel = "presence.buddies"
     self.redis_presence_ctx = redis.StrictRedis(
         host=os.environ['REDIS_SERV'],
         port=int(os.environ['REDIS_PORT']),
         db=5)
Example #3
0
    def __init__(self):
        BaseService.__init__(self)

        self.snapshot_handlers = {
            1003: {
                "gamename": "thps6pc",
                "module": THPS6PC_Handler
            },
            #1324 : {"gamename": "stella", "module": None}
        }
Example #4
0
 def __init__(self):
     BaseService.__init__(self)
     self.REDIS_GAMESERVERS_DB = 0
     self.REDIS_GAME_DB = 2
     self.REDIS_GAMEGROUP_DB = 1
     self.redis_ctx = redis.StrictRedis(host=os.environ['REDIS_SERV'],
                                        port=int(os.environ['REDIS_PORT']),
                                        db=self.REDIS_GAMESERVERS_DB)
     self.redis_game_ctx = redis.StrictRedis(host=os.environ['REDIS_SERV'],
                                             port=int(
                                                 os.environ['REDIS_PORT']),
                                             db=self.REDIS_GAME_DB)
     self.redis_group_ctx = redis.StrictRedis(host=os.environ['REDIS_SERV'],
                                              port=int(
                                                  os.environ['REDIS_PORT']),
                                              db=self.REDIS_GAMEGROUP_DB)
Example #5
0
 def __init__(self, tty, bus_name):
     BaseService.__init__(self, bus_name, PIONEERTVSERVICE_OBJ_PATH, tty,
                          BAUD_RATE, READVAL, pioneer_cmds)
 def __init__(self):
     BaseService.__init__(self)
     self.redis_ctx = redis.StrictRedis(host=os.environ['REDIS_SERV'],
                                        port=int(os.environ['REDIS_PORT']),
                                        db=4)
Example #7
0
 def __init__(self, tty, bus_name):
     BaseService.__init__(self, bus_name, ARCAMSERVICE_OBJ_PATH, tty,
                          BAUD_RATE, READVAL, arcam_cmds)
Example #8
0
from flask import Flask, Response, request
from flask_caching import Cache
from json import dumps
from BaseService import BaseService

app = Flask(__name__)
app.config['CACHE_TYPE'] = 'simple'
app.cache = Cache(app)
JSON_MIME_TYPE = 'application/json'
base_servic = BaseService()

@app.route('/get_mined_blocks')
@app.cache.cached(timeout=60)
def get_mined_blocks():
    mined_blocks = base_servic.get_mined_blocks()
    base_servic.db_service.save_log(request.remote_addr, 1,mined_blocks)

    api_response = Response(dumps({"Mined blocks" : mined_blocks}),status=200,mimetype=JSON_MIME_TYPE)
    return api_response

@app.route('/get_av_time')
@app.cache.cached(timeout=60)
def get_av_time():
    av_time = base_servic.get_av_time()
    base_servic.db_service.save_log(request.remote_addr, 2,av_time)

    api_response = Response(dumps({"Average time between blocks" : av_time}),status=200,mimetype=JSON_MIME_TYPE)
    return api_response

@app.route('/get_tx_count')
@app.cache.cached(timeout=60)
Example #9
0
 def __init__(self):
     BaseService.__init__(self)
Example #10
0
 def __init__(self, tty, bus_name):
   BaseService.__init__(self, bus_name, LGTVSERVICE_OBJ_PATH, tty, BAUD_RATE, READVAL, lgtv_cmds)
Example #11
0
 def __init__(self, tty, bus_name):
   BaseService.__init__(self, bus_name, PIONEERTVSERVICE_OBJ_PATH, tty, BAUD_RATE, READVAL, pioneer_cmds)
  def __init__(self, tty, bus_name):
    self.lock = RLock()
    self.all_commands = dict([item for sublist in [a_cmds.commands[x].items() for x in a_cmds.commands] for item in sublist])

    BaseService.__init__(self, bus_name, ARCAMAVR400SERVICE_OBJ_PATH, tty, BAUD_RATE, self, a_cmds)
Example #13
0
 def __init__(self, tty, bus_name):
   BaseService.__init__(self, bus_name, AZURSERVICE_OBJ_PATH, tty, BAUD_RATE, READVAL, azur_cmds)
Example #14
0
 def __init__(self, tty, bus_name):
     BaseService.__init__(self, bus_name, LGTVSERVICE_OBJ_PATH, tty,
                          BAUD_RATE, READVAL, lgtv_cmds)
Example #15
0
 def __init__(self, tty, bus_name):
   BaseService.__init__(self, bus_name, AZURSERVICE_OBJ_PATH, tty, BAUD_RATE, READVAL, azur_cmds)
Example #16
0
 def __init__(self, tty, bus_name):
     BaseService.__init__(self, bus_name, ARCAMSERVICE_OBJ_PATH, tty, BAUD_RATE, READVAL, arcam_cmds)