Author: dmeyer
Date: Wed Feb 13 14:27:15 2008
New Revision: 3077

Log:
remove kaa.TEMP and updated code using it

Modified:
   trunk/base/src/__init__.py
   trunk/base/src/rpc.py
   trunk/beacon/src/server/thumbnailer.py
   trunk/epg/src/sources/epgdata.py
   trunk/epg/src/sources/xmltv.py
   trunk/popcorn/src/backends/mplayer/player.py

Modified: trunk/base/src/__init__.py
==============================================================================
--- trunk/base/src/__init__.py  (original)
+++ trunk/base/src/__init__.py  Wed Feb 13 14:27:15 2008
@@ -34,8 +34,8 @@
 # strutils
 import strutils
 
-# tempfile support. FIXME: remove TEMP when no longer used
-from tmpfile import tempfile, TEMP
+# tempfile support.
+from tmpfile import tempfile
 
 # Expose main loop functions under kaa.main
 from kaa.notifier import main

Modified: trunk/base/src/rpc.py
==============================================================================
--- trunk/base/src/rpc.py       (original)
+++ trunk/base/src/rpc.py       Wed Feb 13 14:27:15 2008
@@ -160,7 +160,7 @@
         if type(address) in types.StringTypes:
             if address.find('/') == -1:
                 # create socket in kaa temp dir
-                address = '%s/%s' % (kaa.TEMP, address)
+                address = kaa.tempfile(address)
 
             if os.path.exists(address):
                 # maybe a server is already running at this address, test it
@@ -804,7 +804,7 @@
     """
     def __init__(self, address, auth_secret = '', bufsize = None):
         if type(address) in types.StringTypes:
-            address = '%s/%s' % (kaa.TEMP, address)
+            address = kaa.tempfile(address)
             fd = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
         if type(address) == tuple:
             fd = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

Modified: trunk/beacon/src/server/thumbnailer.py
==============================================================================
--- trunk/beacon/src/server/thumbnailer.py      (original)
+++ trunk/beacon/src/server/thumbnailer.py      Wed Feb 13 14:27:15 2008
@@ -275,7 +275,7 @@
     global thumbnailer
 
     # create tmp dir and change directory to it
-    tmpdir = os.path.join(kaa.TEMP, 'thumb')
+    tmpdir = kaa.tempfile('thumb')
     if not os.path.isdir(tmpdir):
         os.mkdir(tmpdir)
     os.chdir(tmpdir)

Modified: trunk/epg/src/sources/epgdata.py
==============================================================================
--- trunk/epg/src/sources/epgdata.py    (original)
+++ trunk/epg/src/sources/epgdata.py    Wed Feb 13 14:27:15 2008
@@ -40,8 +40,8 @@
 
 # kaa imports
 import kaa
-from kaa import TEMP
 
+# config file
 from config_epgdata import config
 
 # get logging object
@@ -218,7 +218,7 @@
         return False
 
     # create a tempdir as working area
-    tempdir = os.path.join(TEMP, 'epgdata')
+    tempdir = kaa.tempfile('epgdata')
     if not os.path.isdir(tempdir):
         os.mkdir(tempdir)
     # and clear it if needed
@@ -228,7 +228,7 @@
     # temp file
     tmpfile = os.path.join(tempdir,'temp.zip')
     # logfile
-    logfile = os.path.join(TEMP,'epgdata.log')
+    logfile = kaa.tempfile('epgdata.log')
 
     # empty list for the xml docs
     docs = []

Modified: trunk/epg/src/sources/xmltv.py
==============================================================================
--- trunk/epg/src/sources/xmltv.py      (original)
+++ trunk/epg/src/sources/xmltv.py      Wed Feb 13 14:27:15 2008
@@ -40,8 +40,8 @@
 
 # kaa imports
 import kaa
-from kaa import TEMP
 
+# config file
 from config_xmltv import config
 
 # get logging object
@@ -289,10 +289,10 @@
     from kaa.epg.config import config as epg_config
     if config.grabber:
         log.info('grabbing listings using %s', config.grabber)
-        xmltv_file = os.path.join(TEMP, 'TV.xml')
+        xmltv_file = kaa.tempfile('TV.xml')
         if config.data_file:
             xmltv_file = config.data_file
-        log_file = os.path.join(TEMP, 'TV.xml.log')
+        log_file = kaa.tempfile('TV.xml.log')
         # TODO: using os.system is ugly because it blocks ... but we can make 
this
         # nicer using kaa.Process later. We are inside a thread so it
         # seems to be ok.

Modified: trunk/popcorn/src/backends/mplayer/player.py
==============================================================================
--- trunk/popcorn/src/backends/mplayer/player.py        (original)
+++ trunk/popcorn/src/backends/mplayer/player.py        Wed Feb 13 14:27:15 2008
@@ -513,9 +513,7 @@
         # non-existent) command which causes MPlayer not to react to any key
         # presses, allowing us to implement our own handlers.  The temp file is
         # deleted once MPlayer has read it.
-        if not os.path.isdir(os.path.join(kaa.TEMP, 'popcorn')):
-            os.mkdir(os.path.join(kaa.TEMP, 'popcorn'))
-        tempfile = os.path.join(kaa.TEMP, 'popcorn', 'mplayer-input.conf')
+        tempfile = kaa.tempfile('popcorn/mplayer-input.conf')
         if not os.path.isfile(tempfile):
             keys = filter(lambda x: x not in string.whitespace, 
string.printable)
             keys = list(keys) + self._mp_info["keylist"]

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to