From 4da0355a0e1d7bdc58a4df03409c142c5a0a6b88 Mon Sep 17 00:00:00 2001 From: Vern Sun Date: Wed, 17 Jun 2015 11:23:27 +0800 Subject: honour the TMPDIR environment variable --- ranger/__init__.py | 3 ++- ranger/core/main.py | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ranger/__init__.py b/ranger/__init__.py index e20f55d8..8a1e7459 100644 --- a/ranger/__init__.py +++ b/ranger/__init__.py @@ -10,6 +10,7 @@ program you want to use to open your files with. import sys import os +import tempfile # Information __license__ = 'GPL3' @@ -24,7 +25,7 @@ TIME_BEFORE_FILE_BECOMES_GARBAGE = 1200 MAX_RESTORABLE_TABS = 3 MACRO_DELIMITER = '%' DEFAULT_PAGER = 'less' -LOGFILE = '/tmp/ranger_errorlog' +LOGFILE = tempfile.gettempdir()+'/ranger_errorlog' CACHEDIR = os.path.expanduser("~/.cache/ranger") USAGE = '%prog [options] [path]' VERSION = 'ranger-master %s\n\nPython %s' % (__version__, sys.version) diff --git a/ranger/core/main.py b/ranger/core/main.py index 524a9a19..55102dc2 100644 --- a/ranger/core/main.py +++ b/ranger/core/main.py @@ -5,6 +5,7 @@ import os.path import sys +import tempfile def main(): """initialize objects and run the filemanager""" @@ -133,8 +134,8 @@ def main(): import pstats profile = None ranger.__fm = fm - cProfile.run('ranger.__fm.loop()', '/tmp/ranger_profile') - profile = pstats.Stats('/tmp/ranger_profile', stream=sys.stderr) + cProfile.run('ranger.__fm.loop()', tempfile.gettempdir()+'/ranger_profile') + profile = pstats.Stats(tempfile.gettempdir()+'/ranger_profile', stream=sys.stderr) else: fm.loop() except Exception: -- cgit 1.4.1-2-gfad0 cc?h=main&id=fdd732fb4d7196b3b0ca094193d837243975ca9f'>commit diff stats
path: root/cpp/001trace.test.cc
blob: e0db457c6c3e4048b3bb991b81acbdfa08c120e7 (plain) (tree)