dwavesystems / homebase Goto Github PK
View Code? Open in Web Editor NEWplatform independent access to user data folders.
Home Page: http://homebase.readthedocs.io/
License: Other
platform independent access to user data folders.
Home Page: http://homebase.readthedocs.io/
License: Other
When tests are run in a FreeBSD port HOME directory is redefined to point to /usr/ports/{category}/{name}/work
.
Python-3.9
OS: FreeBSD 13.1
PySMT installation requires executing a command (pysmt-install --env
) to obtain a string with another command to execute to update PYTHONPATH
https://github.com/pysmt/pysmt#installation
The documentation is generated, but a build needs to be put on readthedocs
The error:
>>> import homebase
>>> homebase.site_config_dir("myapp", "author")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/tmp/tmp.fumBiPyUdA/lib/python3.5/site-packages/homebase/homebase.py", line 307, in site_config_dir
return _get_folder(False, _FolderTypes.config, app_name, app_author, version, False, use_virtualenv, create)[0]
File "/tmp/tmp.fumBiPyUdA/lib/python3.5/site-packages/homebase/homebase.py", line 430, in _get_folder
os.makedirs(final_path)
File "/tmp/tmp.fumBiPyUdA/lib/python3.5/os.py", line 231, in makedirs
makedirs(head, mode, exist_ok)
File "/tmp/tmp.fumBiPyUdA/lib/python3.5/os.py", line 241, in makedirs
mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/etc/xdg/xdg-ubuntu'
The site_config_dir()
and site_config_dir_list()
should probably have create=False
as the default.
Line 327 in bceb0fb
The folder_type input can be decoupled into site/user and data/config/etc, perhaps as enums.
Most of the other Ocean packages have been updated to use CircleCI, we should update homebase as well.
Line 40 in bceb0fb
Hi Oren, when I tried to install, I had to manually install the "enum" package (after that, "enum34" was installed automatically when I called setup.py).
Config dirs (on Linux) returned according to XDG (X Windows Desktop) specs:
/etc/xdg/xdg-ubuntu
/usr/share/upstart/xdg
/etc/xdg
Data dirs:
/usr/share/ubuntu
/usr/share/gnome
/usr/local/share
/usr/share
/var/lib/snapd/desktop
/var/lib/snapd/desktop
For the default system-wide config dir, homebase
returns:
>>> homebase.site_config_dir("myapp", "author", create=False)
'/etc/xdg/xdg-ubuntu/myapp'
I was expecting to see something like /usr/local/share/myapp
and /etc/local/myapp
.
Line 445 in bceb0fb
For all directory lookup operations when create=True
, this gets executed in _get_folder()
:
Lines 429 to 430 in 482e917
Since directory existence check and create are not one atomic operation, it's possible directory gets created (by another thread or process running the same code) between the check and the create. When that happens, the other thread/process fails with FileExistsError
.
The solution here is to set exist_ok=True
when calling os.makedirs
. I.e. the create op should be idempotent here.
We want to point out the pieces of appdirs code and include their license.
Travis runs in virtualenv, make most of the tests meaningless. We need to run in a docker container.
Better to enumerate packages directly. It's more readable and doesn't have unexpected behaviour.
Line 20 in 288bb59
home_dir = homebase.home_dir()
or similar
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.