- Fixed bug when trying to read a PREFS file using the
read
function. - Removed JSON and YAML suppport
PrefsBase.to_json
PrefsBase.to_yaml
read_json
read_yaml
- New parse system using Lark.
- Using Lark indenting with spaces or tabs is allowed.
- Added support for bytes and ranges types.
- Now it checks what objects are written into the prefs file to avoid errors.
- Improved CLI tool with Click.
- Better tests with unittest.
- Now using poetry.
- Improved code quality in general.
- Ordered directories layout.
- Added dictionary-like interface for the
Prefs
class:Prefs.__str__
Prefs.__repr__
Prefs.__len__
Prefs.__delitem__
Prefs.__getitem__
Prefs.__setitem__
Prefs.__contains__
Prefs.__iter__
Prefs.keys
Prefs.values
Prefs.items
Prefs.pop
Prefs.get
Prefs.has_key
Prefs.clear
Prefs.update
Prefs.popitem
- Renamed:
PrefsBase.file
->PrefsBase.content
PrefsBase.read_prefs
->PrefsBase.read
PrefsBase.write_prefs
->PrefsBase.write
PrefsBase.write_multiple_prefs
->PrefsBase.write_many
PrefsBase.overwrite_prefs
->PrefsBase.overwrite
PrefsBase.delete_file
->PrefsBase.delete
PrefsBase.convert_to_json
->PrefsBase.to_json
PrefsBase.convert_to_yaml
->PrefsBase.to_yaml
convert_to_prefs
->to_prefs
read_prefs_file
->read
read_json_file
->read_json
read_yaml_file
->read_yaml
- Renamed CLI commands:
read_prefs_file
->read
- New:
PrefsBase.get
PrefsBase.remove_key
bundle
parse
- New CLI commands:
about
- Removed:
Prefs.change_filename
- Removed CLI commands:
convert_to_prefs
- Improved error messages.
- Improved efficiency.
- Removed
indent_char
parameter fromPrefsBase
class. - Now you MUST to indent with tabulations
\t
.
- When adding a prefs file as a data when using pyinstaller now it can read the file.
- Added
output
parameter inconvert_to_prefs
function.
- Added resources suport so you can build your app without any issue.
- Added CLI tool.
- Cleaned directory tree.
- Fixed small bugs.
- Renamed
PREFSBase
toPrefsBase
. - Renamed
PREFS
toPrefs
. - Removed
separator_char, ender_char, continuer_char, comment_char, interpret, cascade
parameters fromPrefsBase
class. - Updated tests.
- Updated discord username.
- Updated
EXTRAINFO.md
.
- Fixed bug filename has no path (
prefs.prefs
).
-
PREFSBase
class- Now
filename
parameter includes the extension too. - Fixed path detection on
create_prefs
- Now writes the representation of a string, not just the string with quotes around it.
- Now it uses
ast.literal_eval
insead ofeval
to evaluate strings. - Now
separator_char
,ender_char
,continuer_char
andcomment_char
are constantes (no parameters). - Now
file
attribute it's an property method that callsread_prefs
. - Removed
dictionary
parameter. - Setted split to 1 when splitting key and value.
- Added
dump
method that returns an string withprefs
dictionary as PREFS format.
- Now
-
Added
VERSION
constant variable. -
Added
split_path
function. -
Added
accumulate_list
function.
- Added
write_multiple_prefs
function which requires a list of prefs and a list of values to change. With this function writing multiple prefs will be more efficiently.
- Added
auto_generate_keys
parameter.
- Added
indent
parameter. - Comment your own PREFS files (and change the comment character
#
).
- Deleted
readPREFS.py
andcreatePREFS.py
. - Added
PREFS_Base
class and changedread_prefs_file
function andconvert_to_prefs
function usingPREFS_Base
class.
- Replaced:
With:
import sys; sys.path.append(os.path.dirname(os.path.realpath(__file__))) from readPREFS import ReadPREFS from createPREFS import CreatePREFS
if __name__ == '__main__': from readPREFS import ReadPREFS from createPREFS import CreatePREFS else: from .readPREFS import ReadPREFS from .createPREFS import CreatePREFS
-
Changed all function names accord to PEP8:
PREFS.ReadPrefs
->PREFS.read_prefs
PREFS.WritePrefs
->PREFS.write_prefs
PREFS.OverWritePrefs
->PREFS.overwrite_prefs
PREFS.ChangeFilename
->PREFS.change_filename
PREFS.ConvertToJson
->PREFS.convert_to_json
ReadJsonFile
->read_json_file
ReadPREFSFile
->read_prefs_file
ConvertToPREFS
->convert_to_prefs
-
Added
PREFS.convert_to_yaml
andread_yaml_file
.
- Fixed bug when creating a pref with an empty dictionary as value.
- Added
ConvertToPREFS()
function (outside PRFS class) that do the same asdumps()
in json. Converts a dictionary into a PREFS file but instead of writing the PREFS in a file returns it as string. - Changed
ReadPrefs()
function name (outside PREFS class) toReadPREFSFile()
. - Fixed issue when dictionary=True parameter, fixed issue when dictionary=True and interpret=True parameter.
- Added ReadPrefs function outside PREFS class that reads a PREFS file and return it's value.
- Fixed error when overwriting prefs and using a lambda function.
- Added tree/cascade (nested dictionaries) support.
- Added docstring.
- Fixed path support, fixed ChangeFilename function, added debug parameter.
- Fixed little issues.
- Added dictionary write mode and support path file.
- Added ChangeFilename() function and ReWritePrefs() function.
- Set max split as 1.
- Now you can choose your PREFS ender, line break is predetermined, remember don't put a character that is on your PREFS because program fails.
- Fixed error with lambda.
- Now in class PREFS argument PREFS you must pass a lambda: function for not execute the function always, only when file is lost.
- Added python interpreter for pref values (using ast library)
- Name change
- ...
- First Release