ChangeLog for pysas
===================

Version 1.4.2 - 2023-03-28 (AI)
-------------
   + src/pysas/runtask.py: single and double quotes are not properly handled. SOC-SPR-7683 fixed

Version 1.4.1 - 2021-11-10 (EO)
-------------
    + src/pysas/logger.py: Commented out several debugging prints.

Version 1.4 - 2021-10-29 (EO)
-----------
    + src/pysas/logger.py: Added handling of environment variable
    SAS_TASKLOGFMODE to allow to change the mode of creation of the
    logging file from the default 'a'(append) to 'w'(new file).
    Until now we had by default 'w' just to make happy standard users.
    However, PPS usage requires 'a', to allow to get the whole set
    of execution logs for a given Python task grouped together and 
    not only the last one. Anyhow now this variable allow to set
    this logging file mode between append and new files.
    + src/pysas/parser.py: --version replaced by -v in the command
    to obtain the version for a non-Python task due to some SAS perl
    tasks like epchain and possibly others, do not accept --version.


Version 1.3 - 2021-10-14 (EO)
-----------
    + src/pysas/logger.py: Until now the task logger was writing
    to a log file placed by default in the task starting directory.
    That is what it does the 'gui' task with its log file 'sas_log'.
    Assuming that the Python log file is where the task writes 
    debugging information, to allow users to put such files wherever 
    they want, the logfile can now be placed in a directory defined  
    through the environment variable named SAS_TASKLOGDIR. 
    If such value is set and the directory effectively exist, the 
    task logfile will be written there. Otherwise, it will be 
    written in the task' starting directory (os.getcwd()).
    The task log file is always created new (mode='w'), not appended. 

Version 1.2.1 - 2021-10-05 (EO)
-------------
    + src/pysas/sastask.py: Removed debugging print statements.

Version 1.2 - 2021-09-30 (EO)
-----------
    + src/pysas/sastask.py: Extended "implicit" behaviour also to 
    optional sub-parameters.
    Fixed SPR-7606 reported on specgroup.
    According to the param interface document, "implicit" behaviour
    states that when any sub-parameters are set either in the command 
    line or in the arguments list, therefore not taking their default 
    values, their parent parameters must take am alternate value to 
    their defaults. 
    Typically, the parent parameters of these sub-parameters are of
    type boolean ('yes/no'), and their associated sub-parameters might
    have or not, default values. If any of these sub-parametrs is
    absent of the command line/arguments list, then the parent takes 
    a default value, either 'yes' or 'no'. As soon as the sub-parameter
    is set in the command line/args. list, the parent must "implicitly'
    take the "alternate" value to its default.
    The review of such behaviour might led to change wrong definitions
    in some parameter files.


Version 1.1 - 2021-03-12 (EO)
-----------
    + src/pysas/sastask.py: While checking for mandatory parameters
    and subparameters, added checking for the "implicit" case: When 
    all the mandatory subparameters of a given parent are present
    in the command line or in the input args list, it is not 
    necessary to include the parent parameter. It is assumed to be
    present with value alternate to the default: When the parameter
    type is boolean, the alternate value is the contrary to 'yes'|'no'
    set as default. When the parameter type is a string, the 
    alternate value is given in dictionary 'rev_mandpar_string_dict', 
    computed in param.py. 
    + src/pysas/param.py: Fixed typo in the creation of dictionary
    'rev_mandpar_string_dict'.
    + src/pysas/version.py: Ensuring it is updated properly.

Version 1.0 - 2021-02-24 (EO)
-----------
	+ src/pysas/param.py : Full refurbishment of the module. 
    Now the module identifies all the subparameters 
    dependent on a given parameter and treats properly the 
    dependencies of mandatory subparameters with its 
    parent parameter. It applies the SAS Parameter Interface 
    rules as documented in package 'param'. 
    Fixed SPRs: 7583 and 7585.
    
    + src/pysas/sastask.py: Added new logic to check both the
    validity of any parameters entered to a task and specially
    the relationship between mandatory parameters and subparameters.


Version 0.10 - 2021-02-18 (EO)
------------
	+ src/pysas/logger.py: The logging code included initially in
	sastask.py is now moved to a new module named logger.py.
	This module defines class TaskLogger which can be used to instantiate
	a logger to be used in the code as 
		
		logger = TaskLogger('<taskname>')
		
		logger.log('level','<message'>)
	
	where level can be one of debug, info, warning, error or critical, and
	<message> is the message to be logged. 
	By default, the logger comes with two handlers, one console handler
	and one file handler. The file handler produces a log file named as
	<taskname>.log, with a fixed log level of DEBUG (all messages are
	registered). However, the console handler provides more or less
	messages, according to the value of the 'verbosity'which is controlled
	by means of option -V or the SAS_VERBOSITY environment variable.
	To be used in modules, the instatiation of the logger must be done 
	out of function definitions. Then, within each function, we can
	include calls to logger.log('level', '<message>'), as apropriate.
	+ src/pysas/*.py: Changed comments by string docs where appropriate.

Version 0.9.1 - 2020-10-13 (EO)
-------------
	+ src/pysas/parser.py: Removed left over wrong import statement (line
	58).

Version 0.9 - 2020-10-12 (EO)
-----------
	+ These changes fix SPRs: 7567, 7568 and 7574.
	+ src/pysas/parser.py: 
	  - Added method taskparser in class ParseArgs. 
	    Creates parser and parse args (options and parameters) entered in
	    the command line.
	  - Added method procopt in class ParseArgs. 
	    Identifies immediate options -m, -v, -d, -h, -p and set Exit to
	    True. 
	    Identifies environment cumulative options and sets Exit to False.
	+ src/pysas/sastask.py: 
	  - Added p.taskparser() and self.exit = p.procopt(), in method
	    processargs of class MyTask.
	  - Added checking of Exit after p.procopt() call in method
	    processargs. Return from method on True. t avoids using sys.exit(0)
	    which is catched as execption SystemExit by interactive ipython
	    sessions.
	  - Added check for Exit in runtask method of MyTask. Return on True.
	+ src/pysas/runtask.py: 
	  - Included code from wrapper.py to handle running non Python tasks.
	
	+ src/pysas/wrapper.py: 
	  - Included class Wrapper to handle runing non-python tasks from
	    Jupyter Notebooks and interacctive ipython.
	+ src/pysas/bin/wrapper: Removed. 
	+ Makefile: Updated.
	+ setup.py: Updated.
	+ README.md: Updated.

Version 0.8 - 2020-10-02 (EO)
-----------
	+ Makefile: Added src/pysas/bin to SUBDIRS.
	+ src/pysas: 
	- Added bin/wrapper script. First script in pysas.
	Aimed to run non Python SAS tasks, e.g. taskname, as

		wrapper task=taskname args
	
	where args can be any possible arguments to be used to run taskname.
	These arguments can be either of the form of param=value or
	param='value value value ....value' or any of the options available
	for any SAS task (e.g. -v, -d, -m, etc).
	- Added wrapper.py module to run the non Python task via Python
	subprocess packagei, with all the arguments.
	+ src/pysas/runtask.py: 
	- Modified method in class RunTask to search for all pysas
	packages and put them in list 'pysaspkgs'. Uses pkgutil.walk_packages.
	Any package not belonging to pysaspkgs is considered a non Python
	task, therefore will be run through the run method in wrapper.py module.
	+ src/pysas/parser.py: 
	- Modified processing of version to support also non Python tasks.
	- Modified runext method in line with code used in wrapper.py.
	+ setup.py: Added scripts=['src/pysas/bin/wrapper']
	+ README.md: Updated.
	+ src/pysas/param: Fixed bug regarding the existence of self.xmlFile:
	If no .par file is found for the task, this file is not defined.
	+ src/pysas/sastask.py: Added customized logger with name,  two
	handlers console and file, default logging levels set to WARNING and
	ERROR and specific formatting for each them respectively.  

Version 0.7.1 - 2020-09-10 (EO-AI)
-------------
	+ src/pysas/error.py: 
	 * Added self to msgLayerValues and to msgLevelValues in 
	 class Error__init__ method.
	 * Added missing prefix 'subprocess' to call in error method. 

Version 0.7 - 2020-09-10 (EO)
-----------
	+ src/pysas/sastask.py:
	  * Added dictionaries argsdic, parsdic and iparsdic to method
	  processargs. argsdic includes parameters (param=value) entered
	  command line. parsdic includes all par file parameers and their
	  default values. iparsdic is the merge of both resulting in
	  a dictionary of parameters to be passed to any task module
	  for execution.
	  * Modified runtask method accordingly to previous change.
	+ src/pysas/runtask.py: replaced iargs by iparsdic as input
	argument.

Version 0.6.1 - 2020-09-08 (EO)
-------------
	+ src/pysas/parser.py: Removed debug print.
	+ src/pysas/sastask.py: Changed ordering logic for inargs.

Version 0.6 - 2020-09-03 (EO)
-----------
	+ src/pysas: Added write_version.py, version.py.in and version.py
	to produce package __version__ object.
	+ src/pysas/Makefile:
	  * Added DATASCRIPTS target to run write_version.py
	  * Added $(PYTHONLIBDIR)/pysas/__pycache__ to CLOBBERDIRS.
	  * Added $(PYTHONLIBDIR)/pysas/*.py to CLOBBERFILES
	  * Now old soft links are removed before rewritten.
	+ src/pysas/__init__.py: Import of base pysas modules, sastask,
	parser, param, error and runtask, are now imprted relatively.
	Added import of .version to get __version__ object.
	+ error.py, param.py, parser.py, sastask.py and runtask.py: Added
	classification of imports.
	+ src/pysas/parser.py: Import of taskname is now absolute in
	import_module,
	+ src/pysas/runtask.py: Import of taskname is now absolute in 
	import_module.
	+ DEPEND: sas package must have version 1.603
	+ README.md: Fixed typos.


Version 0.5.1 - 2020-08-27 (EO)
-------------
	+ src/pysas/param.py: Fix bug while looking for par file.

Version 0.5 - 2020-07-17 (EO)
-----------
	+ src/pysas/Makefile: Repeated previous changes. Apparently did not
	get through.

Version 0.4 - 2020-07-17 (EO)
-----------
	+ src/pysas/Makefile: Removed pysas dir from CLOBBERDIRS. Removed
	creation of $(PYTHONLIBDIR)/pysas in pysas target.

Version 0.3 - 2020-07-16 (EO)
-----------
	+ doc/pysas_description.tex: Fixed some issues with first latex draft
	doc.

Version 0.2 - 2020-07-12 (EO)
-----------
	+ SAS Python base package, currently formed by the following modules:
	  * sastask.py: Defines the base class SASTask and the child class
	  MyTask, with specific methods, that all Python tasks will use.
	  * param.py: Class paramXmlInforeader to read and load task par file.
	  * parser.py: Class ParseArgs is responsible of handling tasks
	  arguments, either task parameters or options.
	  * runtask.py: Class RunTask, helps to run tasks.

Version 0.1 - 2020-06-13
------------------------
	+ Directory structure created by pkgmaker.