def __init__(self, workspace_file):
     self.workspace_xml = parsers.get_xml(workspace_file)
     self.aliases = Aliases(workspace_file)
     self.default_project = None
Exemplo n.º 2
0
 def __init__(self, project_file, sdk=None, wsroot=None):
     self.xml = parsers.get_xml(project_file)
     self.aliases = Aliases(project_file, sdk=sdk, wsroot=wsroot)
     self.xml_tree = self.xml.parse()
     self.files = self._parse_files()
     self.configurations = self._parse_configurations()
Exemplo n.º 3
0
async def on_ready():
    print('We have logged in as {0.user}'.format(client))


@client.event
async def on_command_error(ctx, error):
    if isinstance(error, commands.CommandNotFound):
        msg = ctx.message.content[1:]
        words = msg.split(' ')
        cmd = words[0]
        args = words[1:]
        aliased_command = session.query(Alias).filter(
            Alias.server_id == ctx.guild.id, Alias.alias == cmd).one_or_none()
        if not (aliased_command is None):
            new_msg = ' '.join([aliased_command.command] + args)
            ctx.message.content = new_msg
            await client.get_command(aliased_command.command).invoke(ctx)
        elif '*' in msg:
            # This was just someone using italics
            return
        else:
            await ctx.send(f"Unrecognized command: '{cmd}'")
    else:
        raise error


client.add_cog(Quotes(client))
client.add_cog(ModRoles(client))
client.add_cog(Mutes(client))
client.add_cog(Aliases(client))
Exemplo n.º 4
0
 def __init__(self):
     self.aliases = Aliases()