Skip to content

Commit

Permalink
module
Browse files Browse the repository at this point in the history
  • Loading branch information
sal authored and sal committed Jan 16, 2025
1 parent b4e66d1 commit aae37bd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 25 deletions.
25 changes: 0 additions & 25 deletions commune/README.md

This file was deleted.

12 changes: 12 additions & 0 deletions commune/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,12 @@ def ask(*args, **kwargs):
return c.ask(*args, **kwargs)
module.ask = ask
return module


@classmethod
def getfile(cls, obj=None) -> str:
obj = cls.resolve_module(obj)
return inspect.getfile(obj)

@classmethod
def filepath(cls, obj=None) -> str:
Expand Down Expand Up @@ -2041,6 +2047,12 @@ def run_test(self, module=None, parallel=True):
return fn2result


def readmes(self, path='./', search=None):
files = c.files(path)
readmes = [f for f in files if f.endswith('.md')]
return readmes


c.add_routes()
Module = c # Module is alias of c

Expand Down

0 comments on commit aae37bd

Please sign in to comment.