Skip to content

Commit

Permalink
Merge branch 'release/0.6.2' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
djsudduth committed Sep 16, 2024
2 parents e917dd7 + 1fba1f1 commit 203e3ce
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -270,9 +270,14 @@ Removed python deprecated imghdr library with pillow module
## 0.6.0 Recent Changes
Now requires Python v-3.10+ to run KIM
New Docker image to get the Keep token
Old keep-test.py module removed for new Google authentication (get_token.py added)
Old keep-test.py module removed for new Google authentication (get_token.py added)
New simple INSTALL.md steps

## 0.6.1 Recent Changes
New instructions and Dockerfile for updated versions of gkeepapi and gpsoauth to get keep token
Wikilinking now supported for Joplin notes

## 0.6.2 Recent Changes
Fixed the keep.resume warning message for newer gkeepapi version >= 0.16.0
Fixed the Python 3.12+ regular expression error
Added more detail error message if KIM fails to execute
23 changes: 12 additions & 11 deletions kim.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@
from pathlib import Path
from dataclasses import dataclass
from xmlrpc.client import boolean
from importlib.metadata import version
from PIL import Image

KIM_VERSION = "0.6.1"
KIM_VERSION = "0.6.2"
KEEP_KEYRING_ID = 'google-keep-token'
KEEP_NOTE_URL = "https://keep.google.com/#NOTE/"
CONFIG_FILE = "settings.cfg"
Expand Down Expand Up @@ -150,7 +151,7 @@ def convert_urls(text):
# pylint: disable=anomalous-backslash-in-string
urls = re.findall(
"http[s]?://(?:[a-zA-Z]|[0-9]|[~#$-_@.&+]"
"|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+",
"|[!*\\(\\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+",
text
)
#Note that the use of temporary %%% is because notes
Expand Down Expand Up @@ -261,7 +262,11 @@ def login(self, pw, keyring_reset):
return self._keep_token

def resume(self):
self._keepapi.resume(self._userid, self._keep_token)
kv = version('gkeepapi')
if kv < "0.16.0":
self._keepapi.resume(self._userid, self._keep_token)
else:
self._keepapi.authenticate(self._userid, self._keep_token)

def getnotes(self):
return(self._keepapi.all())
Expand Down Expand Up @@ -418,7 +423,7 @@ def replace(match):
link_text = match.group(1)
# Split the link text by pipe symbol, if present
parts = link_text.split("|")
print (link_text)
# print (link_text)
file_link = parts[0].replace(' ', '%20')
if len(parts) == 1:
# No pipe symbol, use the same text for link and display text
Expand Down Expand Up @@ -736,8 +741,6 @@ def ui_welcome_config():
def main(r, o, a, p, s, c, l, j, m, i, search_term, master_token):

try:

#m = True
opts = Options(o, a, p, s, c, l, j, m, i)
click.echo("\r\nWelcome to Keep it Markdown or KIM " + KIM_VERSION + "!\r\n")

Expand All @@ -753,16 +756,14 @@ def main(r, o, a, p, s, c, l, j, m, i, search_term, master_token):

keep = ui_login(r, master_token)


if i:
keep_import_notes(keep)
else:
ui_query(keep, search_term, opts)

except:
print("Could not excute KIM")
#except Exception as e:
# raise Exception("Problem with markdown file creation: " + repr(e))
except Exception as e:
print("Could not excute KIM - \nError: " + repr(e) + " ")



if __name__ == '__main__':
Expand Down

0 comments on commit 203e3ce

Please sign in to comment.