#!/usr/bin/env python
###############################################################################
#                                                                             #
#    outstandingKnife                                                         #
#                                                                             #
#    Create installing pypi-based python projects                             #
#                                                                             #
#    Copyright (C) Michael Imelfort                                           #
#                                                                             #
###############################################################################
#                                            ___                              # 
#                                           |_  |                             #
#                                             | |                             #
# __                    ____                  | |                             # 
# \ ```''''---....____.'\   ```''''-----------| |--.          ____      .--.  #
#  :.                    `-._                 | |   `''''''```    ``''|`:  :| #
#   ':.                      `'-..____________| |                     | :  :| #
#    '::..      ----....._____________________| |                     | :  :| #
#      `'-:...________________________________| |   .-''`-..-'`-.-''-.L :  :| #
#          ```'''-----------------------------| |--'                   `'--'  #
#                                             | |                             #
#                                            _| |                             #
#                                           |___|                             #
#                                                                             #
###############################################################################
#                                                                             #
#    This program 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.                                      #
#                                                                             #
#    This program 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 this program. If not, see <http://www.gnu.org/licenses/>.     #
#                                                                             #
###############################################################################

__author__ = "Michael Imelfort"
__copyright__ = "Copyright 2013"
__credits__ = ["Michael Imelfort"]
__license__ = "GPL3"
__version__ = "0.0.1"
__maintainer__ = "Michael Imelfort"
__email__ = "mike@mikeimelfort.com"
__status__ = "Dev"

###############################################################################

import argparse
import sys

###############################################################################
###############################################################################
###############################################################################
###############################################################################

def doWork(args):
    """Wrapper function to allow easy profiling"""
    from outstandingknife.outstandingKnife import ProjectMaker
    PM = ProjectMaker(args.projectName, args.projectDir)
    PM.makeProject()

###############################################################################
###############################################################################
###############################################################################
###############################################################################

if __name__ == '__main__':
    parser = argparse.ArgumentParser()
    parser.add_argument('projectName', help="camelCase name of the pypi project")
    parser.add_argument('-d', '--projectDir', default="", help="location for the dev arm of the project")
    #parser.add_argument('positional_arg', help="Required")
    #parser.add_argument('positional_arg2', type=int, help="Integer argument")
    #parser.add_argument('positional_arg3', nargs='+', help="Multiple values")
    #parser.add_argument('-X', '--optional_X', action="store_true", default=False, help="flag")
    
    # parse the arguments
    args = parser.parse_args()        

    # profiling happens here. If you'd like to track the speed your code runs at
    # then set the following to True and voila!
    if(False):
        import cProfile
        cProfile.run('doWork(args)', 'profile')
        ##########################################
        ##########################################
        # Use this in python console!
        #import pstats
        #p = pstats.Stats('prof')
        #p.sort_stats('cumulative').print_stats(10)
        #p.sort_stats('time').print_stats(10)
        ##########################################
        ##########################################
    else:
        doWork(args)

###############################################################################
###############################################################################
###############################################################################
###############################################################################

