diff --git a/git_import.py b/git_import.py index 6d129e800f04bd170d5343570359553420354380..577aebf6af13994bb0ea91c7d3f3b5abb9d0af05 100644 --- a/git_import.py +++ b/git_import.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- import os import hashlib import sys @@ -14,6 +16,7 @@ RPATH='./services/tmp' def checkUserYml(): if( not os.path.exists(RPATH+'/user.yml') ): + print( uname + ' - user.yml not found in repository' ) return with open( RPATH + '/user.yml', 'r') as stream: @@ -25,6 +28,8 @@ def checkUserYml(): os.mkdir( TPATH + '/' + uname ) shutil.move( RPATH + '/user.yml', TPATH + '/' + uname + '/' ) getRepoYml() + else: + print( 'field list does not match ( county, lang, latitude, longitude, faircoinaddress )' ) except yaml.YAMLError as exc: print('user.yml invalid') @@ -83,7 +88,8 @@ def getRepoYml(): if( not os.path.isdir( IPATH ) ): os.mkdir( IPATH ) if( os.path.isfile( RPATH + '/images/' + y[:-4] + '.jpg' ) ): - os.mkdir( IPATH + '/' + uname ) + if( not os.path.isdir( IPATH + '/' + uname ) ): + os.mkdir( IPATH + '/' + uname ) shutil.move( RPATH + '/images/' + y[:-4] + '.jpg', IPATH + '/' + uname + '/' ) if( not 'description' in u ):