# Path: eff_site/eff/models.py



import sys
import os
from datetime import datetime
from tutos import fetch_all
from eff_site.eff.models import ExternalSource, Project, TimeLog, Client
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Eff 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 Eff.  If not, see <http://www.gnu.org/licenses/>.


path = os.path.normpath(os.path.join(os.path.dirname(__file__), '..', '..'))
sys.path.insert(1, path)
os.environ['DJANGO_SETTINGS_MODULE'] = 'eff_site.settings'



if __name__ == '__main__':

    args = sys.argv[1:]

    if len(args) != 4:
        print ("Usage: $ tutos2eff.py <client-name> <source-name>"
               " <username> <password>")
        sys.exit(0)

    client_name, source_name, username, password = args

    try:

# Path: eff_site/eff/models.py



# Path: eff_site/scripts/tutos2eff.py
import sys
import os
from datetime import datetime
from tutos import fetch_all
from eff_site.eff.models import ExternalSource, Project, TimeLog, Client

# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Eff 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 Eff.  If not, see <http://www.gnu.org/licenses/>.


path = os.path.normpath(os.path.join(os.path.dirname(__file__), '..', '..'))
sys.path.insert(1, path)
os.environ['DJANGO_SETTINGS_MODULE'] = 'eff_site.settings'



if __name__ == '__main__':

    args = sys.argv[1:]

    if len(args) != 4:
        print ("Usage: $ tutos2eff.py <client-name> <source-name>"
               " <username> <password>")
        sys.exit(0)

    client_name, source_name, username, password = args

    try:

        source = ExternalSource.objects.get(name=source_name)