foyndation 10__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
foyndation/__init__.py
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import logging
|
|
2
|
+
|
|
3
|
+
dotpy = '.py'
|
|
4
|
+
|
|
5
|
+
def initlogging():
|
|
6
|
+
'Initialise the logging module to send debug (and higher levels) to stderr.'
|
|
7
|
+
logging.basicConfig(format = "%(asctime)s %(levelname)s %(message)s", level = logging.DEBUG)
|
|
8
|
+
|
|
9
|
+
def rmsuffix(text, suffix):
|
|
10
|
+
'Return text with suffix removed, or `None` if text does not end with suffix.'
|
|
11
|
+
if text.endswith(suffix):
|
|
12
|
+
return text[:-len(suffix)]
|
|
13
|
+
|
|
14
|
+
def singleton(t):
|
|
15
|
+
'''The decorated class is replaced with a no-arg instance.
|
|
16
|
+
Can also be used to replace a factory function with its result.'''
|
|
17
|
+
return t()
|
|
18
|
+
|
|
19
|
+
def solo(v):
|
|
20
|
+
'Assert exactly one object in the given sequence and return it.'
|
|
21
|
+
x, = v
|
|
22
|
+
return x
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: foyndation
|
|
3
|
+
Version: 10
|
|
4
|
+
Summary: Base library of foyono projects
|
|
5
|
+
Home-page: https://pypi.org/project/foyndation/
|
|
6
|
+
Author: foyono
|
|
7
|
+
Author-email: shrovis@foyono.com
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
|
|
10
|
+
# foyndation
|
|
11
|
+
Base library of foyono projects.
|
|
12
|
+
|
|
13
|
+
## API
|
|
14
|
+
|
|
15
|
+
<a id="foyndation"></a>
|
|
16
|
+
|
|
17
|
+
### foyndation
|
|
18
|
+
|
|
19
|
+
<a id="foyndation.initlogging"></a>
|
|
20
|
+
|
|
21
|
+
###### initlogging
|
|
22
|
+
|
|
23
|
+
```python
|
|
24
|
+
def initlogging()
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Initialise the logging module to send debug (and higher levels) to stderr.
|
|
28
|
+
|
|
29
|
+
<a id="foyndation.rmsuffix"></a>
|
|
30
|
+
|
|
31
|
+
###### rmsuffix
|
|
32
|
+
|
|
33
|
+
```python
|
|
34
|
+
def rmsuffix(text, suffix)
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Return text with suffix removed, or `None` if text does not end with suffix.
|
|
38
|
+
|
|
39
|
+
<a id="foyndation.singleton"></a>
|
|
40
|
+
|
|
41
|
+
###### singleton
|
|
42
|
+
|
|
43
|
+
```python
|
|
44
|
+
def singleton(t)
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
The decorated class is replaced with a no-arg instance.
|
|
48
|
+
Can also be used to replace a factory function with its result.
|
|
49
|
+
|
|
50
|
+
<a id="foyndation.solo"></a>
|
|
51
|
+
|
|
52
|
+
###### solo
|
|
53
|
+
|
|
54
|
+
```python
|
|
55
|
+
def solo(v)
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Assert exactly one object in the given sequence and return it.
|
|
59
|
+
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
foyndation/__init__.py,sha256=hRXqThv8DHDPSQ9jPYEn1H4J7DaKFkq3G75ADhE3JbU,680
|
|
2
|
+
foyndation-10.dist-info/METADATA,sha256=7JpQOqYYxcX06i7sVl9ifCBlpSgHbUYopaPHdtTviEc,1002
|
|
3
|
+
foyndation-10.dist-info/WHEEL,sha256=Wyh-_nZ0DJYolHNn1_hMa4lM7uDedD_RGVwbmTjyItk,91
|
|
4
|
+
foyndation-10.dist-info/top_level.txt,sha256=KsDv9fSU0cdnzXCXIo6yW0ku11KGlJIr4tLhbR-YQTE,11
|
|
5
|
+
foyndation-10.dist-info/RECORD,,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
foyndation
|