[pitivi] tempfiles: Use a /tmp subdirectory for temporary files.
- From: Edward Hervey <edwardrv src gnome org>
- To: svn-commits-list gnome org
- Subject: [pitivi] tempfiles: Use a /tmp subdirectory for temporary files.
- Date: Fri, 10 Jul 2009 11:51:29 +0000 (UTC)
commit 539e4f7825488cba1a3d88b62f9432b0cb04dc00
Author: Jan Gerber <j bootlab org>
Date: Fri Jul 10 13:49:39 2009 +0200
tempfiles: Use a /tmp subdirectory for temporary files.
pitivi/discoverer.py | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/pitivi/discoverer.py b/pitivi/discoverer.py
index 2692bb8..5aba1fd 100644
--- a/pitivi/discoverer.py
+++ b/pitivi/discoverer.py
@@ -463,8 +463,15 @@ class Discoverer(Signallable, Loggable):
if format == gst.FORMAT_TIME:
self.current_duration = duration
- def _getThumbnailFilenameFromPad(self, pad):
+ def _gettempdir(self):
tmp = tempfile.gettempdir()
+ tmp = os.path.join(tmp, 'pitivi-%s' % os.getenv('USER'))
+ if not os.path.exists(tmp):
+ os.mkdir(tmp)
+ return tmp
+
+ def _getThumbnailFilenameFromPad(self, pad):
+ tmp = self._gettempdir()
name = '%s.%s' % (self.current_uri, pad.get_name())
name = urlsafe_b64encode(name) + '.png'
filename = os.path.join(tmp, name)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]