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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python_simpletables
3
- Version: 0.1.22
3
+ Version: 0.1.23
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.22"
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,5 @@
1
+ from .app import Example, Table
2
+
3
+
4
+
5
+ #
@@ -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
+
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python_simpletables
3
- Version: 0.1.22
3
+ Version: 0.1.23
4
4
  Summary: Simple connection between SQL and tkinter.
5
5
  Author-email: Захар Васильев <vasilyev.zakhar@gmail.com>
6
6
  License: MIT
@@ -1,6 +1,7 @@
1
1
  pyproject.toml
2
2
  python_simpletables/__init__.py
3
3
  python_simpletables/app.py
4
+ python_simpletables/example.py
4
5
  python_simpletables.egg-info/PKG-INFO
5
6
  python_simpletables.egg-info/SOURCES.txt
6
7
  python_simpletables.egg-info/dependency_links.txt
@@ -1,5 +0,0 @@
1
- from .app import Table
2
-
3
-
4
-
5
- #
@@ -1,16 +0,0 @@
1
- import tkinter as tk
2
-
3
- class Table(tk.Frame):
4
- pass
5
-
6
-
7
-
8
-
9
-
10
-
11
-
12
-
13
-
14
-
15
-
16
- #