Commit 248da22
committed
typehint main.py, with consequent fixes elsewhere
* typehint >50% of main.py
* requiring additional hints and fixes in config.py and sqlexecute.py
* typehint unhinted portions of sqlexecute.py
* remove @export decorator and import explicitly into "special"
* recast some uninformative variable names
* assert that a connection is available before using it
* take more care with: ssl config, port, and ssh_port types/defaults
before creating a connection
* local_infile is a boolean, not a string
* ensure get_password_from_file() returns a value
* assert that a PromptSession is available before invoking methods on
it
* set a fallback col/row size in case a prompt session is not available
* declare and type self.conn in SQLExecute much earlier
* take more care to distinguish falsey values from Nones in SQLExecute
connect()
* improve defaults passed to pymysql.connect(), matching them to the
pymysql docs
* test that self.conn is not None rather than checking for a "conn"
attribute, before invoking close()
* update changelog1 parent b3385a1 commit 248da22
File tree
7 files changed
+285
-211
lines changed- mycli
- packages/special
7 files changed
+285
-211
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
2 | 10 | | |
3 | 11 | | |
4 | 12 | | |
| |||
7 | 15 | | |
8 | 16 | | |
9 | 17 | | |
| 18 | + | |
10 | 19 | | |
11 | 20 | | |
12 | 21 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
| 55 | + | |
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
| 67 | + | |
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
83 | | - | |
| 83 | + | |
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| |||
0 commit comments