mirror of
https://github.com/deadc0de6/dotdrop.git
synced 2026-02-11 02:04:15 +00:00
update doc for #290
This commit is contained in:
@@ -136,11 +136,13 @@ Beside the python dependencies defined in [requirements.txt](https://github.com/
|
|||||||
dotdrop depends on following tools:
|
dotdrop depends on following tools:
|
||||||
|
|
||||||
* `diff`
|
* `diff`
|
||||||
* `file` (if libmagic is not installed, see <https://github.com/ahupp/python-magic>)
|
|
||||||
* `git` (only if using the entry point script [dotdrop.sh](https://github.com/deadc0de6/dotdrop/blob/master/dotdrop.sh))
|
* `git` (only if using the entry point script [dotdrop.sh](https://github.com/deadc0de6/dotdrop/blob/master/dotdrop.sh))
|
||||||
* `readlink` or `realpath` (only if using the entry point script [dotdrop.sh](https://github.com/deadc0de6/dotdrop/blob/master/dotdrop.sh))
|
* `readlink` or `realpath` (only if using the entry point script [dotdrop.sh](https://github.com/deadc0de6/dotdrop/blob/master/dotdrop.sh))
|
||||||
|
|
||||||
For MacOS users, make sure to install `realpath` (part of `coreutils`) through [homebrew](https://brew.sh/).
|
For MacOS users, make sure to install below packages through [homebrew](https://brew.sh/):
|
||||||
|
|
||||||
|
* [coreutils](https://formulae.brew.sh/formula/coreutils) (only if using the entry point script [dotdrop.sh](https://github.com/deadc0de6/dotdrop/blob/master/dotdrop.sh) - realpath)
|
||||||
|
* [libmagic](https://formulae.brew.sh/formula/libmagic) - python-magic
|
||||||
|
|
||||||
## Update dotdrop submodule
|
## Update dotdrop submodule
|
||||||
|
|
||||||
|
|||||||
@@ -152,6 +152,7 @@ class Templategen:
|
|||||||
if self.debug:
|
if self.debug:
|
||||||
self.log.dbg('using \"magic\" for filetype identification')
|
self.log.dbg('using \"magic\" for filetype identification')
|
||||||
except ImportError:
|
except ImportError:
|
||||||
|
# fallback
|
||||||
_, filetype = utils.run(['file', '-b', '--mime-type', src],
|
_, filetype = utils.run(['file', '-b', '--mime-type', src],
|
||||||
raw=False, debug=self.debug)
|
raw=False, debug=self.debug)
|
||||||
if self.debug:
|
if self.debug:
|
||||||
|
|||||||
@@ -275,25 +275,32 @@ def dependencies_met():
|
|||||||
if not which(dep):
|
if not which(dep):
|
||||||
raise Exception(err.format(dep))
|
raise Exception(err.format(dep))
|
||||||
# check python deps
|
# check python deps
|
||||||
err = 'missing python module {}'
|
err = 'missing python module \"{}\"'
|
||||||
|
|
||||||
|
# python-magic
|
||||||
try:
|
try:
|
||||||
import magic
|
import magic
|
||||||
assert(magic)
|
assert(magic)
|
||||||
|
if not hasattr(magic, 'from_file'):
|
||||||
|
LOG.warn(err.format('python-magic'))
|
||||||
except ImportError:
|
except ImportError:
|
||||||
raise Exception(err.format('python-magic'))
|
LOG.warn(err.format('python-magic'))
|
||||||
if not hasattr(magic, 'from_file'):
|
|
||||||
e = 'wrong magic module found'
|
# docopt
|
||||||
raise Exception(e)
|
|
||||||
try:
|
try:
|
||||||
from docopt import docopt
|
from docopt import docopt
|
||||||
assert(docopt)
|
assert(docopt)
|
||||||
except ImportError:
|
except ImportError:
|
||||||
raise Exception(err.format('docopt'))
|
raise Exception(err.format('docopt'))
|
||||||
|
|
||||||
|
# jinja2
|
||||||
try:
|
try:
|
||||||
import jinja2
|
import jinja2
|
||||||
assert(jinja2)
|
assert(jinja2)
|
||||||
except ImportError:
|
except ImportError:
|
||||||
raise Exception(err.format('jinja2'))
|
raise Exception(err.format('jinja2'))
|
||||||
|
|
||||||
|
# ruamel.yaml
|
||||||
try:
|
try:
|
||||||
from ruamel.yaml import YAML
|
from ruamel.yaml import YAML
|
||||||
assert(YAML)
|
assert(YAML)
|
||||||
|
|||||||
Reference in New Issue
Block a user