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
592fe665
Commit
592fe665
authored
Dec 19, 2021
by
mihkevich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add interface for enter command and modify logger (added logs dir and it add to gitignore)
parent
229caa36
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
48 additions
and
8 deletions
+48
-8
.gitignore
.gitignore
+5
-2
data.xlsx
data.xlsx
+0
-0
main.py
main.py
+33
-5
my_logger.py
my_logger.py
+10
-1
No files found.
.gitignore
View file @
592fe665
/.idea
/.idea
/*.log
/logs
\ No newline at end of file
__pycache__/my_logger.cpython-39.pyc
__pycache__/settings.cpython-39.pyc
.~lock.data.xlsx#
data.xlsx
0 → 100644
View file @
592fe665
File added
main.py
View file @
592fe665
...
@@ -5,11 +5,38 @@ import os
...
@@ -5,11 +5,38 @@ import os
import
sys
import
sys
import
traceback
import
traceback
import
settings
import
settings
from
openpyxl
import
load_workbook
import
tkinter
from
tkinter
import
ttk
class
App
(
tkinter
.
Tk
):
def
__init__
(
self
,
*
args
,
**
kwargs
):
tkinter
.
Tk
.
__init__
(
self
,
*
args
,
**
kwargs
)
self
.
grid
()
lbl
=
ttk
.
Label
(
self
,
text
=
"ВВЕДИТЕ КОД НУЖНОЙ ЗАПИСИ"
,
font
=
"Helvetica 32 bold"
,
padding
=
10
)
.
grid
(
column
=
0
,
row
=
0
)
self
.
command
=
tkinter
.
StringVar
()
entry
=
ttk
.
Entry
(
self
,
textvariable
=
self
.
command
,
font
=
"Helvetica 32"
)
entry
.
grid
(
column
=
1
,
row
=
0
)
entry
.
focus
()
self
.
bind
(
"<Return>"
,
self
.
handle_command
)
self
.
bind
(
"<Escape>"
,
self
.
handle_esc
)
def
handle_command
(
self
,
arg
):
log
.
info
(
self
.
command
.
get
())
log
.
info
(
arg
)
def
handle_esc
(
self
,
arg
):
log
.
info
(
arg
)
sys
.
exit
()
try
:
try
:
while
True
:
app
=
App
()
log
.
info
(
"Hello World "
)
app
.
mainloop
(
)
sleep
(
3
)
except
Exception
as
e
:
except
KeyboardInterrupt
as
e
:
log
.
error
(
log
.
get_line
())
log
.
info
(
"Stopping..."
)
sys
.
exit
(
)
\ No newline at end of file
my_logger.py
View file @
592fe665
...
@@ -6,7 +6,16 @@ import sys
...
@@ -6,7 +6,16 @@ import sys
class
Log
:
class
Log
:
def
__init__
(
self
):
def
__init__
(
self
):
self
.
logfile
=
"{}/{}_main.log"
.
format
(
os
.
path
.
dirname
(
sys
.
argv
[
0
]),
datetime
.
datetime
.
now
()
.
strftime
(
"
%
m_
%
d_
%
Y
%
H_
%
M_
%
S"
))
# init log file #
self
.
exec_dir
=
os
.
path
.
dirname
(
sys
.
argv
[
0
])
try
:
os
.
mkdir
(
"{}/logs"
.
format
(
self
.
exec_dir
))
except
FileExistsError
as
e
:
pass
self
.
logfile
=
"{}/logs/{}_main.log"
.
format
(
self
.
exec_dir
,
datetime
.
datetime
.
now
()
.
strftime
(
"
%
m_
%
d_
%
Y
%
H_
%
M_
%
S"
))
self
.
log
=
logging
.
getLogger
(
"my_log"
)
self
.
log
=
logging
.
getLogger
(
"my_log"
)
self
.
log
.
setLevel
(
logging
.
INFO
)
self
.
log
.
setLevel
(
logging
.
INFO
)
...
...
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