Beispiel #1
0
def getExtension(author_name, extension_name):
    """Create an Extension object ignoring whether it is valid"""
    try:
        return Extension(author_name, extension_name)
    except ExtensionError as error:
        if error.extension is None:
            raise error
        return error.extension
Beispiel #2
0
def reinstallExtension(db, user, author_name, extension_name, version):
    doUninstallExtension(db, user, getExtension(author_name, extension_name))
    doInstallExtension(db, user, Extension(author_name, extension_name),
                       version)
    db.commit()
Beispiel #3
0
def installExtension(db, user, author_name, extension_name, version):
    doInstallExtension(db, user, Extension(author_name, extension_name),
                       version)
    db.commit()
Beispiel #4
0
 def __call__(self, value, context):
     from extensions.extension import Extension
     super(ExtensionKey, self).__call__(value, context)
     author_name, _, extension_name = value.rpartition("/")
     return Extension(author_name, extension_name)