In the main.py I have this code snippet
# Define the Git repository and the commit hash
git_repo_url = "gitlab.com/brightlight-techhub/dagger/dagger-shared-module-functions"
commit_hash = "9808d910504e3dd0c402a0c7f56724ae28eee8df"
git_module_source = self.client.module_source(f"{git_repo_url}@{commit_hash}")
print("Loaded module source:", dir(git_module_source))
module_x = git_module_source.as_module()
print(f"module_x: {type(module_x)}", dir(module_x))
# Get the module ID correctly
module_id = await module_x.id() # Await this method to get the actual ID
print(f"Module ID: {type(module_id)}", module_id)
# Use the ID to load the module
loaded_module = self.client.load_module_from_id(module_id)
print("Loaded Module:", dir(loaded_module))
objects = await loaded_module.objects()
print("Available Objects:", objects)
interfaces = await loaded_module.interfaces()
print("Available Interfaces:", interfaces)
for obj in objects:
print("Object:", obj)
# List available methods for each object
methods = obj.methods()
print("Available Methods:", methods)
for method in methods:
print("Method:", dir(method))
# Call the method and print the result
result = await method.call()
print(f"Method {method.name} result: {result}")