[pitivi] utils: Remove unused uri_is_reachable method
- From: Alexandru Băluț <alexbalut src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi] utils: Remove unused uri_is_reachable method
- Date: Mon, 3 Oct 2016 13:05:15 +0000 (UTC)
commit 4895d2a65e1a9dfab02b89bb42b19984ddcd3849
Author: Alexandru Băluț <alexandru balut gmail com>
Date: Mon Oct 3 11:56:04 2016 +0200
utils: Remove unused uri_is_reachable method
Reviewed-by: Thibault Saunier <tsaunier gnome org>
Differential Revision: https://phabricator.freedesktop.org/D1341
pitivi/utils/misc.py | 17 -----------------
tests/test_project.py | 5 ++---
2 files changed, 2 insertions(+), 20 deletions(-)
---
diff --git a/pitivi/utils/misc.py b/pitivi/utils/misc.py
index 19a6d29..af240ad 100644
--- a/pitivi/utils/misc.py
+++ b/pitivi/utils/misc.py
@@ -130,23 +130,6 @@ def uri_is_valid(uri):
len(os.path.basename(Gst.uri_get_location(uri))) > 0)
-def uri_is_reachable(uri):
- """Checks whether the specified URI is reachable by GStreamer.
-
- Args:
- uri (str): The location to check.
-
- Returns:
- bool: True when the URI is reachable, False otherwise.
- """
- if not uri_is_valid(uri):
- raise NotImplementedError(
- # Translators: "non local" means the project is not stored
- # on a local filesystem
- _("%s doesn't yet handle non-local projects") % APPNAME)
- return os.path.isfile(Gst.uri_get_location(uri))
-
-
def path_from_uri(raw_uri):
"""Returns a path that can be used with Python's os.path."""
uri = urlparse(raw_uri)
diff --git a/tests/test_project.py b/tests/test_project.py
index ee402c4..d37c66d 100644
--- a/tests/test_project.py
+++ b/tests/test_project.py
@@ -29,7 +29,6 @@ from gi.repository import Gst
from pitivi.project import Project
from pitivi.project import ProjectManager
-from pitivi.utils.misc import uri_is_reachable
from tests import common
@@ -227,14 +226,14 @@ class TestProjectManager(TestCase):
# Save the project.
self.assertTrue(self.manager.saveProject(uri=uri, backup=False))
- self.assertTrue(uri_is_reachable(uri))
+ self.assertTrue(os.path.isfile(path))
# Wait a bit.
time.sleep(0.1)
# Save the project at a new location.
self.assertTrue(self.manager.saveProject(uri2, backup=False))
- self.assertTrue(uri_is_reachable(uri2))
+ self.assertTrue(os.path.isfile(path2))
# Make sure the old path and the new path have different mtimes.
mtime = os.path.getmtime(path)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]