Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
satella
Manage
Activity
Members
Labels
Plan
Issues
1
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
public
satella
Commits
cc512081
Commit
cc512081
authored
4 years ago
by
Piotr Maślanka
Browse files
Options
Downloads
Patches
Plain Diff
added file to schema
parent
fe3e9933
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
CHANGELOG.md
+1
-1
1 addition, 1 deletion
CHANGELOG.md
docs/configuration/schema.rst
+2
-0
2 additions, 0 deletions
docs/configuration/schema.rst
satella/__init__.py
+1
-1
1 addition, 1 deletion
satella/__init__.py
satella/configuration/schema/basic.py
+16
-0
16 additions, 0 deletions
satella/configuration/schema/basic.py
with
20 additions
and
2 deletions
CHANGELOG.md
+
1
−
1
View file @
cc512081
# v2.15
*
_TBA_
*
added
`file`
to the schema
This diff is collapsed.
Click to expand it.
docs/configuration/schema.rst
+
2
−
0
View file @
cc512081
...
...
@@ -15,6 +15,8 @@ you should instantiate a Descriptor. Descriptor reflects how your config is nest
.. autoclass:: satella.configuration.schema.String
.. autoclass:: satella.configuration.schema.File
.. autoclass:: satella.configuration.schema.IPv4
.. autoclass:: satella.configuration.schema.List
...
...
This diff is collapsed.
Click to expand it.
satella/__init__.py
+
1
−
1
View file @
cc512081
__version__
=
'
2.15
a1
'
__version__
=
'
2.15
'
This diff is collapsed.
Click to expand it.
satella/configuration/schema/basic.py
+
16
−
0
View file @
cc512081
import
os
import
re
import
typing
as
tp
...
...
@@ -52,6 +53,21 @@ class String(Descriptor):
BASIC_MAKER
=
str
@staticmethod
def
_make_file
(
v
:
str
)
->
bool
:
if
not
os
.
path
.
isfile
(
v
):
raise
ConfigurationValidationError
(
'
Expected to find a file under %s
'
%
(
v
,))
@register_custom_descriptor
(
'
file
'
)
class
File
(
Descriptor
):
"""
This value must be a valid path to a file
"""
BASIC_MAKER
=
_make_file
class
Regexp
(
String
):
"""
Base class for declaring regexp-based descriptors. Overload it
'
s attribute REGEXP. Use as
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment