MightyMaxims 3.0.1__tar.gz → 3.0.2__tar.gz
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.
- {MightyMaxims-3.0.1 → MightyMaxims-3.0.2}/MightyMaxims/GetRandom.py +2 -2
- {MightyMaxims-3.0.1 → MightyMaxims-3.0.2}/MightyMaxims/Maxims.py +1 -13
- {MightyMaxims-3.0.1 → MightyMaxims-3.0.2}/MightyMaxims.egg-info/PKG-INFO +1 -1
- {MightyMaxims-3.0.1 → MightyMaxims-3.0.2}/PKG-INFO +1 -1
- {MightyMaxims-3.0.1 → MightyMaxims-3.0.2}/pyproject.toml +1 -1
- {MightyMaxims-3.0.1 → MightyMaxims-3.0.2}/MightyMaxims/MightyMaxims2024.sqlt3 +0 -0
- {MightyMaxims-3.0.1 → MightyMaxims-3.0.2}/MightyMaxims/__init__.py +0 -0
- {MightyMaxims-3.0.1 → MightyMaxims-3.0.2}/MightyMaxims.egg-info/SOURCES.txt +0 -0
- {MightyMaxims-3.0.1 → MightyMaxims-3.0.2}/MightyMaxims.egg-info/dependency_links.txt +0 -0
- {MightyMaxims-3.0.1 → MightyMaxims-3.0.2}/MightyMaxims.egg-info/top_level.txt +0 -0
- {MightyMaxims-3.0.1 → MightyMaxims-3.0.2}/README.md +0 -0
- {MightyMaxims-3.0.1 → MightyMaxims-3.0.2}/setup.cfg +0 -0
- {MightyMaxims-3.0.1 → MightyMaxims-3.0.2}/setup.py +0 -0
|
@@ -14,8 +14,8 @@ def get_random():
|
|
|
14
14
|
which = random.randrange(1, nelem + 1)
|
|
15
15
|
go = db.select(f'SELECT * from {db.table_name} where ID = {which} LIMIT 1;')
|
|
16
16
|
q = dict(*go)
|
|
17
|
-
print(f"\nMighty Maxims #{q['ID']}: {q['
|
|
18
|
-
for _str in textwrap.wrap(q['
|
|
17
|
+
print(f"\nMighty Maxims #{q['ID']}: {q['AUTHOR']}\n")
|
|
18
|
+
for _str in textwrap.wrap(q['QUOTE'], width=40):
|
|
19
19
|
print(_str)
|
|
20
20
|
print()
|
|
21
21
|
db.close()
|
|
@@ -16,19 +16,7 @@ class Maxims:
|
|
|
16
16
|
self.db = os.path.join(pdir, 'MightyMaxims2024.sqlt3')
|
|
17
17
|
self.conn = None
|
|
18
18
|
self.curs = None
|
|
19
|
-
self.bOpen = False
|
|
20
|
-
self.fields = OrderedDict([('ID', 'integer'), ('Author', 'text'), ('Quote', 'text')])
|
|
21
|
-
self.table_name = 'MightyMaxims'
|
|
22
|
-
|
|
23
|
-
@classmethod
|
|
24
|
-
def get_fields(cls, value):
|
|
25
|
-
if isinstance(value, dict) and 'ID' in value.keys():
|
|
26
|
-
value = OrderedDict(value)
|
|
27
|
-
del value['ID']
|
|
28
|
-
return list(value.values())
|
|
29
|
-
if isinstance(value, cls):
|
|
30
|
-
return cls.get_fields(value.fields)
|
|
31
|
-
return value
|
|
19
|
+
self.bOpen = False
|
|
32
20
|
|
|
33
21
|
def open(self):
|
|
34
22
|
if self.bOpen is False:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|