From 9f5eeff72146d3c5178d66b4879af7a6abfc22f1 Mon Sep 17 00:00:00 2001 From: nfnty Date: Sat, 21 Jan 2017 22:30:59 +0100 Subject: Python 3 division: Import `division` from `__future__` --- tests/ranger/container/test_bookmarks.py | 2 +- tests/ranger/container/test_container.py | 2 +- tests/ranger/container/test_fsobject.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/ranger/container/test_bookmarks.py b/tests/ranger/container/test_bookmarks.py index d5bafc6c..6fba2a3d 100644 --- a/tests/ranger/container/test_bookmarks.py +++ b/tests/ranger/container/test_bookmarks.py @@ -1,4 +1,4 @@ -from __future__ import (absolute_import, print_function) +from __future__ import (absolute_import, division, print_function) import os import time diff --git a/tests/ranger/container/test_container.py b/tests/ranger/container/test_container.py index 2af96592..b5a1b389 100644 --- a/tests/ranger/container/test_container.py +++ b/tests/ranger/container/test_container.py @@ -1,4 +1,4 @@ -from __future__ import (absolute_import, print_function) +from __future__ import (absolute_import, division, print_function) from ranger.container import history diff --git a/tests/ranger/container/test_fsobject.py b/tests/ranger/container/test_fsobject.py index 8fe385c0..2c6a693f 100644 --- a/tests/ranger/container/test_fsobject.py +++ b/tests/ranger/container/test_fsobject.py @@ -1,4 +1,4 @@ -from __future__ import (absolute_import, print_function) +from __future__ import (absolute_import, division, print_function) import operator -- cgit 1.4.1-2-gfad0 /andinus/cetus/diff/cache/getdir_unix.go?h=v0.6.3&id=3c77b9c4b72350f25e61431c8b101bd9948a455a'>diff stats
path: root/cache/getdir_unix.go
blob: 62dd5ed57664399b4e00bd9123cfa354f63e7908 (plain) (tree)























                                                                   
                                                       



                            
// +build linux netbsd openbsd freebsd dragonfly

package cache

import (
	"fmt"
	"os"
)

// GetDir returns cetus cache directory. Check if the user has set
// CETUS_CACHE_DIR, if not then check if XDG_CACHE_HOME is set & if
// that is not set then assume it to be the default value which is
// $HOME/.cache according to XDG Base Directory Specification.
func GetDir() string {
	cacheDir := os.Getenv("CETUS_CACHE_DIR")
	if len(cacheDir) == 0 {
		cacheDir = os.Getenv("XDG_CACHE_HOME")
	}
	if len(cacheDir) == 0 {
		cacheDir = fmt.Sprintf("%s/%s", os.Getenv("HOME"),
			".cache")
	}

	// Cetus cache directory is cacheDir/cetus.
	cetusCacheDir := fmt.Sprintf("%s/%s", cacheDir,
		"cetus")

	return cetusCacheDir
}