Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Open sidebar
yaq
yaqd-gdrive
Commits
2386e68d
Commit
2386e68d
authored
May 15, 2020
by
Blaise Thompson
Committed by
Kyle Sunden
May 15, 2020
Browse files
add daemon-level version
parent
64910b66
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
0 deletions
+34
-0
CHANGELOG.md
CHANGELOG.md
+1
-0
yaqd_gdrive/__init__.py
yaqd_gdrive/__init__.py
+1
-0
yaqd_gdrive/__version__.py
yaqd_gdrive/__version__.py
+29
-0
yaqd_gdrive/_gdrive.py
yaqd_gdrive/_gdrive.py
+3
-0
No files found.
CHANGELOG.md
View file @
2386e68d
...
...
@@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/).
-
added changelog
-
Use format strings instead of assuming concatenation
-
added mypy to precommit
-
added daemon-level version, see
[
YEP-105
](
https://yeps.yaq.fyi/105/
)
### Changed
-
from now on, yaqd-gdrive will use calendar based versioning
...
...
yaqd_gdrive/__init__.py
View file @
2386e68d
from
.__version__
import
*
from
._gdrive
import
*
yaqd_gdrive/__version__.py
0 → 100644
View file @
2386e68d
"""Define version."""
import
pathlib
here
=
pathlib
.
Path
(
__file__
).
resolve
().
parent
__all__
=
[
"__version__"
,
"__branch__"
]
# read from VERSION file
with
open
(
str
(
here
/
"VERSION"
))
as
f
:
__version__
=
f
.
read
().
strip
()
# add git branch, if appropriate
p
=
here
.
parent
/
".git"
if
p
.
is_file
():
with
open
(
str
(
p
))
as
f
:
p
=
p
.
parent
/
f
.
readline
()[
8
:].
strip
()
# Strip "gitdir: "
p
=
p
/
"HEAD"
if
p
.
exists
():
with
open
(
str
(
p
))
as
f
:
__branch__
=
f
.
readline
().
rstrip
().
split
(
r
"/"
)[
-
1
]
__version__
+=
"+"
+
__branch__
else
:
__branch__
=
""
yaqd_gdrive/_gdrive.py
View file @
2386e68d
...
...
@@ -14,6 +14,8 @@ import aiohttp.web # type: ignore
import
appdirs
# type: ignore
import
yaqd_core
from
.__version__
import
__branch__
UploadItem
=
collections
.
namedtuple
(
"UploadItem"
,
"kind name path parent client_id"
,
defaults
=
[
None
]
...
...
@@ -39,6 +41,7 @@ def refresh_oauth(func):
class
GDrive
(
yaqd_core
.
Base
):
_kind
=
"gdrive"
_version
=
"1.0.0"
+
f
"+
{
__branch__
}
"
if
__branch__
else
""
defaults
=
{
"scopes"
:
[
"https://www.googleapis.com/auth/drive.file"
],
"authorization_url"
:
"https://accounts.google.com/o/oauth2/v2/auth"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment