python-simpletables 0.1.22__tar.gz → 0.1.23__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.
- {python_simpletables-0.1.22 → python_simpletables-0.1.23}/PKG-INFO +1 -1
- {python_simpletables-0.1.22 → python_simpletables-0.1.23}/pyproject.toml +1 -1
- python_simpletables-0.1.23/python_simpletables/__init__.py +5 -0
- python_simpletables-0.1.23/python_simpletables/app.py +53 -0
- python_simpletables-0.1.23/python_simpletables/example.py +14 -0
- {python_simpletables-0.1.22 → python_simpletables-0.1.23}/python_simpletables.egg-info/PKG-INFO +1 -1
- {python_simpletables-0.1.22 → python_simpletables-0.1.23}/python_simpletables.egg-info/SOURCES.txt +1 -0
- python_simpletables-0.1.22/python_simpletables/__init__.py +0 -5
- python_simpletables-0.1.22/python_simpletables/app.py +0 -16
- {python_simpletables-0.1.22 → python_simpletables-0.1.23}/python_simpletables.egg-info/dependency_links.txt +0 -0
- {python_simpletables-0.1.22 → python_simpletables-0.1.23}/python_simpletables.egg-info/top_level.txt +0 -0
- {python_simpletables-0.1.22 → python_simpletables-0.1.23}/setup.cfg +0 -0
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "python_simpletables"
|
|
7
|
-
version = "0.1.
|
|
7
|
+
version = "0.1.23"
|
|
8
8
|
description = "Simple connection between SQL and tkinter."
|
|
9
9
|
authors = [{name = "Захар Васильев", email = "vasilyev.zakhar@gmail.com"}]
|
|
10
10
|
license = {text = "MIT"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import tkinter as tk,json
|
|
2
|
+
from tkinter import ttk
|
|
3
|
+
|
|
4
|
+
def q(s): return json.dumps(s,ensure_ascii=False)
|
|
5
|
+
class Table(tk.Frame):
|
|
6
|
+
def __init__(self,conn,master,name,fields):
|
|
7
|
+
super().__init__(master)
|
|
8
|
+
tk.Label(self,text=name).pack(side="top",fill="x")
|
|
9
|
+
self.tree = ttk.Treeview(self,columns=[f.name for f in self.fields],show="headings")
|
|
10
|
+
self.tree.pack(side="top",fill="both",expand=True)
|
|
11
|
+
self.buttons = tk.Frame(self)
|
|
12
|
+
self.buttons.pack(side="bottom",fill="x")
|
|
13
|
+
for name,side,cmd in [
|
|
14
|
+
("Создать","left",self.ui_create),
|
|
15
|
+
("Изменить","left",self.ui_edit),
|
|
16
|
+
("Удалить","left",self.ui_delete),
|
|
17
|
+
("Импорт из JSON","right",self.ui_import_json),
|
|
18
|
+
("Импорт из Excel","right",self.ui_import_excel),
|
|
19
|
+
("Экспорт в JSON","right",self.ui_export_json),
|
|
20
|
+
("Экспорт в Excel","right",self.ui_export_excel),
|
|
21
|
+
]: tk.Button().pack(side=side)
|
|
22
|
+
self.update()
|
|
23
|
+
def update(self):
|
|
24
|
+
conn.execute(f"SELECT * FROM {q(self.name)}")
|
|
25
|
+
def ui_create(self): pass
|
|
26
|
+
def ui_create(self): pass
|
|
27
|
+
def ui_edit(self): pass
|
|
28
|
+
def ui_delete(self): pass
|
|
29
|
+
def ui_import_json(self): pass
|
|
30
|
+
def ui_import_excel(self): pass
|
|
31
|
+
def ui_export_json(self):
|
|
32
|
+
def ui_export_excel(self): pass
|
|
33
|
+
|
|
34
|
+
class Example(tk.Tk):
|
|
35
|
+
def __init__(self,database_path):
|
|
36
|
+
super().__init__()
|
|
37
|
+
self.geometry("600x480")
|
|
38
|
+
self.conn = sqlite3.connect(database_path)
|
|
39
|
+
tabs = tk.Frame(self)
|
|
40
|
+
tabs.pack(side="top",fill="x")
|
|
41
|
+
box = tk.Frame(self)
|
|
42
|
+
box.pack(side="top",fill="both",expand=True)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
#
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import os,os.path as op,re,json,sqlite3,tkinter as tk
|
|
2
|
+
from tkinter import ttk
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class ExampleApp(tk.Tk):
|
|
6
|
+
def __init__(self,database_path):
|
|
7
|
+
super().__init__()
|
|
8
|
+
self.geometry("600x480")
|
|
9
|
+
conn = sqlite3.connect(database_path)
|
|
10
|
+
tabs = tk.Frame(self)
|
|
11
|
+
tabs.pack(side="top",fill="x")
|
|
12
|
+
box = tk.Frame(self)
|
|
13
|
+
box.pack(side="top",fill="both",expand=True)
|
|
14
|
+
|
|
File without changes
|
{python_simpletables-0.1.22 → python_simpletables-0.1.23}/python_simpletables.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|