Skip to content

Commit 4dc63a7

Browse files
committed
📚 update readme
1 parent 3a23606 commit 4dc63a7

File tree

3 files changed

+108
-3
lines changed

3 files changed

+108
-3
lines changed

.moban.d/CUSTOM_README.rst.jj2

Lines changed: 55 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,60 @@
11
{% extends 'README.rst.jj2' %}
22

33
{%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
55
:target: https://dev.azure.com/{{organisation}}/{{name}}/_build/latest?definitionId=2&branchName=master
66
{%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 %}

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ python:
1313
- 2.7
1414

1515
stages:
16-
- test
1716
- lint
17+
- test
1818

1919
.disable_global: &disable_global
2020
addons: false

README.rst

Lines changed: 52 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,61 @@ gitfs2
99
:target: https://codecov.io/github/moremoban/gitfs2
1010

1111

12-
.. image:: https://dev.azure.com//gitfs2/_apis/build/status/.gitfs2?branchName=master
12+
.. image:: https://dev.azure.com/moremoban/gitfs2/_apis/build/status/moremoban.gitfs2?branchName=master
1313
:target: https://dev.azure.com/moremoban/gitfs2/_build/latest?definitionId=2&branchName=master
1414

1515

16+
It helps perform `file operations <https://docs.pyfilesystem.org/en/latest/guide.html>`_ over a git repository.
17+
It clones the git repository and returns python file system 2's `OSFS <https://docs.pyfilesystem.org/en/latest/reference/osfs.html>`_ instance.
18+
19+
The idea originates from `moban <https://github.com/moremoban/moban>`_, which uses git repositories as
20+
a vehicle to have versioned templates for the creation of a new python package. Surely, it can be implemented
21+
in any other ways but moban v0.6.0 mandates python file system 2 interface. Hence this library is written.
22+
23+
Get a file inside a python package
24+
--------------------------------------------------------------------------------
25+
26+
.. code-block:: python
27+
28+
>>> import fs
29+
>>> git_fs = fs.open_fs("git://github.com/moremobans/pypi-mobans.git!/templates")
30+
>>> git_fs.readtext("_version.py.jj2")
31+
'__version__ = "0.0.1"\n__author__ = "C.W."\n'
32+
33+
34+
Get from a different branch
35+
--------------------------------------------------------------------------------
36+
37+
.. code-block:: python
38+
39+
.. code-block:: python
40+
41+
>>> import fs
42+
>>> git_fs = fs.open_fs("git://github.com/moremobans/pypi-mobans.git?branch=master!/templates")
43+
>>> git_fs.read("_version.py.jj2")
44+
'__version__ = "0.0.1"\n__author__ = "C.W."\n'
45+
46+
47+
Checkout submodules recursively
48+
--------------------------------------------------------------------------------
49+
50+
.. code-block:: python
51+
52+
.. code-block:: python
53+
54+
>>> git_fs = fs.open_fs("git://github.com/moremobans/pypi-mobans.git?branch=master&submodule=true!/templates")
55+
56+
57+
Does it write?
58+
--------------------------------------------------------------------------------
59+
60+
Yes locally, it will write as you can do so without using gitfs2. And no, it does help
61+
commit and push the changes for you.
62+
63+
Plus, the intention is never to write to a repository.
64+
65+
66+
1667
Installation
1768
================================================================================
1869

0 commit comments

Comments
 (0)