add command line script

This commit is contained in:
gcarq 2017-09-28 23:47:51 +02:00
parent 00499fa0d7
commit 998a887736
4 changed files with 18 additions and 2 deletions

4
bin/freqtrade Normal file
View File

@ -0,0 +1,4 @@
#!/usr/bin/env python
import freqtrade
freqtrade.main()

View File

@ -1 +1,3 @@
__version__ = '0.10.0'
from .main import main

View File

@ -232,7 +232,7 @@ def init(config: dict, db_url: Optional[str] = None) -> None:
def app(config: dict) -> None:
"""
Main function which handles the application state
Main loop which handles the application state
:param config: config as dict
:return: None
"""
@ -263,8 +263,17 @@ def app(config: dict) -> None:
telegram.send_msg('*Status:* `Trader has stopped`')
if __name__ == '__main__':
def main():
"""
Loads and validates the config and starts the main loop
:return: None
"""
global _CONF
with open('config.json') as file:
_CONF = json.load(file)
validate(_CONF, CONF_SCHEMA)
app(_CONF)
if __name__ == '__main__':
main()

View File

@ -11,4 +11,5 @@ setup(name='freqtrade',
author_email='michael.egger@tsn.at',
license='GPLv3',
packages=['freqtrade'],
scripts=['bin/freqtrade'],
zip_safe=False)