mattdood / zet-cli Goto Github PK
View Code? Open in Web Editor NEWA Zettlekasten command line utility.
License: MIT License
A Zettlekasten command line utility.
License: MIT License
This would be a larger refactor that would change the settings, but would also need to have a metadata
shift to be dynamic.
Hey there,
thanks for this package, I would like to start using it but hit a little snag, I installed it via pip:
pip install zet-cli
but when trying to run zet --help
for the first time, it fails to find the .example.json
:
File "/home/minkiu/Projects/zet-cli/.venv/lib64/python3.10/site-packages/zet/settings.py", line 62, in __init__
shutil.copyfile(example_settings, self.zet_local_env_path)
File "/usr/lib64/python3.10/shutil.py", line 254, in copyfile
with open(src, 'rb') as fsrc:
FileNotFoundError: [Errno 2] No such file or directory: '/home/minkiu/Projects/zet-cli/.venv/lib64/python3.10/.env/.example.json'
Subsecuently it will fail with not finding the FileNotFoundError: [Errno 2] No such file or directory: '/home/minkiu/zet/.env/.local.json'
since it did not create it in the first instance.
I think this is due to the setup.py
not including in any way the .env
directory upon installation, I tried some stuff but can't seem to make it work (not that familiar with setuptools, sorry).
This issue is in part to ask if it would make more sense to have the contents of .example.json
inside settings.py
and json.dump()
that dict into the .local.json
upon initialization. I can make a PR for this if you'd like it so.
And while typing this I wondered why make a hidden .json
when the directory is already hidden? maybe it could be .env/local.json
, but I digress.
Cheers!
EDIT:
Hmmm I believe the same might be happening with the default templates
:
zet create -t "first entry" -c "tests" -tag "musings"
{'category': 'tests',
'command': 'create',
'tags': 'musings',
'template': 'default',
'title': 'first entry',
'which': 'create',
'zet_repo': 'zets'}
Traceback (most recent call last):
File "/home/minkiu/.local/bin/zet", line 8, in <module>
sys.exit(main())
File "/home/minkiu/.local/lib/python3.10/site-packages/zet/main.py", line 366, in main
zet.create(**filtered_args)
File "/home/minkiu/.local/lib/python3.10/site-packages/zet/zet.py", line 166, in create
new_file = shutil.copyfile(template, filename)
File "/usr/lib64/python3.10/shutil.py", line 254, in copyfile
with open(src, 'rb') as fsrc:
FileNotFoundError: [Errno 2] No such file or directory: '/home/minkiu/.local/lib/python3.10/src/zet/templates/readme.md'
Although the path seems wrong: '/home/minkiu/.local/lib/python3.10/src/zet/templates/readme.md'
it should pobably be '/home/minkiu/.local/lib/python3.10/site-packages/zet/templates/readme.md'
, right?
Here's the contents of the pip install zet-cli
folder:
$ ls -lha ~/.local/lib/python3.10/site-packages/zet/
total 48K
drwxr-xr-x. 1 minkiu minkiu 172 Jan 5 18:49 .
drwxr-xr-x. 1 minkiu minkiu 166 Jan 5 18:49 ..
-rw-r--r--. 1 minkiu minkiu 1.3K Jan 5 18:49 editor_commands.py
-rw-r--r--. 1 minkiu minkiu 2.9K Jan 5 18:49 git_commands.py
-rw-r--r--. 1 minkiu minkiu 0 Jan 5 18:49 __init__.py
-rw-r--r--. 1 minkiu minkiu 12K Jan 5 18:49 main.py
drwxr-xr-x. 1 minkiu minkiu 332 Jan 5 18:49 __pycache__
-rw-r--r--. 1 minkiu minkiu 3.2K Jan 5 18:49 repo.py
-rw-r--r--. 1 minkiu minkiu 8.5K Jan 5 18:49 settings.py
-rw-r--r--. 1 minkiu minkiu 7.0K Jan 5 18:49 zet.py
This can probably be fixed by either changing the CWD inside the command or by doing a CD command to the zet repo itself
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.