Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
py-vlcclient
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
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
rasky
py-vlcclient
Commits
01619428
Commit
01619428
authored
Jun 15, 2012
by
Michael Mayr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improved CLI handling
parent
c9355432
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
6 deletions
+14
-6
vlcclient.py
vlcclient.py
+14
-6
No files found.
vlcclient.py
View file @
01619428
...
@@ -169,17 +169,25 @@ class OldServerVersion(Exception):
...
@@ -169,17 +169,25 @@ class OldServerVersion(Exception):
pass
pass
def
main
():
def
main
():
vlc
=
VLCClient
(
"ubuntu.local"
)
"""Run any commands via CLI interface"""
vlc
.
connect
()
print
"Connected to VLC {0}"
.
format
(
vlc
.
server_version
)
try
:
try
:
command
=
getattr
(
vlc
,
sys
.
argv
[
1
])
server
=
sys
.
argv
[
1
]
if
':'
in
server
:
server
,
port
=
server
.
split
(
':'
)
else
:
port
=
4212
command_name
=
sys
.
argv
[
2
]
except
IndexError
:
except
IndexError
:
print
"usage: vlcclient.py command [argument]"
print
"usage: vlcclient.py
server[:port]
command [argument]"
sys
.
exit
(
1
)
sys
.
exit
(
1
)
vlc
=
VLCClient
(
server
,
int
(
port
))
vlc
.
connect
()
print
"Connected to VLC {0}"
.
format
(
vlc
.
server_version
)
try
:
try
:
command
=
getattr
(
vlc
,
command_name
)
attr
=
sys
.
argv
[
2
]
if
len
(
sys
.
argv
)
>
2
else
None
attr
=
sys
.
argv
[
2
]
if
len
(
sys
.
argv
)
>
2
else
None
try
:
try
:
print
command
(
attr
)
print
command
(
attr
)
...
...
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