def __init__(self, uuid): """ called when a request is made to seach for a player by UUID :param uuid: """ self.uuid = uuid if len(uuid) <= 16: self.JSON = h.get_json_data('player', uuid=uuid) JSON = self.JSON self.uuid = self.JSON['uuid'] elif len(uuid) == 32 or len(uuid) == 36: self.JSON = h.get_json_data('player', uuid=uuid) else: raise e.PlayerNotFoundException
def __init__(self, guid): """ Basic guild setup, requires the guild ID :param guid: """ try: if len(guid) == 24: self.guid = guid self.JSON = h.get_json_data('guild', guid) except e.HypixelAPIException: pass
def to_string(self, message): encoded_msg = Handler.to_string(self, message) return '\x00' + encoded_msg.encode('utf-8')
def from_string(self, raw_message): raw_message= raw_message[1:] logging.debug("Raw message is {0}".format(raw_message)) Handler.from_string(self, raw_message)
def __init__(self): Handler.__init__(self, '\xff')
class CustomFlask(Flask): jinja_options = Flask.jinja_options.copy() jinja_options.update( dict( block_start_string='(%', block_end_string='%)', variable_start_string='((', variable_end_string='))', comment_start_string='(#', comment_end_string='#)', )) app = CustomFlask(__name__) con = Controller() json_handler = Handler() @app.route('/') def index(): return render_template("index.html") @app.route('/controller') def redirect_home(): return redirect("/") @app.route('/procedures') def procedures(): return render_template("procedures.html")