libs5-python 1.0.7__tar.gz → 1.0.8__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. {libs5_python-1.0.7 → libs5_python-1.0.8}/.gitignore +5 -1
  2. {libs5_python-1.0.7 → libs5_python-1.0.8}/PKG-INFO +1 -1
  3. {libs5_python-1.0.7 → libs5_python-1.0.8}/pyproject.toml +1 -1
  4. {libs5_python-1.0.7 → libs5_python-1.0.8}/src/net/hypki/File.py +2 -0
  5. {libs5_python-1.0.7 → libs5_python-1.0.8}/src/net/hypki/Ini.py +17 -6
  6. {libs5_python-1.0.7 → libs5_python-1.0.8}/src/net/hypki/Logger.py +11 -5
  7. {libs5_python-1.0.7 → libs5_python-1.0.8}/LICENSE +0 -0
  8. {libs5_python-1.0.7 → libs5_python-1.0.8}/MANIFEST.in +0 -0
  9. {libs5_python-1.0.7 → libs5_python-1.0.8}/README.md +0 -0
  10. {libs5_python-1.0.7 → libs5_python-1.0.8}/install.sh +0 -0
  11. {libs5_python-1.0.7 → libs5_python-1.0.8}/requirements.txt +0 -0
  12. {libs5_python-1.0.7 → libs5_python-1.0.8}/setup.py +0 -0
  13. {libs5_python-1.0.7 → libs5_python-1.0.8}/src/net/__init__.py +0 -0
  14. {libs5_python-1.0.7 → libs5_python-1.0.8}/src/net/hypki/StringUtils.py +0 -0
  15. {libs5_python-1.0.7 → libs5_python-1.0.8}/src/net/hypki/__init__.py +0 -0
  16. {libs5_python-1.0.7 → libs5_python-1.0.8}/src/net/hypki/apiutils.py +0 -0
  17. {libs5_python-1.0.7 → libs5_python-1.0.8}/src/net/hypki/args.py +0 -0
  18. {libs5_python-1.0.7 → libs5_python-1.0.8}/src/net/hypki/asserts.py +0 -0
  19. {libs5_python-1.0.7 → libs5_python-1.0.8}/src/net/hypki/io.py +0 -0
  20. {libs5_python-1.0.7 → libs5_python-1.0.8}/src/net/hypki/log.py +0 -0
  21. {libs5_python-1.0.7 → libs5_python-1.0.8}/src/net/hypki/math.py +0 -0
  22. {libs5_python-1.0.7 → libs5_python-1.0.8}/src/net/hypki/random.py +0 -0
  23. {libs5_python-1.0.7 → libs5_python-1.0.8}/src/net/hypki/regex.py +0 -0
  24. {libs5_python-1.0.7 → libs5_python-1.0.8}/src/net/hypki/system.py +0 -0
  25. {libs5_python-1.0.7 → libs5_python-1.0.8}/src/net/hypki/tests/__init__.py +0 -0
  26. {libs5_python-1.0.7 → libs5_python-1.0.8}/src/net/hypki/tests/kepler.py +0 -0
  27. {libs5_python-1.0.7 → libs5_python-1.0.8}/src/net/hypki/tests/numpytest.py +0 -0
@@ -39,4 +39,8 @@ dist/libs5_python-1.0.3.tar.gz
39
39
  dist/libs5_python-1.0.4-py3-none-any.whl
40
40
  dist/libs5_python-1.0.4.tar.gz
41
41
  dist/libs5_python-1.0.5-py3-none-any.whl
42
- dist/libs5_python-1.0.5.tar.gz
42
+ dist/libs5_python-1.0.5.tar.gz
43
+ dist/libs5_python-1.0.6-py3-none-any.whl
44
+ dist/libs5_python-1.0.6.tar.gz
45
+ dist/libs5_python-1.0.7-py3-none-any.whl
46
+ dist/libs5_python-1.0.7.tar.gz
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: libs5-python
3
- Version: 1.0.7
3
+ Version: 1.0.8
4
4
  Summary: libs5 python scripts, and helper classes (useg e.g. in BEANS software)
5
5
  Project-URL: Homepage, https://gitlab.com/ahypki/libs5-python
6
6
  Project-URL: Issues, https://gitlab.com/ahypki/libs5-python/-/issues/
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "libs5-python"
7
- version = "1.0.7"
7
+ version = "1.0.8"
8
8
  authors = [
9
9
  { name="Arkadiusz Hypki" },
10
10
  ]
@@ -47,6 +47,8 @@ class File(object):
47
47
  def copy(self, destination):
48
48
  shutil.copy2(self.__absPath, destination)
49
49
 
50
+ def mv(self, destination):
51
+ shutil.move(self.__absPath, destination)
50
52
 
51
53
  def remove(self):
52
54
  os.remove(self.__absPath)
@@ -63,7 +63,14 @@ class Ini(object):
63
63
  keys.append(self.__getKey(line))
64
64
  return keys
65
65
 
66
- def set(self, section, key, value):
66
+ def add(self, section, key, value):
67
+ v = self.get(section, key)
68
+ forceAdd = True
69
+ if v is not None:
70
+ forceAdd = False
71
+ self.set(section, key, value, forceAdd=forceAdd)
72
+
73
+ def set(self, section, key, value, forceAdd = False):
67
74
  newLines = []
68
75
  currentSection = None
69
76
  for line in self.__getIni():
@@ -72,11 +79,15 @@ class Ini(object):
72
79
  if self.__isSection(line):
73
80
  currentSection = self.__getSection(line)
74
81
 
75
- if self.__isKey(line):
76
- currentKey = self.__getKey(line)
77
- if currentSection is not None and currentSection == section and currentKey == key:
78
- newLines.append(key + " = " + value)
79
- lineAdded = True
82
+ if forceAdd and currentSection is not None and currentSection == section:
83
+ newLines.append(key + " = " + value)
84
+ lineAdded = True
85
+ else:
86
+ if self.__isKey(line):
87
+ currentKey = self.__getKey(line)
88
+ if currentSection is not None and currentSection == section and currentKey == key:
89
+ newLines.append(key + " = " + value)
90
+ lineAdded = True
80
91
 
81
92
  if not lineAdded:
82
93
  newLines.append(line)
@@ -30,22 +30,28 @@ class Logger:
30
30
 
31
31
  def debug(msg, printLogLevel = True, printNewLine = True): # @NoSelf
32
32
  if Logger.DEBUG:
33
- console.print(("DEBUG " if printLogLevel and Logger.PRINT_LEVEL else '')
33
+ print(("DEBUG " if printLogLevel and Logger.PRINT_LEVEL else '')
34
34
  + str(msg),
35
+ # no_wrap = True,
35
36
  end = ('\n' if printNewLine else ''))
36
37
 
37
38
  def info(msg, printLogLevel = True, printNewLine = True): # @NoSelf
38
39
  if Logger.INFO:
39
- console.print(("INFO " if printLogLevel and Logger.PRINT_LEVEL else '')
40
+ print(("INFO " if printLogLevel and Logger.PRINT_LEVEL else '')
40
41
  + str(msg),
42
+ # no_wrap = False,
43
+ # crop = False,
44
+ # width = 1280,
41
45
  end = ('\n' if printNewLine else ''))
42
46
 
43
47
  def warn(msg, printLogLevel = True, printNewLine = True): # @NoSelf
44
- console.print(("WARN " if printLogLevel and Logger.PRINT_LEVEL else '')
45
- + str(Logger.WARNING + msg + Logger.WARNING_END),
48
+ print(("WARN " if printLogLevel and Logger.PRINT_LEVEL else '')
49
+ + str(Logger.WARNING + msg + Logger.WARNING_END),
50
+ # no_wrap = True,
46
51
  end = ('\n' if printNewLine else ''))
47
52
 
48
53
  def error(msg, printLogLevel = True, printNewLine = True): # @NoSelf
49
- console.print(("ERROR " if printLogLevel and Logger.PRINT_LEVEL else '')
54
+ print(("ERROR " if printLogLevel and Logger.PRINT_LEVEL else '')
50
55
  + str(msg),
56
+ # no_wrap = True,
51
57
  end = ('\n' if printNewLine else ''))
File without changes
File without changes
File without changes
File without changes
File without changes