first commit

This commit is contained in:
2020-11-03 18:30:14 -08:00
commit 31d8522470
1881 changed files with 345408 additions and 0 deletions

View File

@@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [2020] [SaltStack, Inc.]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

View File

@@ -0,0 +1,215 @@
Metadata-Version: 2.1
Name: pop-config
Version: 6.11
Summary: UNKNOWN
Home-page: https://www.saltstack.com
Author: Thomas S Hatch
Author-email: thatch45@gmail.com
License: UNKNOWN
Platform: UNKNOWN
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Development Status :: 5 - Production/Stable
Requires-Python: >=3.6
Description-Content-Type: text/x-rst
Requires-Dist: pop
Requires-Dist: dict-toolbox
Requires-Dist: aiologger[aiofiles]
==========
Pop Config
==========
Pop-config is the official tool to allow for creating and app-merging
configuration options for `pop` projects. Plugin Oriented Programming
presents a means to merge multiple applications together dynamically.
This capabilities requires that the startup of these applications needs
to be managed from within the programming paradigm. Since this is the case
`pop-config` becomes a critical and hard requirement of `pop`.
Pop-config is not just about being able to work with `pop` projects
to facilitate app-merging, it has also been designed to make the startup
of an application much simpler, and to make the expensive boiler plate
of startup and configuration as transparent as possible. When making
`pop` projects the idea is that projects are developed in very small
chunks and are then dynamically merged together. So the creation of
these mergeable apps needs to be quick and easy!
Pop-config also solves a problem with configuration of applications,
when making a new application, if you want robust configuration
loading, you need to be able to take options from the command line,
environment variables, and configuration files. Pop-config does all
of this for you, and loads them in the correct order, all behind the
scenes, making your life easier.
Understanding the conf.py
=========================
Pop relies on a configuration file to manage how to merge apps, and
also how to manage and merge configuration data. The data in this file
is presented in 4 Python dictionaries and defines every aspect of
configuration loading.
The 4 dictionaries are called *CONFIG*, *CLI_CONFIG*, *SUBCOMMANDS*
and *DYNE*. Each dictionary serves a specific purpose. Between them
you can define how the cli arguments are presented, all configuration
defaults, documentation, etc.
The CONFIG Dictionary
=====================
The bulk of the configuration will be present in the *CONFIG* dictionary.
all of your configuration options are defined here. Most entries in the
*CONFIG* dictionary will be very simple and just expose the most basic
values:
.. code-block:: python
CONFIG = {
"name": {
"default": "frank",
"help": "Enter the name to use",
},
}
This simple example presents the documentation for the configuration value
and what the default value should be.
Vertically app-merged projects can add config items to their parent dynes like so:
.. code-block:: python
CONFIG = {
"new_item": {
"type": int,
"default": 1,
"dyne": "idem",
},
}
Many more options can be used, but they will be covered in the reference
document.
The CLI_CONFIG Dictionary
=========================
Adding a configuration value does not make it appear on the command line.
Each application can be extended to include command line options.
Lets extend our earlier example to expose the "name" option as a command
line argument:
.. code-block:: python
CLI_CONFIG = {
"name": {},
}
CONFIG = {
"name": {
"default": "frank",
"help": "Enter the name to use",
},
}
That's it! The "name" option is now available on the command line and can
be used as `--name bob`.
But what if we want it to be a positional argument? Simple! Just add the
positional option to the *CLI_CONFIG*:
.. code-block:: python
CLI_CONFIG = {
"name": {
"positional": True,
},
}
CONFIG = {
"name": {
"default": "frank",
"help": "Enter the name to use",
},
}
You can inherit cli args from another project. Say, for example that you want to implement the `--output` flag
exactly the same way `rend` does, you can source it like this:
.. code-block:: python
CLI_CONFIG = {
"output": {
"source": "rend",
},
}
Many more options exist that allow you to control every aspect of the user's
command line experience.
The SUBCOMMANDS Dictionary
==========================
Sometimes it is desirable to have subcommands. Subcommands allow your CLI
to work in a way similar to the git cli, where you have multiple routines
that all can be called from a single command.
Lets add a few more things to our example so that we can have subcommands.
.. code-block:: python
CLI_CONFIG = {
"name": {
"subcommands": ["test", "apply"],
},
"weight": {},
"power": {
"subcommands": ["apply"],
},
}
CONFIG = {
"name": {
"default": "frank",
"help": "Enter the name to use",
},
"weight": {
"default": "150",
"help": "Enter how heavy it should be",
},
"power": {
"default": "100",
"help": "Enter how powerful it should be",
},
}
SUBCOMMANDS = {
"test": {
"help": "Used to test",
"desc": "When running in test mode, things will be tested",
},
"apply": {
"help": "Used to apply",
"desc": "When running in apply mode, things will be applied",
},
}
In this example we see that the option `name` will be available under
the subcommands `test` and `apply`. The option `power` will be available
only under the subcommand `apply` and the option `weight` is globally
available.
The DYNE Dictionary
===================
The *DYNE* dictionary allows you to control what dynamic names your app is
presenting to other `pop` projects. This name gets used not only inside
of `pop-config` but also inside of `pop` to determine what plugin subsystems
this application merges with. The *DYNE* system allows for your cli to be
extended by third party code, enabling configuration options to be made
available to your application via external code.
The *DYNE* system is very powerful. But since it is not critical to getting
started with `pop-config` it will be covered in more depth in another document.

View File

@@ -0,0 +1,50 @@
../../../bin/conf,sha256=_UoeCXo_AQepxaj0N-psJ9QnqSx9n-SnEZnUZ39QgRo,254
pop_config-6.11.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
pop_config-6.11.dist-info/LICENSE,sha256=gdjA1DOOrxZhmIBdFFWtPZ1j5woynQ4hdwZhGX9APlU,11349
pop_config-6.11.dist-info/METADATA,sha256=ebONgTl2Oeqv9WOn_YhQPiSpyEBoa_qDqnI6C4S_7Ag,6680
pop_config-6.11.dist-info/RECORD,,
pop_config-6.11.dist-info/WHEEL,sha256=g4nMs7d-Xl9-xC9XovUrsDHGXt-FT0E17Yqo92DEfvY,92
pop_config-6.11.dist-info/entry_points.txt,sha256=0TWjYa8To32XZBgNYBUFvwT4hzk3AgGuWv3c1Q2dYhs,45
pop_config-6.11.dist-info/top_level.txt,sha256=O_uoo9jjIR_8ZkAN2W16jsTcYgX331ZDAgpX3_Lca_Q,11
pop_config/__pycache__/conf.cpython-38.pyc,,
pop_config/__pycache__/scripts.cpython-38.pyc,,
pop_config/__pycache__/version.cpython-38.pyc,,
pop_config/conf.py,sha256=y99Dss2lCLaTIYHyljJYbUxny7ce_-Ia8EZdbsdD9YY,1575
pop_config/config/__pycache__/args.cpython-38.pyc,,
pop_config/config/__pycache__/dirs.cpython-38.pyc,,
pop_config/config/__pycache__/init.cpython-38.pyc,,
pop_config/config/__pycache__/integrate.cpython-38.pyc,,
pop_config/config/__pycache__/order.cpython-38.pyc,,
pop_config/config/__pycache__/version.cpython-38.pyc,,
pop_config/config/args.py,sha256=Kmc7bCrwpWvqjqZ-B09MMCyVuapjopsK36r7jlb8F60,7945
pop_config/config/contracts/__pycache__/order.cpython-38.pyc,,
pop_config/config/contracts/order.py,sha256=SBoZ4RauB0aT3DV2gLJrBuS2zT2sNASy2VBvLZ3ebE0,2832
pop_config/config/dirs.py,sha256=EjTgDk_PaZIjG2lOgQocKgJkW25HPlypyeUMidUwlCE,3579
pop_config/config/file/__pycache__/init.cpython-38.pyc,,
pop_config/config/file/init.py,sha256=P5QjjsnSpLNncUNiAJklxmS-OR_lbwBk1MjI-Ut9I04,3753
pop_config/config/init.py,sha256=X2FcLOqaG4iQJ8AKluQdtN_covIrfEb8fjt6_HKEIrw,314
pop_config/config/integrate.py,sha256=plTnjp7rNthiDA73Czc99OzQCJMCeCmIf49aNJZC4A4,995
pop_config/config/order.py,sha256=2akwfUETc7ykOaBH0n3R-g1JZvQDFhImNaFP9FMNb-E,1112
pop_config/config/os/__pycache__/init.cpython-38.pyc,,
pop_config/config/os/__pycache__/nix_os.cpython-38.pyc,,
pop_config/config/os/init.py,sha256=8vsaCZKeygF8mY2AvRUhoiKs2E9ZdNOP2JLPrrYsNDM,884
pop_config/config/os/nix_os.py,sha256=cu1BMCTpJRmE2kdAALWngGALe6vNP4HTk5P2sC4rMFY,488
pop_config/config/render/__pycache__/cli.cpython-38.pyc,,
pop_config/config/render/__pycache__/init.cpython-38.pyc,,
pop_config/config/render/__pycache__/json_conf.cpython-38.pyc,,
pop_config/config/render/__pycache__/toml_conf.cpython-38.pyc,,
pop_config/config/render/__pycache__/yaml_conf.cpython-38.pyc,,
pop_config/config/render/cli.py,sha256=xsBvFfmU2bHFwRA9ic3ndp-_V1r_jt3hSY0BFhtDqNA,922
pop_config/config/render/init.py,sha256=1XbGZb7eBLow5nqB1tl6ydQDQ3Y0MMrGtU2hxkv05Tg,1305
pop_config/config/render/json_conf.py,sha256=Pky12kmxOgE6rjnxgyMRwJzeEsKaFVzC4fFROvQ7O-k,498
pop_config/config/render/toml_conf.py,sha256=So6oW5lBHHvYs4b8BRNArZssdoCvj_yylt8HfT45tuU,669
pop_config/config/render/yaml_conf.py,sha256=HbWapt1fKY6N7dmxz7gZ_Rc2qRwZQvM8cXyXonbnxus,644
pop_config/config/version.py,sha256=84sRrhHCY-jtBv0pTP_YJ5CNyNwopCQpSUTuA3H1zLI,443
pop_config/log/__pycache__/async.cpython-38.pyc,,
pop_config/log/__pycache__/basic.cpython-38.pyc,,
pop_config/log/__pycache__/init.cpython-38.pyc,,
pop_config/log/async.py,sha256=xvPy05lOT_7_CknUgI_v5QFQ184HiqjSUVAtOAqpy9s,4955
pop_config/log/basic.py,sha256=LaYrWuyb978sMvwKxo2z1dVJVYibttCjrPHpkOSkJeQ,790
pop_config/log/init.py,sha256=g0iEBhN8j45xm7pA0G9eVoQL6VaN276vibw_QHYYFvA,1042
pop_config/scripts.py,sha256=J9jNfuQo2UjY8NKEAF1sd6lHAXlOLbUZOZ0cltyfS7Y,164
pop_config/version.py,sha256=uak5NaQ3TPiRQiyGcARNfIWN0cRmOfwLMhxO4viN3nY,41

View File

@@ -0,0 +1,5 @@
Wheel-Version: 1.0
Generator: bdist_wheel (0.34.2)
Root-Is-Purelib: true
Tag: py3-none-any

View File

@@ -0,0 +1,3 @@
[console_scripts]
conf = conf.scripts:start