Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
S
SHMCamStudio
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
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
SexHackMe
SHMCamStudio
Commits
9b7a4469
Commit
9b7a4469
authored
Dec 02, 2024
by
nextime
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
run_action in panel
parent
fff8557b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
5 deletions
+23
-5
shmcamstudio
shmcamstudio
+5
-1
shmcamstudio.conf
shmcamstudio.conf
+4
-1
panel.py
shmcs/panel.py
+4
-3
utils.py
shmcs/utils.py
+10
-0
No files found.
shmcamstudio
View file @
9b7a4469
...
@@ -27,12 +27,16 @@ import threading
...
@@ -27,12 +27,16 @@ import threading
import
logging
import
logging
import
subprocess
import
subprocess
import
queue
# Read configuration
# Read configuration
config
=
configparser
.
ConfigParser
()
config
=
configparser
.
ConfigParser
()
config
.
read
(
'shmcamstudio.conf'
)
config
.
read
(
'shmcamstudio.conf'
)
qcore
=
queue
.
Queue
()
builtins
.
qcore
=
qcore
builtins
.
config
=
config
builtins
.
config
=
config
# Setup logging
# Setup logging
...
...
shmcamstudio.conf
View file @
9b7a4469
...
@@ -121,10 +121,13 @@ color = teal
...
@@ -121,10 +121,13 @@ color = teal
[
BUTTON
:
3
:
scene_manual
]
[
BUTTON
:
3
:
scene_manual
]
title
=
SCENE
MANUAL
title
=
SCENE
MANUAL
action
=
open_al
l
action
=
scene_manua
l
color
=
blue
color
=
blue
[
ACTION
:
scene_manual
]
setstatus
=
manual
[
ACTION
:
private_shine
]
[
ACTION
:
private_shine
]
execute
= /
usr
/
local
/
bin
/
smblur_private
execute
= /
usr
/
local
/
bin
/
smblur_private
...
...
shmcs/panel.py
View file @
9b7a4469
...
@@ -19,8 +19,9 @@ import vlc
...
@@ -19,8 +19,9 @@ import vlc
import
webbrowser
import
webbrowser
import
sys
import
sys
import
os
import
os
from
utils
import
run_command
from
utils
import
run_command
,
run_action
from
guiutils
import
get_buttons
from
guiutils
import
get_buttons
import
queue
class
VideoPlayer
:
class
VideoPlayer
:
def
__init__
(
self
,
master
,
video_url
):
def
__init__
(
self
,
master
,
video_url
):
...
@@ -102,11 +103,11 @@ def create_panel_gui():
...
@@ -102,11 +103,11 @@ def create_panel_gui():
command
=
None
command
=
None
if
config
.
has_section
(
'ACTION:'
+
buttons
[
row
][
b
][
'action'
]):
if
config
.
has_section
(
'ACTION:'
+
buttons
[
row
][
b
][
'action'
]):
command
=
config
.
get
(
'ACTION:'
+
buttons
[
row
][
b
][
'action'
],
'execute'
,
fallback
=
None
)
command
=
config
.
get
(
'ACTION:'
+
buttons
[
row
][
b
][
'action'
],
'execute'
,
fallback
=
None
)
setstatus
=
config
.
get
(
'ACTION:'
+
buttons
[
row
][
b
][
'action'
],
'setstatus'
,
fallback
=
None
)
color
=
buttons
[
row
][
b
][
'color'
]
color
=
buttons
[
row
][
b
][
'color'
]
print
(
command
)
button
=
tk
.
Button
(
bframes
[
row
],
text
=
buttons
[
row
][
b
][
'title'
],
font
=
helv36
,
width
=
bw
,
height
=
bh
,
bg
=
color
,
fg
=
"white"
,
button
=
tk
.
Button
(
bframes
[
row
],
text
=
buttons
[
row
][
b
][
'title'
],
font
=
helv36
,
width
=
bw
,
height
=
bh
,
bg
=
color
,
fg
=
"white"
,
command
=
lambda
cmd
=
command
:
run_command
(
cmd
))
command
=
lambda
cmd
=
command
,
sts
=
setstatus
:
run_action
(
cmd
,
sts
))
button
.
grid
(
row
=
0
,
column
=
col
,
sticky
=
'nsew'
)
button
.
grid
(
row
=
0
,
column
=
col
,
sticky
=
'nsew'
)
col
=
col
+
1
col
=
col
+
1
...
...
shmcs/utils.py
View file @
9b7a4469
...
@@ -17,6 +17,8 @@ import subprocess
...
@@ -17,6 +17,8 @@ import subprocess
import
socket
import
socket
import
os
import
os
import
sys
import
sys
import
queue
def
run_command
(
command
):
def
run_command
(
command
):
try
:
try
:
...
@@ -29,6 +31,14 @@ def run_command(command):
...
@@ -29,6 +31,14 @@ def run_command(command):
return
f
"Error: {e}"
return
f
"Error: {e}"
def
run_action
(
command
,
setstatus
=
None
):
if
setstatus
:
print
(
'SETSTATUS:'
+
str
(
setstatus
))
qcore
.
put
(
'SETSTATUS:'
+
str
(
setstatus
))
if
command
:
return
run_command
(
command
)
def
check_port_available
(
port
):
def
check_port_available
(
port
):
"""Check if a port is available"""
"""Check if a port is available"""
...
...
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