Changeset c832ca5d46a6…
Parent e6cd0f3920fe…
by
Changes to one file · Browse files at c832ca5d46a6 Showing diff from parent e6cd0f3920fe Diff from another changeset...
@@ -5,6 +5,10 @@ # This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
+import atexit
+import shutil
+import tempfile
+
from PyQt4 import QtCore, QtGui
from mercurial import extensions
@@ -12,6 +16,17 @@from tortoisehg.hgqt.i18n import _
from hgext.color import _styles
+tmproot = None
+def gettempdir():
+ global tmproot
+ def cleanup():
+ try: shutil.rmtree(tmproot)
+ except: pass
+ if not tmproot:
+ tmproot = tempfile.mkdtemp(prefix='thg.')
+ atexit.register(cleanup)
+ return tmproot
+
# _styles maps from ui labels to effects
# _effects maps an effect to font style properties. We define a limited
# set of _effects, since we convert color effect names to font style
|
Loading...