Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
easy-media-controller
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Mihkevich
easy-media-controller
Commits
533b95f6
Commit
533b95f6
authored
Dec 19, 2021
by
mihkevich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add iplay by enter command
parent
592fe665
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
3 deletions
+35
-3
data.xlsx
data.xlsx
+0
-0
main.py
main.py
+35
-3
No files found.
data.xlsx
View file @
533b95f6
No preview for this file type
main.py
View file @
533b95f6
...
@@ -5,22 +5,29 @@ import os
...
@@ -5,22 +5,29 @@ import os
import
sys
import
sys
import
traceback
import
traceback
import
settings
import
settings
import
subprocess
from
openpyxl
import
load_workbook
from
openpyxl
import
load_workbook
import
tkinter
import
tkinter
from
tkinter
import
ttk
from
tkinter
import
ttk
from
tkinter
import
messagebox
class
App
(
tkinter
.
Tk
):
class
App
(
tkinter
.
Tk
):
def
__init__
(
self
,
*
args
,
**
kwargs
):
def
__init__
(
self
,
*
args
,
**
kwargs
):
self
.
data
=
load_workbook
(
log
.
exec_dir
+
"/data.xlsx"
)
self
.
sheetnames
=
self
.
data
.
sheetnames
log
.
info
(
self
.
sheetnames
)
tkinter
.
Tk
.
__init__
(
self
,
*
args
,
**
kwargs
)
tkinter
.
Tk
.
__init__
(
self
,
*
args
,
**
kwargs
)
self
.
grid
()
self
.
grid
()
lbl
=
ttk
.
Label
(
self
,
text
=
"ВВЕДИТЕ КОД НУЖНОЙ ЗАПИСИ"
,
font
=
"Helvetica 32 bold"
,
padding
=
10
)
.
grid
(
column
=
0
,
row
=
0
)
lbl
=
ttk
.
Label
(
self
,
text
=
"ВВЕДИТЕ КОД НУЖНОЙ ЗАПИСИ"
,
font
=
"Helvetica 32 bold"
,
padding
=
10
)
.
grid
(
column
=
0
,
row
=
0
)
self
.
command
=
tkinter
.
StringVar
()
self
.
command
=
tkinter
.
StringVar
()
entry
=
ttk
.
Entry
(
self
,
textvariable
=
self
.
command
,
font
=
"Helvetica 32"
)
self
.
entry
=
ttk
.
Entry
(
self
,
textvariable
=
self
.
command
,
font
=
"Helvetica 32"
)
entry
.
grid
(
column
=
1
,
row
=
0
)
self
.
entry
.
grid
(
column
=
1
,
row
=
0
)
entry
.
focus
()
self
.
entry
.
focus
()
self
.
bind
(
"<Return>"
,
self
.
handle_command
)
self
.
bind
(
"<Return>"
,
self
.
handle_command
)
self
.
bind
(
"<Escape>"
,
self
.
handle_esc
)
self
.
bind
(
"<Escape>"
,
self
.
handle_esc
)
...
@@ -28,7 +35,32 @@ class App(tkinter.Tk):
...
@@ -28,7 +35,32 @@ class App(tkinter.Tk):
def
handle_command
(
self
,
arg
):
def
handle_command
(
self
,
arg
):
log
.
info
(
self
.
command
.
get
())
log
.
info
(
self
.
command
.
get
())
log
.
info
(
arg
)
log
.
info
(
arg
)
for
name
in
self
.
sheetnames
:
sheet
=
self
.
data
.
get_sheet_by_name
(
name
)
log
.
info
(
"find in: "
+
sheet
.
title
)
for
cellObj
in
sheet
[
"A2:A"
+
str
(
sheet
.
max_row
)]:
for
cell
in
cellObj
:
# log.info(str(cell.value) + " - " + self.command.get())
if
(
str
(
cell
.
value
)
==
self
.
command
.
get
()):
log
.
info
(
"value '{}' finded by row '{}'. coordinate: {}"
.
format
(
cell
.
value
,
cell
.
row
,
cell
.
coordinate
))
file_media_name
=
sheet
.
cell
(
row
=
cell
.
row
,
column
=
3
)
.
value
log
.
info
(
file_media_name
)
command
=
"vlc "
+
file_media_name
log
.
info
(
command
)
os
.
system
.
__call__
(
command
)
sys
.
exit
()
break
log
.
info
(
"Запись не найдена"
)
messagebox
.
showwarning
(
"ВНИМАНИЕ"
,
"ЗАПИСЬ ПО КОМАНДЕ '{}' НЕ НАЙДЕНА"
.
format
(
self
.
command
.
get
()))
self
.
command
.
set
(
""
)
def
handle_esc
(
self
,
arg
):
def
handle_esc
(
self
,
arg
):
log
.
info
(
arg
)
log
.
info
(
arg
)
sys
.
exit
()
sys
.
exit
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment