adding from new mac
This commit is contained in:
5
documentation-test/src/documentation_test/__init__.py
Normal file
5
documentation-test/src/documentation_test/__init__.py
Normal file
@@ -0,0 +1,5 @@
|
||||
from documentation_test.documentation_test import *
|
||||
|
||||
__version__ = '0.1.0'
|
||||
|
||||
print('documentation_test __init__')
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,68 @@
|
||||
import documentation_test.submod1.submod1 as submod1
|
||||
import documentation_test.submod2.submod2 as submod2
|
||||
from documentation_test.lib.lib import export
|
||||
|
||||
__all__ = []
|
||||
|
||||
|
||||
@export
|
||||
class testClass(object):
|
||||
|
||||
"""Summary of class
|
||||
|
||||
Attributes
|
||||
----------
|
||||
arg : str
|
||||
a string to print
|
||||
"""
|
||||
|
||||
def __init__(self, arg: str):
|
||||
"""Summary of init
|
||||
|
||||
Parameters
|
||||
----------
|
||||
arg : str, optional
|
||||
a string to print
|
||||
"""
|
||||
super(testClass, self).__init__()
|
||||
self.arg = arg
|
||||
|
||||
@classmethod
|
||||
def createString(cls, aString: str):
|
||||
"""create a string
|
||||
|
||||
Parameters
|
||||
----------
|
||||
aString : str
|
||||
a string to print
|
||||
"""
|
||||
return cls(arg=aString)
|
||||
|
||||
def printString(self):
|
||||
"""Print a string
|
||||
"""
|
||||
print(self.arg)
|
||||
|
||||
|
||||
@export
|
||||
def testFunction(anything: str = 'test') -> None:
|
||||
"""test function for a demo import of whole module
|
||||
|
||||
Parameters
|
||||
----------
|
||||
anything : str, optional
|
||||
a test string
|
||||
|
||||
Returns
|
||||
-------
|
||||
None
|
||||
"""
|
||||
print(anything)
|
||||
|
||||
|
||||
submod1.submod1('string from submod1 in base')
|
||||
|
||||
submod2.submod2('string from submod2 in base')
|
||||
|
||||
|
||||
print(f'{__all__=}')
|
||||
Binary file not shown.
10
documentation-test/src/documentation_test/lib/lib.py
Normal file
10
documentation-test/src/documentation_test/lib/lib.py
Normal file
@@ -0,0 +1,10 @@
|
||||
import sys
|
||||
|
||||
|
||||
def export(fn):
|
||||
mod = sys.modules[fn.__module__]
|
||||
if hasattr(mod, '__all__'):
|
||||
mod.__all__.append(fn.__name__)
|
||||
else:
|
||||
mod.__all__ = [fn.__name__]
|
||||
return fn
|
||||
@@ -0,0 +1 @@
|
||||
print('submod1.__init__')
|
||||
Binary file not shown.
Binary file not shown.
13
documentation-test/src/documentation_test/submod1/submod1.py
Normal file
13
documentation-test/src/documentation_test/submod1/submod1.py
Normal file
@@ -0,0 +1,13 @@
|
||||
print('imported submod1')
|
||||
|
||||
|
||||
def submod1(myStr: str) -> None:
|
||||
"""test module for submod1
|
||||
|
||||
Parameters
|
||||
----------
|
||||
myStr : str
|
||||
a test string
|
||||
"""
|
||||
print('submod1')
|
||||
print(myStr)
|
||||
@@ -0,0 +1 @@
|
||||
print('submod2.__init__')
|
||||
Binary file not shown.
Binary file not shown.
17
documentation-test/src/documentation_test/submod2/submod2.py
Normal file
17
documentation-test/src/documentation_test/submod2/submod2.py
Normal file
@@ -0,0 +1,17 @@
|
||||
print('imported submod2')
|
||||
|
||||
|
||||
def submod2(someString: str = 'submod2 string') -> None:
|
||||
"""submod2 test function
|
||||
|
||||
Parameters
|
||||
----------
|
||||
someString : str, optional
|
||||
a random string to show it's working
|
||||
|
||||
Returns
|
||||
-------
|
||||
None
|
||||
"""
|
||||
|
||||
print(someString)
|
||||
Binary file not shown.
Binary file not shown.
42
documentation-test/src/documentation_test/submod3/submod3.py
Normal file
42
documentation-test/src/documentation_test/submod3/submod3.py
Normal file
@@ -0,0 +1,42 @@
|
||||
from documentation_test.lib.lib import export
|
||||
|
||||
__all__ = []
|
||||
|
||||
|
||||
@export
|
||||
class testClass(object):
|
||||
|
||||
"""Summary of class
|
||||
|
||||
Attributes
|
||||
----------
|
||||
arg : str
|
||||
a string to print
|
||||
"""
|
||||
|
||||
def __init__(self, arg: str):
|
||||
"""Summary of init
|
||||
|
||||
Parameters
|
||||
----------
|
||||
arg : str, optional
|
||||
a string to print
|
||||
"""
|
||||
super(testClass, self).__init__()
|
||||
self.arg = arg
|
||||
|
||||
@classmethod
|
||||
def createString(cls, aString: str):
|
||||
"""create a string
|
||||
|
||||
Parameters
|
||||
----------
|
||||
aString : str
|
||||
a string to print
|
||||
"""
|
||||
return cls(arg=aString)
|
||||
|
||||
def printString(self):
|
||||
"""Print a string
|
||||
"""
|
||||
print(self.arg)
|
||||
Reference in New Issue
Block a user