#!/usr/bin/python

# Copyright (C) 2015 DrEstebon

# This file is part of Papageorge.
#
# Papageorge is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Papageorge is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Papageorge If not, see <http://www.gnu.org/licenses/>.

import os, sys

this_dir = os.path.dirname(os.path.abspath(__file__))
if os.path.isdir(os.path.join(this_dir, "lib/papageorge")) and \
        os.path.join(this_dir, "lib") not in sys.path:
    sys.path = [os.path.join(this_dir, "lib")] + sys.path

import papageorge

if __name__ == "__main__":
    if len(sys.argv) > 2:
        fics_user, fics_pass = sys.argv[1:3]
    else:
        fics_user = input('user: ')
        if fics_user != 'guest' and len(fics_user) > 0:
            fics_pass = input('pass: ')
        else:
            fics_pass = ''
    if len(fics_user) == 0:
        fics_user = 'guest'
        fics_pass = ''
    papageorge.run(fics_user, fics_pass)

