# Path: pypasta/Util.py
# def parse_date_ymd(ymd):
#     if isinstance(ymd, datetime.date):
#         return datetime.datetime.combine(ymd, datetime.datetime.min.time())
# 
#     try:
#         return datetime.datetime.strptime(ymd, "%Y-%m-%d")
#     except ValueError:
#         raise argparse.ArgumentTypeError("Not a valid date: '%s'" % ymd)
# 
# def load_commit_hashes(filename, ordered=True, must_exist=True):
#     content = file_to_string(filename, must_exist=must_exist)
#     if content is None:
#         content = ''
#     content = content.splitlines()
# 
#     # Filter empty lines
#     content = filter(None, content)
#     # Filter comment lines
#     content = filter(lambda x: not x.startswith('#'), content)
#     # return filtered list or set
#     if ordered:
#         return list(content)
#     else:
#         return set(content)
# 
# def persist_commit_hashes(filename, commit_hashes):
#     with open(filename, 'w') as f:
#         f.write('\n'.join(commit_hashes) + '\n')


import csv
import os
import re
from logging import getLogger
from .Util import parse_date_ymd, load_commit_hashes, persist_commit_hashes
"""
PaStA - Patch Stack Analysis

Copyright (c) OTH Regensburg, 2016-2017

Author:
  Ralf Ramsauer <ralf.ramsauer@oth-regensburg.de>

This work is licensed under the terms of the GNU GPL, version 2.  See
the COPYING file in the top-level directory.
"""



log = getLogger(__name__[-15:])


class VersionPoint:
    def __init__(self, commit, version, release_date):
        self.commit = commit
        self.version = version

# Path: pypasta/Util.py
# def parse_date_ymd(ymd):
#     if isinstance(ymd, datetime.date):
#         return datetime.datetime.combine(ymd, datetime.datetime.min.time())
# 
#     try:
#         return datetime.datetime.strptime(ymd, "%Y-%m-%d")
#     except ValueError:
#         raise argparse.ArgumentTypeError("Not a valid date: '%s'" % ymd)
# 
# def load_commit_hashes(filename, ordered=True, must_exist=True):
#     content = file_to_string(filename, must_exist=must_exist)
#     if content is None:
#         content = ''
#     content = content.splitlines()
# 
#     # Filter empty lines
#     content = filter(None, content)
#     # Filter comment lines
#     content = filter(lambda x: not x.startswith('#'), content)
#     # return filtered list or set
#     if ordered:
#         return list(content)
#     else:
#         return set(content)
# 
# def persist_commit_hashes(filename, commit_hashes):
#     with open(filename, 'w') as f:
#         f.write('\n'.join(commit_hashes) + '\n')


# Path: pypasta/PatchStack.py
import csv
import os
import re
from logging import getLogger
from .Util import parse_date_ymd, load_commit_hashes, persist_commit_hashes

"""
PaStA - Patch Stack Analysis

Copyright (c) OTH Regensburg, 2016-2017

Author:
  Ralf Ramsauer <ralf.ramsauer@oth-regensburg.de>

This work is licensed under the terms of the GNU GPL, version 2.  See
the COPYING file in the top-level directory.
"""



log = getLogger(__name__[-15:])


class VersionPoint:
    def __init__(self, commit, version, release_date):
        self.commit = commit
        self.version = version

        self.release_date = parse_date_ymd(release_date)