Address errors, improvements, formatting
- Removed unused code not portable due to buffer() use - raw_input() does not exist in Python 3 - Fixed octal constant syntax for Python 3 - Fixed TypeError - Replace if not exists: makedirs(path) with single call: using makedirs(path, exist_ok=True) - Class inherits from object, can be safely removed from bases in python3: pylint's useless-object-inheritance (W0235) check Signed-off-by: JoeLametta <JoeLametta@users.noreply.github.com>
This commit is contained in:
@@ -19,14 +19,13 @@
|
||||
# along with whipper. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from os import getenv, makedirs
|
||||
from os.path import join, expanduser, exists
|
||||
from os.path import join, expanduser
|
||||
|
||||
|
||||
def config_path():
|
||||
path = join(getenv('XDG_CONFIG_HOME') or join(expanduser('~'), '.config'),
|
||||
'whipper')
|
||||
if not exists(path):
|
||||
makedirs(path)
|
||||
makedirs(path, exist_ok=True)
|
||||
return join(path, 'whipper.conf')
|
||||
|
||||
|
||||
@@ -35,8 +34,7 @@ def cache_path(name=None):
|
||||
'whipper')
|
||||
if name:
|
||||
path = join(path, name)
|
||||
if not exists(path):
|
||||
makedirs(path)
|
||||
makedirs(path, exist_ok=True)
|
||||
return path
|
||||
|
||||
|
||||
@@ -46,6 +44,5 @@ def data_path(name=None):
|
||||
'whipper')
|
||||
if name:
|
||||
path = join(path, name)
|
||||
if not exists(path):
|
||||
makedirs(path)
|
||||
makedirs(path, exist_ok=True)
|
||||
return path
|
||||
|
||||
Reference in New Issue
Block a user