[vlc-commits] Modify URL vs local path test
Olivier Aubert
git at videolan.org
Fri Apr 27 17:01:06 CEST 2012
vlc/python | branch: master | Olivier Aubert <olivier.aubert at liris.cnrs.fr> | Fri Apr 27 17:00:31 2012 +0200| [d3ea639fe076ccb1395f07402ceccc9ae8a8d575] | committer: Olivier Aubert
Modify URL vs local path test
The previous test could not work on windows.
> http://git.videolan.org/gitweb.cgi/vlc/python.git/?a=commit;h=d3ea639fe076ccb1395f07402ceccc9ae8a8d575
---
generated/vlc.py | 12 ++++++------
override.py | 10 +++++-----
2 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/generated/vlc.py b/generated/vlc.py
index 028b0cb..b982ddf 100755
--- a/generated/vlc.py
+++ b/generated/vlc.py
@@ -48,7 +48,7 @@ import sys
from inspect import getargspec
__version__ = "N/A"
-build_date = "Fri Apr 27 16:47:21 2012"
+build_date = "Fri Apr 27 17:00:20 2012"
# Internal guard to prevent internal classes to be directly
# instanciated.
@@ -905,10 +905,10 @@ class Instance(_Ctype):
def media_new(self, mrl, *options):
"""Create a new Media instance.
- If mrl contains a colon (:), it will be treated as a
- URL. Else, it will be considered as a local path. If you need
- more control, directly use media_new_location/media_new_path
- methods.
+ If mrl contains a colon (:) preceded by more than 1 letter, it
+ will be treated as a URL. Else, it will be considered as a
+ local path. If you need more control, directly use
+ media_new_location/media_new_path methods.
Options can be specified as supplementary string parameters, e.g.
@@ -920,7 +920,7 @@ class Instance(_Ctype):
@param options: optional media option=value strings
"""
- if ':' in mrl:
+ if ':' in mrl and mrl.index(':') > 1:
# Assume it is a URL
m = libvlc_media_new_location(self, mrl)
else:
diff --git a/override.py b/override.py
index 00cf61c..93e85d1 100644
--- a/override.py
+++ b/override.py
@@ -48,10 +48,10 @@ class Instance:
def media_new(self, mrl, *options):
"""Create a new Media instance.
- If mrl contains a colon (:), it will be treated as a
- URL. Else, it will be considered as a local path. If you need
- more control, directly use media_new_location/media_new_path
- methods.
+ If mrl contains a colon (:) preceded by more than 1 letter, it
+ will be treated as a URL. Else, it will be considered as a
+ local path. If you need more control, directly use
+ media_new_location/media_new_path methods.
Options can be specified as supplementary string parameters, e.g.
@@ -63,7 +63,7 @@ class Instance:
@param options: optional media option=value strings
"""
- if ':' in mrl:
+ if ':' in mrl and mrl.index(':') > 1:
# Assume it is a URL
m = libvlc_media_new_location(self, mrl)
else:
More information about the vlc-commits
mailing list