-
Notifications
You must be signed in to change notification settings - Fork 314
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for parsing config.toml from config dir
Initially this just supports a single config key, calendars.default-calendar.
- Loading branch information
Showing
6 changed files
with
60 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,5 +2,6 @@ include ChangeLog | |
include README.md | ||
exclude .git* | ||
|
||
graft data | ||
graft docs | ||
prune .github |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"title": "gcalcli config", | ||
"type": "object", | ||
"description": "User configuration for gcalcli command-line tool. See https://pypi.org/project/gcalcli/.", | ||
"properties": { | ||
"calendars": { | ||
"type": "object", | ||
"description": "Settings about the set of calendars gcalcli operates on", | ||
"properties": { | ||
"default-calendar": { | ||
"type": "array", | ||
"items": { "type": "string" }, | ||
"description": "Calendar(s) to use as default for certain commands when no explicit target calendar is otherwise specified" | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import os | ||
import pathlib | ||
import platformdirs | ||
|
||
from . import __program__ | ||
|
||
|
||
def default_data_dir() -> pathlib.Path: | ||
return platformdirs.user_data_path(__program__) | ||
|
||
|
||
def default_config_dir() -> pathlib.Path: | ||
return pathlib.Path( | ||
os.environ.get('GCALCLI_CONFIG') | ||
or platformdirs.user_config_dir(__program__) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters