Commit 95201bb0 authored by Jerome Mariette's avatar Jerome Mariette
Browse files

add localfile type

parent e51cc3ab
......@@ -15,9 +15,17 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
import os
import argparse
import datetime
# custom date type
def date(datestr):
return datetime.datetime.strptime(datestr, '%d/%m/%Y')
\ No newline at end of file
return datetime.datetime.strptime(datestr, '%d/%m/%Y')
def localfile(file):
if os.path.isfile(file):
return os.path.abspath(file)
else:
raise argparse.ArgumentTypeError("Local file " + file + " does not exists! Please provide a valid file path")
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment