|
1 | 1 | {% extends 'README.rst.jj2' %}
|
2 | 2 |
|
3 | 3 | {%block documentation_link%}
|
4 |
| -.. image:: https://dev.azure.com/{{orgnisation}}/{{name}}/_apis/build/status/{{orgnisation}}.{{name}}?branchName=master |
| 4 | +.. image:: https://dev.azure.com/{{organisation}}/{{name}}/_apis/build/status/{{organisation}}.{{name}}?branchName=master |
5 | 5 | :target: https://dev.azure.com/{{organisation}}/{{name}}/_build/latest?definitionId=2&branchName=master
|
6 | 6 | {%endblock%}
|
| 7 | + |
| 8 | +{% block features %} |
| 9 | + |
| 10 | +It helps perform `file operations <https://docs.pyfilesystem.org/en/latest/guide.html>`_ over a git repository. |
| 11 | +It clones the git repository and returns python file system 2's `OSFS <https://docs.pyfilesystem.org/en/latest/reference/osfs.html>`_ instance. |
| 12 | + |
| 13 | +The idea originates from `moban <https://github.com/moremoban/moban>`_, which uses git repositories as |
| 14 | +a vehicle to have versioned templates for the creation of a new python package. Surely, it can be implemented |
| 15 | +in any other ways but moban v0.6.0 mandates python file system 2 interface. Hence this library is written. |
| 16 | + |
| 17 | +Get a file inside a python package |
| 18 | +-------------------------------------------------------------------------------- |
| 19 | + |
| 20 | +.. code-block:: python |
| 21 | + |
| 22 | + >>> import fs |
| 23 | + >>> git_fs = fs.open_fs("git://github.com/moremobans/pypi-mobans.git!/templates") |
| 24 | + >>> git_fs.readtext("_version.py.jj2") |
| 25 | + '__version__ = "{{version}}"\n__author__ = "{{author}}"\n' |
| 26 | + |
| 27 | + |
| 28 | +Get from a different branch |
| 29 | +-------------------------------------------------------------------------------- |
| 30 | + |
| 31 | +.. code-block:: python |
| 32 | + |
| 33 | +.. code-block:: python |
| 34 | + |
| 35 | + >>> import fs |
| 36 | + >>> git_fs = fs.open_fs("git://github.com/moremobans/pypi-mobans.git?branch=master!/templates") |
| 37 | + >>> git_fs.read("_version.py.jj2") |
| 38 | + '__version__ = "{{version}}"\n__author__ = "{{author}}"\n' |
| 39 | + |
| 40 | + |
| 41 | +Checkout submodules recursively |
| 42 | +-------------------------------------------------------------------------------- |
| 43 | + |
| 44 | +.. code-block:: python |
| 45 | + |
| 46 | +.. code-block:: python |
| 47 | + |
| 48 | + >>> git_fs = fs.open_fs("git://github.com/moremobans/pypi-mobans.git?branch=master&submodule=true!/templates") |
| 49 | + |
| 50 | + |
| 51 | +Does it write? |
| 52 | +-------------------------------------------------------------------------------- |
| 53 | + |
| 54 | +Yes locally, it will write as you can do so without using gitfs2. And no, it does help |
| 55 | +commit and push the changes for you. |
| 56 | + |
| 57 | +Plus, the intention is never to write to a repository. |
| 58 | + |
| 59 | + |
| 60 | +{% endblock %} |
0 commit comments