added travis config, communicator now can start in debug+dev mode

This commit is contained in:
Kevin Froman 2018-01-14 21:58:32 -06:00
parent 9853a4ce47
commit e1aea96f11
No known key found for this signature in database
GPG Key ID: 0D414D0FE405B63B
2 changed files with 13 additions and 2 deletions

7
.travis.yml Normal file
View File

@ -0,0 +1,7 @@
language: python
python:
- "3.6.4"
# install dependencies
install:
- pip install -r requirements.txt
script: ./tests.py

View File

@ -19,7 +19,7 @@ and code to operate as a daemon, getting commands from the command queue databas
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
'''
import sqlite3, requests, hmac, hashlib, time, sys
import sqlite3, requests, hmac, hashlib, time, sys, os
import core
class OnionrCommunicate:
def __init__(self):
@ -47,10 +47,14 @@ class OnionrCommunicate:
response = r.text
return response
shouldRun = False
debug = False
developmentMode = False
if os.path.exists('dev-enabled'):
developmentMode = True
try:
if sys.argv[1] == 'run':
shouldRun = True
except IndexError:
pass
if shouldRun:
OnionrCommunicate()
OnionrCommunicate(debug, developmentMode)