python-simpletables 0.1.24__tar.gz → 0.1.26__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python_simpletables
3
- Version: 0.1.24
3
+ Version: 0.1.26
4
4
  Summary: Simple connection between SQL and tkinter.
5
5
  Author-email: Захар Васильев <vasilyev.zakhar@gmail.com>
6
6
  License: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "python_simpletables"
7
- version = "0.1.24"
7
+ version = "0.1.26"
8
8
  description = "Simple connection between SQL and tkinter."
9
9
  authors = [{name = "Захар Васильев", email = "vasilyev.zakhar@gmail.com"}]
10
10
  license = {text = "MIT"}
@@ -1,4 +1,4 @@
1
- from .app import Table
1
+ from .table import Table
2
2
  from .example import ExampleApp
3
3
 
4
4
 
@@ -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): pass
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
+ #
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python_simpletables
3
- Version: 0.1.24
3
+ Version: 0.1.26
4
4
  Summary: Simple connection between SQL and tkinter.
5
5
  Author-email: Захар Васильев <vasilyev.zakhar@gmail.com>
6
6
  License: MIT
@@ -2,6 +2,7 @@ pyproject.toml
2
2
  python_simpletables/__init__.py
3
3
  python_simpletables/app.py
4
4
  python_simpletables/example.py
5
+ python_simpletables/table.py
5
6
  python_simpletables.egg-info/PKG-INFO
6
7
  python_simpletables.egg-info/SOURCES.txt
7
8
  python_simpletables.egg-info/dependency_links.txt