reformat setup.org
This commit is contained in:
parent
185fa9aabd
commit
cb8bba4e66
1 changed files with 61 additions and 59 deletions
|
@ -12,7 +12,7 @@ I understand people may not super familiar with Python, PIP or generally unix, s
|
||||||
|
|
||||||
- similarly, I'm using =python3= in the documentation, but if your =python --version= says python3, it's okay to use =python=
|
- similarly, I'm using =python3= in the documentation, but if your =python --version= says python3, it's okay to use =python=
|
||||||
|
|
||||||
- when you use ~pip install~, [[https://stackoverflow.com/a/42989020/706389][always pass =--user=]]
|
- when you are using ~pip install~, [[https://stackoverflow.com/a/42989020/706389][always pass]] =--user=
|
||||||
- throughout the guide I'm assuming the config directory is =~/.config=, but it's different on Mac/Windows.
|
- throughout the guide I'm assuming the config directory is =~/.config=, but it's different on Mac/Windows.
|
||||||
|
|
||||||
See [[https://github.com/ActiveState/appdirs/blob/3fe6a83776843a46f20c2e5587afcffe05e03b39/appdirs.py#L187-L190][this]] if you're not sure what's your user config dir.
|
See [[https://github.com/ActiveState/appdirs/blob/3fe6a83776843a46f20c2e5587afcffe05e03b39/appdirs.py#L187-L190][this]] if you're not sure what's your user config dir.
|
||||||
|
@ -69,7 +69,9 @@ If you're not planning to use private configuration (some modules don't need it)
|
||||||
|
|
||||||
The configuration contains paths to the data on your disks, links to external repositories, etc.
|
The configuration contains paths to the data on your disks, links to external repositories, etc.
|
||||||
|
|
||||||
By default, your config is expected in =~/.config/my=. For example, mine looks like:
|
By default, your config is expected in =~/.config/my=
|
||||||
|
|
||||||
|
- For example, mine looks like:
|
||||||
|
|
||||||
#+begin_src python :exports results :results output
|
#+begin_src python :exports results :results output
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
@ -95,7 +97,7 @@ for p in sorted(pp.rglob('*')):
|
||||||
~/.config/my/my/config/repos/rexport
|
~/.config/my/my/config/repos/rexport
|
||||||
#+end_example
|
#+end_example
|
||||||
|
|
||||||
You can see an example in [[file:../mycfg_template][~mycfg_template~]]:
|
- Another example is in [[file:../mycfg_template][mycfg_template]]:
|
||||||
|
|
||||||
#+begin_src bash :exports results :results output
|
#+begin_src bash :exports results :results output
|
||||||
cd ..
|
cd ..
|
||||||
|
@ -134,7 +136,7 @@ l mycfg_template/my/config/repos/hypexport -> /tmp/my_demo/hypothesis_repo
|
||||||
As you can see, generally you specify fixed paths (e.g. to your backups directory) in ~__init__.py~.
|
As you can see, generally you specify fixed paths (e.g. to your backups directory) in ~__init__.py~.
|
||||||
Feel free to add other files as well though to organize better, it's a real Python package after all!
|
Feel free to add other files as well though to organize better, it's a real Python package after all!
|
||||||
|
|
||||||
Some things (e.g. links to external packages like [[https://github.com/karlicoss/hypexport][hypexport]]) are specified as ordinary symlinks in ~repos~ directory.
|
Some things (e.g. links to external packages like [[https://github.com/karlicoss/hypexport][hypexport]]) are specified as *ordinary symlinks* in ~repos~ directory.
|
||||||
That way you get easy imports (e.g. =import my.config.repos.hypexport.model=) and proper IDE integration.
|
That way you get easy imports (e.g. =import my.config.repos.hypexport.model=) and proper IDE integration.
|
||||||
|
|
||||||
# TODO link to post about exports?
|
# TODO link to post about exports?
|
||||||
|
@ -159,8 +161,8 @@ It uses exports provided by [[https://github.com/karlicoss/kobuddy][kobuddy]] pa
|
||||||
|
|
||||||
- prepare the config
|
- prepare the config
|
||||||
|
|
||||||
1. Point =ln -sfT /path/to/kobuddy ~/.config/my/config/repos/kobuddy=
|
1. Point =ln -sfT /path/to/kobuddy ~/.config/my/my/config/repos/kobuddy=
|
||||||
2. Add kobo config to =~/.config/my/config/__init__.py=
|
2. Add kobo config to =~/.config/my/my/config/__init__.py=
|
||||||
#+begin_src python
|
#+begin_src python
|
||||||
class kobo:
|
class kobo:
|
||||||
export_dir = 'path/to/kobo/exports'
|
export_dir = 'path/to/kobo/exports'
|
||||||
|
|
Loading…
Add table
Reference in a new issue