Skip to content

Commit

Permalink
Merge opentimestamps#79: Use appdirs library to determine dir locations
Browse files Browse the repository at this point in the history
118ffb0 Use appdirs library to determine dir locations (Peter Todd)

Pull request description:

  Currently only applicable to the `~/.cache/ots` directory; changes behavior from previous on MacOS and Windows.

  @RCasatta IIRC you have a Mac; mind testing that this works properly on it? I want to make this change to in the future use appropriate appdirs for config files.

Tree-SHA512: 198e1e8412cf586254121c361850e994253ae5f7f5a9b2b5324371c003ca4fa6ab085abcd7c536bf3657bfb28e4beb5ca4e0ef8b5d7e850b4107c73ee7bea7fc
  • Loading branch information
petertodd committed Mar 16, 2018
2 parents ec39f2c + 118ffb0 commit a239986
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
8 changes: 5 additions & 3 deletions otsclient/args.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2016 The OpenTimestamps developers
# Copyright (C) 2016-2018 The OpenTimestamps developers
#
# This file is part of the OpenTimestamps Client.
#
Expand All @@ -9,19 +9,21 @@
# modified, propagated, or distributed except according to the terms contained
# in the LICENSE file.

import appdirs
import argparse
import bitcoin
import logging
import os
import sys
import socket
import sys

import opentimestamps.calendar

import otsclient
import otsclient.cache
import otsclient.cmds

APPDIRS = appdirs.AppDirs('ots','opentimestamps')

def make_common_options_arg_parser():
parser = argparse.ArgumentParser(description="OpenTimestamps client.")
Expand All @@ -42,7 +44,7 @@ def make_common_options_arg_parser():
cache_group = parser.add_mutually_exclusive_group()
cache_group.add_argument("--cache", action="store", type=str,
dest='cache_path',
default='~/.cache/ots',
default=APPDIRS.user_cache_dir,
help="Location of the timestamp cache. Default: %(default)s")
cache_group.add_argument("--no-cache", action="store_const", const=None,
dest='cache_path',
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
opentimestamps>=0.2.0,<0.3.0
appdirs>=1.3.0
GitPython>=2.0.8
PySocks>=1.5.0
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
# requirements files see:
# https://packaging.python.org/en/latest/requirements.html
install_requires=['opentimestamps>=0.2.0,<0.3.0',
'appdirs>=1.3.0',
'GitPython>=2.0.8',
'PySocks>=1.5.0'],

Expand Down

0 comments on commit a239986

Please sign in to comment.