wexample-filestate-git 0.0.2__py3-none-any.whl

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.
File without changes
File without changes
File without changes
File without changes
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) [year] [fullname]
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,110 @@
1
+ Metadata-Version: 2.1
2
+ Name: wexample-filestate-git
3
+ Version: 0.0.2
4
+ Summary: An extension for "filestate" package, which adds GIT management operations.
5
+ Home-page: https://github.com/wexample/python-filestate-git
6
+ Author: weeger
7
+ Author-email: contact@wexample.com
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Operating System :: OS Independent
11
+ Requires-Python: >=3.6
12
+ Description-Content-Type: text/markdown
13
+ License-File: LICENSE
14
+ Requires-Dist: gitpython
15
+ Requires-Dist: pydantic
16
+ Requires-Dist: wexample-filestate
17
+ Requires-Dist: wexample-helpers
18
+
19
+ # filestate
20
+
21
+ `filestate` is a Python package that allows you to manage the state of files and directories using YAML configuration files.
22
+
23
+ ## Features
24
+
25
+ - **Apply and Modify Permissions and Ownership**: Manage file and directory permissions and ownership individually or recursively.
26
+ - **Create, Modify, and Delete Directories**: Use patterns and regex to create, modify, and delete directories and subdirectories (e.g., ensure each `Entity/MyEntity.php` file has a corresponding `Repository/MyEntityRepository.php`).
27
+ - **Create Files Using Templates and Placeholders**: Generate files from templates with dynamic placeholders.
28
+
29
+ ## Installation
30
+
31
+ Install `filestate` with pip:
32
+
33
+ pip install wexample-filestate
34
+
35
+ ## Usage
36
+
37
+ ### Configuration File Example
38
+
39
+ ```yaml
40
+ # example.yaml
41
+ children:
42
+ - path: /path/to/file
43
+ owner: user
44
+ group: group
45
+ mode: '0644'
46
+ - path: /path/to/directory
47
+ recursive: true
48
+ mode: '0755'
49
+ create: true
50
+ ```
51
+
52
+ ## Usage
53
+
54
+ Here's how you can use filestate in your Python code:
55
+
56
+ ```
57
+ from filestate import FileStateManager
58
+
59
+ # Initialize the state manager with the root directory
60
+ state_manager = FileStateManager('root/directory/')
61
+
62
+ # Configure the state manager from a YAML configuration file
63
+ state_manager.configure_from_file('configuration.yaml')
64
+
65
+ # Perform a dry run to see what changes would be made
66
+ result = state_manager.dry_run()
67
+ result.print()
68
+
69
+ # Check if the configuration can be successfully applied
70
+ if state_manager.succeed():
71
+ # Apply the configuration
72
+ state_manager.apply()
73
+ else:
74
+ print("Configuration could not be applied successfully.")
75
+
76
+ ```
77
+
78
+ ### Applying and Modifying Permissions
79
+
80
+ ```
81
+ state_manager = FileStateManager('/var/www/')
82
+ state_manager.configure({
83
+ 'files': [
84
+ {'path': '/var/www/index.html', 'owner': 'www-data', 'group': 'www-data', 'mode': '0644'},
85
+ {'path': '/var/www/css/', 'recursive': True, 'owner': 'www-data', 'group': 'www-data', 'mode': '0755'}
86
+ ]
87
+ })
88
+ state_manager.apply()
89
+ ```
90
+
91
+ ### Applying and Modifying Permissions
92
+
93
+ ```
94
+ state_manager = FileStateManager('/project/')
95
+ state_manager.configure({
96
+ 'directories': [
97
+ {'path': '/project/src/Entity/', 'create': True},
98
+ {'path': '/project/src/Repository/', 'create': True, 'pattern': 'Entity/*Entity.php', 'target': 'Repository/*Repository.php'}
99
+ ]
100
+ })
101
+ state_manager.apply()
102
+ ```
103
+
104
+ ## Testing
105
+
106
+ pytest -s pip/filestate/tests/
107
+
108
+ ## License
109
+
110
+ This project is licensed under the MIT License - see the LICENSE file for details.
File without changes
@@ -0,0 +1,12 @@
1
+ wexample_filestate_git/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ wexample_filestate_git-0.0.2.dist-info/.wex/.env,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
+ wexample_filestate_git-0.0.2.dist-info/.wex/config.yml,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
+ wexample_filestate_git-0.0.2.dist-info/.gitignore,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
+ wexample_filestate_git-0.0.2.dist-info/LICENSE,sha256=pAZXnNE2dxxwXFIduGyn1gpvPefJtUYOYZOi3yeGG94,1068
6
+ wexample_filestate_git-0.0.2.dist-info/METADATA,sha256=bX-mmtEX6PwiW1gS5L6whuQni0jlc0tPNw2bTuswxks,3092
7
+ wexample_filestate_git-0.0.2.dist-info/README.md,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
+ wexample_filestate_git-0.0.2.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
9
+ wexample_filestate_git-0.0.2.dist-info/setup.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
+ wexample_filestate_git-0.0.2.dist-info/top_level.txt,sha256=V6x0uxXLTpZU2DmaKVlU-VpfoUdXZLdPq-VoRI5_BVQ,23
11
+ wexample_filestate_git-0.0.2.dist-info/version.txt,sha256=axN4nkPlSFY0Uz3hamXYup00xMl1hYi2ZYBUNfgOsRU,5
12
+ wexample_filestate_git-0.0.2.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: bdist_wheel (0.44.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
File without changes
@@ -0,0 +1 @@
1
+ wexample_filestate_git
@@ -0,0 +1 @@
1
+ 0.0.1