예제 #1
0
    def commands():
        """Returns list of available commands"""

        import sap.cli.program
        import sap.cli.include
        import sap.cli.interface
        import sap.cli.abapclass
        import sap.cli.datadefinition
        import sap.cli.function
        import sap.cli.aunit
        import sap.cli.atc
        import sap.cli.datapreview
        import sap.cli.package
        import sap.cli.cts
        import sap.cli.checkout
        import sap.cli.activation
        import sap.cli.startrfc
        import sap.cli.adt

        if CommandsCache.adt is None:
            CommandsCache.adt = [
                (adt_connection_from_args, sap.cli.program.CommandGroup()),
                (adt_connection_from_args, sap.cli.include.CommandGroup()),
                (adt_connection_from_args, sap.cli.interface.CommandGroup()),
                (adt_connection_from_args, sap.cli.abapclass.CommandGroup()),
                (adt_connection_from_args, sap.cli.datadefinition.CommandGroup()),
                (adt_connection_from_args, sap.cli.function.CommandGroupFunctionGroup()),
                (adt_connection_from_args, sap.cli.function.CommandGroupFunctionModule()),
                (adt_connection_from_args, sap.cli.aunit.CommandGroup()),
                (adt_connection_from_args, sap.cli.atc.CommandGroup()),
                (adt_connection_from_args, sap.cli.datapreview.CommandGroup()),
                (adt_connection_from_args, sap.cli.package.CommandGroup()),
                (adt_connection_from_args, sap.cli.cts.CommandGroup()),
                (adt_connection_from_args, sap.cli.checkout.CommandGroup()),
                (adt_connection_from_args, sap.cli.activation.CommandGroup()),
                (adt_connection_from_args, sap.cli.adt.CommandGroup())
            ]

        if CommandsCache.rfc is None:
            if rfc.rfc_is_available():
                CommandsCache.rfc = [
                    (rfc_connection_from_args, sap.cli.startrfc.CommandGroup())
                ]
            else:
                CommandsCache.rfc = list()

        return CommandsCache.adt + CommandsCache.rfc
예제 #2
0
    def commands():
        """Returns list of available commands"""

        import sap.cli.program
        import sap.cli.include
        import sap.cli.interface
        import sap.cli.abapclass
        import sap.cli.datadefinition
        import sap.cli.function
        import sap.cli.aunit
        import sap.cli.atc
        import sap.cli.datapreview
        import sap.cli.package
        import sap.cli.cts
        import sap.cli.gcts
        import sap.cli.checkout
        import sap.cli.activation
        import sap.cli.startrfc
        import sap.cli.adt
        import sap.cli.strust
        import sap.cli.user
        import sap.cli.abapgit
        import sap.cli.bsp
        import sap.cli.flp

        if CommandsCache.adt is None:
            CommandsCache.adt = [
                (adt_connection_from_args, sap.cli.program.CommandGroup()),
                (adt_connection_from_args, sap.cli.include.CommandGroup()),
                (adt_connection_from_args, sap.cli.interface.CommandGroup()),
                (adt_connection_from_args, sap.cli.abapclass.CommandGroup()),
                (adt_connection_from_args,
                 sap.cli.datadefinition.CommandGroup()),
                (adt_connection_from_args,
                 sap.cli.function.CommandGroupFunctionGroup()),
                (adt_connection_from_args,
                 sap.cli.function.CommandGroupFunctionModule()),
                (adt_connection_from_args, sap.cli.aunit.CommandGroup()),
                (adt_connection_from_args, sap.cli.atc.CommandGroup()),
                (adt_connection_from_args, sap.cli.datapreview.CommandGroup()),
                (adt_connection_from_args, sap.cli.package.CommandGroup()),
                (adt_connection_from_args, sap.cli.cts.CommandGroup()),
                (adt_connection_from_args, sap.cli.checkout.CommandGroup()),
                (adt_connection_from_args, sap.cli.activation.CommandGroup()),
                (adt_connection_from_args, sap.cli.adt.CommandGroup()),
                (adt_connection_from_args, sap.cli.abapgit.CommandGroup())
            ]

        if CommandsCache.rest is None:
            CommandsCache.rest = [(gcts_connection_from_args,
                                   sap.cli.gcts.CommandGroup())]

        if CommandsCache.rfc is None:
            if rfc.rfc_is_available():
                CommandsCache.rfc = [
                    (rfc_connection_from_args,
                     sap.cli.startrfc.CommandGroup()),
                    (rfc_connection_from_args, sap.cli.strust.CommandGroup()),
                    (rfc_connection_from_args, sap.cli.user.CommandGroup())
                ]
            else:
                CommandsCache.rfc = list()

        if CommandsCache.odata is None:
            CommandsCache.odata = [
                (partial(odata_connection_from_args,
                         'ABAP_REPOSITORY_SRV'), sap.cli.bsp.CommandGroup()),
                (partial(odata_connection_from_args,
                         'UI2/PAGE_BUILDER_CUST'), sap.cli.flp.CommandGroup())
            ]

        return CommandsCache.adt + CommandsCache.rest + CommandsCache.rfc + CommandsCache.odata