Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
RaspberryNode
Project
Project
Details
Activity
Releases
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
簡碩辰
RaspberryNode
Commits
6d92d185
Commit
6d92d185
authored
Oct 03, 2019
by
簡碩辰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update run.py
parent
2a4bfc60
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
run.py
dvr/ffmpeg/run.py
+4
-3
No files found.
dvr/ffmpeg/run.py
View file @
6d92d185
import
json
,
os
,
socket
,
time
,
datetime
,
pytz
,
subprocess
as
SP
from
paho.mqtt.client
import
Client
as
MQTT
from
colorama
import
Fore
,
Back
,
Style
def
TryConnect
(
tag
,
host
,
port
):
now
=
datetime
.
datetime
.
now
(
tz
=
pytz
.
timezone
(
'Asia/Taipei'
))
...
...
@@ -12,13 +13,13 @@ def TryConnect(tag, host, port):
s
.
shutdown
(
socket
.
SHUT_RDWR
)
print
(
"[{0}][{1}][{2}:{3}]: Connec
ted"
.
format
(
now
,
tag
,
host
,
port
))
print
(
Fore
.
RESET
+
"[{0}][{1}][{2}:{3}]: Connection Test Comple
ted"
.
format
(
now
,
tag
,
host
,
port
))
return
True
except
ConnectionRefusedError
:
print
(
"[{0}][{1}][{2}:{3}]: Connection Refused Error"
.
format
(
now
,
tag
,
host
,
port
))
print
(
Fore
.
RED
+
"[{0}][{1}][{2}:{3}]: Connection Refused Error"
.
format
(
now
,
tag
,
host
,
port
))
except
:
print
(
"[{0}][{1}][{2}:{3}]: Unknown Error"
.
format
(
now
,
tag
,
host
,
port
))
print
(
Fore
.
RED
+
"[{0}][{1}][{2}:{3}]: Unknown Error"
.
format
(
now
,
tag
,
host
,
port
))
return
False
user
=
os
.
getenv
(
"DVR_USER"
)
...
...
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