Private GIT
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Sick-Beard
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
vlbox
Sick-Beard
Commits
3eedabf3
Commit
3eedabf3
authored
Jan 27, 2012
by
Jonathon Saine
Browse files
Options
Downloads
Patches
Plain Diff
Require Python 2.5 or higher
PEP8 fixes (whitespace readability)
parent
ddc175ff
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
SickBeard.py
+23
-17
23 additions, 17 deletions
SickBeard.py
with
23 additions
and
17 deletions
SickBeard.py
+
23
−
17
View file @
3eedabf3
...
@@ -18,6 +18,9 @@
...
@@ -18,6 +18,9 @@
# along with Sick Beard. If not, see <http://www.gnu.org/licenses/>.
# along with Sick Beard. If not, see <http://www.gnu.org/licenses/>.
import
sys
import
sys
if
sys
.
version_info
<
(
2
,
5
):
print
"
Sorry, requires Python 2.5 or higher.
"
sys
.
exit
(
1
)
# we only need this for compiling an EXE and I will just always do that on 2.6+
# we only need this for compiling an EXE and I will just always do that on 2.6+
if
sys
.
hexversion
>=
0x020600F0
:
if
sys
.
hexversion
>=
0x020600F0
:
...
@@ -45,6 +48,7 @@ from lib.configobj import ConfigObj
...
@@ -45,6 +48,7 @@ from lib.configobj import ConfigObj
signal
.
signal
(
signal
.
SIGINT
,
sickbeard
.
sig_handler
)
signal
.
signal
(
signal
.
SIGINT
,
sickbeard
.
sig_handler
)
signal
.
signal
(
signal
.
SIGTERM
,
sickbeard
.
sig_handler
)
signal
.
signal
(
signal
.
SIGTERM
,
sickbeard
.
sig_handler
)
def
loadShowsFromDB
():
def
loadShowsFromDB
():
"""
"""
Populates the showList with shows from the database
Populates the showList with shows from the database
...
@@ -63,6 +67,7 @@ def loadShowsFromDB():
...
@@ -63,6 +67,7 @@ def loadShowsFromDB():
#TODO: make it update the existing shows if the showlist has something in it
#TODO: make it update the existing shows if the showlist has something in it
def
daemonize
():
def
daemonize
():
"""
"""
Fork off as a daemon
Fork off as a daemon
...
@@ -89,7 +94,7 @@ def daemonize():
...
@@ -89,7 +94,7 @@ def daemonize():
if
pid
!=
0
:
if
pid
!=
0
:
sys
.
exit
(
0
)
sys
.
exit
(
0
)
except
OSError
,
e
:
except
OSError
,
e
:
raise
RuntimeError
(
"
2
st
fork failed: %s [%d]
"
%
raise
RuntimeError
(
"
2
nd
fork failed: %s [%d]
"
%
(
e
.
strerror
,
e
.
errno
))
(
e
.
strerror
,
e
.
errno
))
dev_null
=
file
(
'
/dev/null
'
,
'
r
'
)
dev_null
=
file
(
'
/dev/null
'
,
'
r
'
)
...
@@ -100,6 +105,7 @@ def daemonize():
...
@@ -100,6 +105,7 @@ def daemonize():
logger
.
log
(
u
"
Writing PID
"
+
pid
+
"
to
"
+
str
(
sickbeard
.
PIDFILE
))
logger
.
log
(
u
"
Writing PID
"
+
pid
+
"
to
"
+
str
(
sickbeard
.
PIDFILE
))
file
(
sickbeard
.
PIDFILE
,
'
w
'
).
write
(
"
%s
\n
"
%
pid
)
file
(
sickbeard
.
PIDFILE
,
'
w
'
).
write
(
"
%s
\n
"
%
pid
)
def
main
():
def
main
():
"""
"""
TV for me
TV for me
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment