tiferet 1.0.0a11__tar.gz → 1.0.0a13__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 (42) hide show
  1. {tiferet-1.0.0a11/tiferet.egg-info → tiferet-1.0.0a13}/PKG-INFO +1 -1
  2. {tiferet-1.0.0a11 → tiferet-1.0.0a13}/setup.py +1 -1
  3. {tiferet-1.0.0a11 → tiferet-1.0.0a13}/tiferet/contexts/app.py +1 -1
  4. {tiferet-1.0.0a11 → tiferet-1.0.0a13}/tiferet/contexts/error.py +27 -1
  5. {tiferet-1.0.0a11 → tiferet-1.0.0a13}/tiferet/contexts/feature.py +3 -0
  6. {tiferet-1.0.0a11 → tiferet-1.0.0a13}/tiferet/domain/__init__.py +1 -1
  7. {tiferet-1.0.0a11 → tiferet-1.0.0a13/tiferet.egg-info}/PKG-INFO +1 -1
  8. {tiferet-1.0.0a11 → tiferet-1.0.0a13}/LICENSE +0 -0
  9. {tiferet-1.0.0a11 → tiferet-1.0.0a13}/setup.cfg +0 -0
  10. {tiferet-1.0.0a11 → tiferet-1.0.0a13}/tiferet/__init__.py +0 -0
  11. {tiferet-1.0.0a11 → tiferet-1.0.0a13}/tiferet/clients/__init__.py +0 -0
  12. {tiferet-1.0.0a11 → tiferet-1.0.0a13}/tiferet/clients/yaml.py +0 -0
  13. {tiferet-1.0.0a11 → tiferet-1.0.0a13}/tiferet/commands/__init__.py +0 -0
  14. {tiferet-1.0.0a11 → tiferet-1.0.0a13}/tiferet/commands/container.py +0 -0
  15. {tiferet-1.0.0a11 → tiferet-1.0.0a13}/tiferet/commands/error.py +0 -0
  16. {tiferet-1.0.0a11 → tiferet-1.0.0a13}/tiferet/commands/feature.py +0 -0
  17. {tiferet-1.0.0a11 → tiferet-1.0.0a13}/tiferet/configs/__init__.py +0 -0
  18. {tiferet-1.0.0a11 → tiferet-1.0.0a13}/tiferet/contexts/__init__.py +0 -0
  19. {tiferet-1.0.0a11 → tiferet-1.0.0a13}/tiferet/contexts/container.py +0 -0
  20. {tiferet-1.0.0a11 → tiferet-1.0.0a13}/tiferet/contexts/request.py +0 -0
  21. {tiferet-1.0.0a11 → tiferet-1.0.0a13}/tiferet/data/__init__.py +0 -0
  22. {tiferet-1.0.0a11 → tiferet-1.0.0a13}/tiferet/data/app.py +0 -0
  23. {tiferet-1.0.0a11 → tiferet-1.0.0a13}/tiferet/data/container.py +0 -0
  24. {tiferet-1.0.0a11 → tiferet-1.0.0a13}/tiferet/data/error.py +0 -0
  25. {tiferet-1.0.0a11 → tiferet-1.0.0a13}/tiferet/data/feature.py +0 -0
  26. {tiferet-1.0.0a11 → tiferet-1.0.0a13}/tiferet/domain/app.py +0 -0
  27. {tiferet-1.0.0a11 → tiferet-1.0.0a13}/tiferet/domain/container.py +0 -0
  28. {tiferet-1.0.0a11 → tiferet-1.0.0a13}/tiferet/domain/core.py +0 -0
  29. {tiferet-1.0.0a11 → tiferet-1.0.0a13}/tiferet/domain/error.py +0 -0
  30. {tiferet-1.0.0a11 → tiferet-1.0.0a13}/tiferet/domain/feature.py +0 -0
  31. {tiferet-1.0.0a11 → tiferet-1.0.0a13}/tiferet/repos/__init__.py +0 -0
  32. {tiferet-1.0.0a11 → tiferet-1.0.0a13}/tiferet/repos/app.py +0 -0
  33. {tiferet-1.0.0a11 → tiferet-1.0.0a13}/tiferet/repos/container.py +0 -0
  34. {tiferet-1.0.0a11 → tiferet-1.0.0a13}/tiferet/repos/error.py +0 -0
  35. {tiferet-1.0.0a11 → tiferet-1.0.0a13}/tiferet/repos/feature.py +0 -0
  36. {tiferet-1.0.0a11 → tiferet-1.0.0a13}/tiferet/services/__init__.py +0 -0
  37. {tiferet-1.0.0a11 → tiferet-1.0.0a13}/tiferet/services/app.py +0 -0
  38. {tiferet-1.0.0a11 → tiferet-1.0.0a13}/tiferet/services/container.py +0 -0
  39. {tiferet-1.0.0a11 → tiferet-1.0.0a13}/tiferet.egg-info/SOURCES.txt +0 -0
  40. {tiferet-1.0.0a11 → tiferet-1.0.0a13}/tiferet.egg-info/dependency_links.txt +0 -0
  41. {tiferet-1.0.0a11 → tiferet-1.0.0a13}/tiferet.egg-info/requires.txt +0 -0
  42. {tiferet-1.0.0a11 → tiferet-1.0.0a13}/tiferet.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: tiferet
3
- Version: 1.0.0a11
3
+ Version: 1.0.0a13
4
4
  Summary: A multi-purpose application framework embodying beauty in form.
5
5
  Home-page: https://github.com/greatstrength/app
6
6
  Download-URL: https://github.com/greatstrength/app
@@ -9,7 +9,7 @@ config = {
9
9
  'url': r'https://github.com/greatstrength/app',
10
10
  'download_url': r'https://github.com/greatstrength/app',
11
11
  'author_email': 'andrew@greatstrength.me',
12
- 'version': '1.0.0-alpha.11',
12
+ 'version': '1.0.0-alpha.13',
13
13
  'license': 'BSD 3',
14
14
  'install_requires': [
15
15
  'schematics>=2.1.1',
@@ -118,7 +118,7 @@ class AppInterfaceContext(Model):
118
118
  import json
119
119
 
120
120
  # Return the response.
121
- return json.loads(request.result) if request.result else ''
121
+ return json.loads(request.result) if request.result else None
122
122
 
123
123
  # * method: run
124
124
  def run(self, **kwargs):
@@ -1,7 +1,7 @@
1
1
  # *** imports
2
2
 
3
3
  # ** core
4
- from typing import Any, Tuple
4
+ from typing import Any, Tuple, List
5
5
 
6
6
  # ** app
7
7
  from ..domain import *
@@ -37,10 +37,36 @@ class ErrorContext(Model):
37
37
  # Create the errors lookup from the error repository.
38
38
  errors = {error.name: error for error in error_repo.list()}
39
39
 
40
+ # Add custom errors.
41
+ errors.update({error.name: error for error in self.load_custom_errors()})
42
+
40
43
  # Set the errors lookup and validate.
41
44
  super().__init__(dict(errors=errors))
42
45
  self.validate()
43
46
 
47
+ # * method: load_custom_errors
48
+ def load_custom_errors(self) -> List[Error]:
49
+ '''
50
+ Load custom errors.
51
+
52
+ :return: The list of custom errors.
53
+ :rtype: list
54
+ '''
55
+
56
+ # Get custom errors.
57
+ return [
58
+ Error.new(
59
+ name='FEATURE_NOT_FOUND',
60
+ error_code='0',
61
+ message=[
62
+ ErrorMessage.new(
63
+ lang='en_US',
64
+ text='The feature with ID was not found: {}'
65
+ )
66
+ ]
67
+ )
68
+ ]
69
+
44
70
  # * method: handle_error
45
71
  def handle_error(self, exception: Exception, lang: str = 'en_US', **kwargs) -> Tuple[bool, Any]:
46
72
  '''
@@ -79,6 +79,9 @@ class FeatureContext(Model):
79
79
  :type kwargs: dict
80
80
  '''
81
81
 
82
+ # Assert the feature exists.
83
+ assert request.feature_id in self.features, 'FEATURE_NOT_FOUND, {}'.format(request.feature_id)
84
+
82
85
  # Iterate over the feature commands.
83
86
  for command in self.features[request.feature_id].commands:
84
87
 
@@ -1,5 +1,5 @@
1
1
  from .core import *
2
2
  from .app import AppInterface, AppDependency, AppRepositoryConfiguration
3
3
  from .container import ContainerAttribute, ContainerDependency
4
- from .error import Error
4
+ from .error import Error, ErrorMessage
5
5
  from .feature import Feature
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: tiferet
3
- Version: 1.0.0a11
3
+ Version: 1.0.0a13
4
4
  Summary: A multi-purpose application framework embodying beauty in form.
5
5
  Home-page: https://github.com/greatstrength/app
6
6
  Download-URL: https://github.com/greatstrength/app
File without changes
File without changes