mirror of
https://github.com/gryf/softtoken.git
synced 2025-12-19 12:28:09 +01:00
configuration filed changed to ~/.softtoken.conf
This commit is contained in:
9
setup.py
9
setup.py
@@ -1,8 +1,8 @@
|
|||||||
from setuptools import setup, find_packages
|
from setuptools import setup, find_packages
|
||||||
from codecs import open
|
from codecs import open
|
||||||
from os import path
|
from os import path
|
||||||
from softtoken.softtoken import __version__
|
|
||||||
|
|
||||||
|
__version__ = '0.0.1'
|
||||||
here = path.abspath(path.dirname(__file__))
|
here = path.abspath(path.dirname(__file__))
|
||||||
|
|
||||||
# Get the long description from the README file
|
# Get the long description from the README file
|
||||||
@@ -57,16 +57,9 @@ setup(
|
|||||||
py_modules=['softtoken.softtoken'],
|
py_modules=['softtoken.softtoken'],
|
||||||
install_requires=[
|
install_requires=[
|
||||||
'configparser==3.5.0',
|
'configparser==3.5.0',
|
||||||
'flake8==2.5.5',
|
|
||||||
'hacking==0.11.0',
|
|
||||||
'mccabe==0.2.1',
|
|
||||||
'pbr>=1.6',
|
'pbr>=1.6',
|
||||||
'pep8==1.5.7',
|
|
||||||
'pyflakes==0.8.1',
|
|
||||||
'pyotp==2.2.1',
|
'pyotp==2.2.1',
|
||||||
'python-xlib==0.17',
|
|
||||||
'PyUserInput==0.1.11',
|
'PyUserInput==0.1.11',
|
||||||
'six==1.10.0'
|
|
||||||
],
|
],
|
||||||
# extras_require={
|
# extras_require={
|
||||||
# 'dev': ['check-manifest'],
|
# 'dev': ['check-manifest'],
|
||||||
|
|||||||
@@ -26,22 +26,18 @@ import pyotp
|
|||||||
|
|
||||||
__version__ = '0.0.1'
|
__version__ = '0.0.1'
|
||||||
|
|
||||||
CONFIG_FILE = 'softtoken.conf'
|
CONFIG_FILE = '.softtoken.conf'
|
||||||
|
|
||||||
|
|
||||||
def load_config():
|
def load_config():
|
||||||
dir_path = path.join(
|
dir_path = path.join(path.expanduser('~'), CONFIG_FILE)
|
||||||
path.dirname(path.realpath(__file__)),
|
|
||||||
CONFIG_FILE)
|
|
||||||
cfg = configparser.SafeConfigParser()
|
cfg = configparser.SafeConfigParser()
|
||||||
cfg.read(dir_path)
|
cfg.read(dir_path)
|
||||||
return cfg
|
return cfg
|
||||||
|
|
||||||
|
|
||||||
def save_config(cfg):
|
def save_config(cfg):
|
||||||
dir_path = path.join(
|
dir_path = path.join(path.expanduser('~'), CONFIG_FILE)
|
||||||
path.dirname(path.realpath(__file__)),
|
|
||||||
CONFIG_FILE)
|
|
||||||
try:
|
try:
|
||||||
with open(dir_path, 'w+') as configfile:
|
with open(dir_path, 'w+') as configfile:
|
||||||
cfg.write(configfile)
|
cfg.write(configfile)
|
||||||
|
|||||||
Reference in New Issue
Block a user