utils.request.Request

Here are the examples of the python api utils.request.Request taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

3 Examples 7

3 Source : multithreadeddownloader.py
with MIT License
from code-master5

    def __init__(self):
        self.filehandle = FileHandler()
        self.request_handle = Request()
        self.calculate = Calculation()
        self.url = None 
        self.range_left = None
        self.range_right = None
        self.proxy = None 
        self.temp_dir = None 
        self.threads = None 
        self.filepath = None 
        logging.getLogger("urllib3").setLevel(logging.WARNING)

    def range_download_support(self, resp):

3 Source : ready.py
with BSD 3-Clause "New" or "Revised" License
from Saebasol

    async def on_ready(self):
        print("Login.. : ")
        print(self.bot.user.name)
        print(self.bot.user.id)

        game = discord.Game(f"&도움말 | {hiyobot.__version__}")
        await self.bot.change_presence(status=discord.Status.online, activity=game)
        self.bot.request = Request()


def setup(bot: Hiyobot):

0 Source : main.py
with MIT License
from latonaio

def main(opt: Options):
    conn = opt.get_conn()
    num = opt.get_number()
    vehicle_data = {
        "vehicle": True,
        "vehicle_name": "",
        "end": True,
    }

    if START_MODE == "by-name":
        conn.set_kanban(SERVICE_NAME, num)
    elif START_MODE == "from-kanban":
        kanban = conn.get_one_kanban(SERVICE_NAME, num)
        metadata = kanban.get_metadata()
        vehicle_data = metadata['args']

    lprint(f"vehicle_data: {vehicle_data}")
    templates = []
    vehicle = vehicle_data['vehicle']
    vehicle_name = vehicle_data['vehicle_name']
    end = vehicle_data['end']

    try:
        ms = MySQLClient()
        if vehicle and not vehicle_name:
            templates += ms.get_all_vehicles()
            lprint("set_template all")
        elif vehicle and vehicle_name:
            templates += ms.get_by_vehicle_name(vehicle_name)
            lprint(f"set_template {vehicle_name}")

        if end:
            templates += ms.get_end()
            lprint("set_template end")

        if templates:
            with Request() as r:
                r.set_templates(templates)

    except Exception as e:
        print(str(e))


if __name__ == "__main__":