pubs/papers/configs.py
Olivier Mangin 3af7590827 Adds basic import command with document file copy.
Still lot to be improve on ui and features.
2012-12-20 17:56:34 +01:00

33 lines
687 B
Python

import os
import ConfigParser
DEFAULT_OPEN_CMD = 'open'
DEFAULT_EDIT_CMD = 'vim'
DEFAULT_IMPORT_COPY = 'yes'
DEFAULT_IMPORT_MOVE = 'no'
CONFIG = ConfigParser.SafeConfigParser({
'open-cmd': DEFAULT_OPEN_CMD,
'edit-cmd': DEFAULT_EDIT_CMD,
'import-copy': DEFAULT_IMPORT_COPY,
'import-move': DEFAULT_IMPORT_MOVE,
})
CONFIG.add_section('papers')
def read_config():
CONFIG.read(os.path.expanduser('~/.papersrc'))
return CONFIG
def get_boolean(value, default):
value = str(value).lower()
if value in ('yes', 'true', 't', 'y', '1'):
return True
elif value in ('no', 'false', 'f', 'n', '0'):
return False
else:
return 0