-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"\n" escape sequences instead of new lines in copied Keep notes #251
Comments
Matt, Send me a Meet/Zoom invitation Ross |
Matt, This should be fixed in 6.16.10. I figured out the query. gam user user@domain.com show notes filter "create_time > "2022-03-09T15:00:00-08:00"" |
Hm. The command with
I also tried spelling the createTime parameter with CamelCase instead of snake_case. Same result.
|
gam user user@example.com show notes filter "create_time > "2022-03-09T15:00:00-08:00"" You need the backslashes Send me a Meet invitation |
GitHub is tossing the backslashes |
That works. Crazy that Google's API uses snake_case when the parameter is documented using camelCase. |
That and almost every other query wants strings in single quotes not double quotes. This should let your toss the badly imported notes and reimport |
I think something is still not quite right in versions 6.6.10 and 6.6.11 with respect to escaping characters in note text. I have some Keep notes that contain single quotes and double quotes, so I tried using tab as the value of
Notice above that the JSON contains sequences like I edited
|
Matt,
If you're available send me a Meet./Zoom invitation.
The \\n will be converted to \n.
The single and double quotes in thet text shold be handled properly.
Ross
--
***@***.***
… On Mar 9, 2022, at 8:06 PM, Matt McClure ***@***.***> wrote:
I think something is still not quite right in versions 6.6.10 and 6.6.11 with respect to escaping characters in note text.
I have some Keep notes that contain single quotes and double quotes, so I tried using tab as the value of quotechar as follows.
$ gam redirect csv ./notes.csv user ***@***.*** print notes formatjson quotechar ' ' # I inserted a literal tab character in the real command using Control-V, tab. When I paste it into GitHub's comment editor, it pastes 7 spaces instead.
$ gam csv ../notes.csv quotechar " " gam user ***@***.*** create note json "~JSON" copyacls
2022-03-10T03:31:43.497+00:00,0/1,Using 1 process...
Command: gam user ***@***.*** create note json >>>"{"body": {"text": {"text": "https://github.com/taers232c/GAMADV-XTD3/wiki/Users-Keep\\n\\nCopy notes and permissions from one user to another.\\ngam redirect csv ./notes.csv user ***@***.*** print notes formatjson quotechar \\"'\\"\\ngam csv ./notes.csv quotechar \\"'\\" gam user ***@***.*** create note json \\"~JSON\\" copyacls\\n\\nGoogle Keep\\nBackup Restore\\nImport Export\\nMigrate\\nTransfer\\nGAM\\nGAMADV-XTD3"}}, "createTime": "2022-03-04T13:14:59Z", "name": "notes/1X6-eSgnbTmVlhqthCR_977N5QjU9jMxAEu-fusNAn4lQLulZOBg1wFA3_aHUC0ZUDTmH", "ownedByMe": true, "owner": ***@***.***", "permissions": [{"email": ***@***.***", "name": "notes/1X6-eSgnbTmVlhqthCR_977N5QjU9jMxAEu-fusNAn4lQLulZOBg1wFA3_aHUC0ZUDTmH/permissions/AfoJJ7Zibw0YeZH75trnRApOnHvsMfeqEZ-BwqzH", "role": "OWNER", "user": {"email": ***@***.***"}}], "trashTime": "Never", "updateTime": "2022-03-04T13:15:37Z"}"<<< copyacls
ERROR: Expecting ',' delimiter: line 1 column 233 (char 232): {"body": {"text": {"text": "https://github.com/taers232c/GAMADV-XTD3/wiki/Users-Keep\\n\\nCopy notes and permissions from one user to another.\\ngam redirect csv ./notes.csv user ***@***.*** print notes formatjson quotechar \\"'\\"\\ngam csv ./notes.csv quotechar \\"'\\" gam user ***@***.*** create note json \\"~JSON\\" copyacls\\n\\nGoogle Keep\\nBackup Restore\\nImport Export\\nMigrate\\nTransfer\\nGAM\\nGAMADV-XTD3"}}, "createTime": "2022-03-04T13:14:59Z", "name": "notes/1X6-eSgnbTmVlhqthCR_977N5QjU9jMxAEu-fusNAn4lQLulZOBg1wFA3_aHUC0ZUDTmH", "ownedByMe": true, "owner": ***@***.***", "permissions": [{"email": ***@***.***", "name": "notes/1X6-eSgnbTmVlhqthCR_977N5QjU9jMxAEu-fusNAn4lQLulZOBg1wFA3_aHUC0ZUDTmH/permissions/AfoJJ7Zibw0YeZH75trnRApOnHvsMfeqEZ-BwqzH", "role": "OWNER", "user": {"email": ***@***.***"}}], "trashTime": "Never", "updateTime": "2022-03-04T13:15:37Z"}
Help: Syntax in file /Users/matthewlmcclure/code/gamadv-xtd3/gamadv-xtd3/GamCommands.txt
Help: Documentation is at https://github.com/taers232c/GAMADV-XTD3/wiki
Notice above that the JSON contains sequences like \\n and \\". I believe those should be \n and \" respectively.
I edited notes.csv accordingly. I replaced \\n with \n and I replace \\" with \" throughout the JSON body. Then I re-ran the above command, and it worked as expected.
$ gam csv ../gam-continuousdelta.com/notes-4-head.csv quotechar " " gam user ***@***.*** create note json "~JSON" copyacls
2022-03-10T03:46:57.891+00:00,0/1,Using 1 process...
Note: notes/1ijfsWK9MTQE_-6j-fP_dmuzo_sByN16N4FJPQdl6UBhIy0F90vgTwDx9t31duA
title:
createTime: 2022-03-10T03:46:58Z
updateTime: 2022-03-10T03:46:58Z
trashTime: Never
owner: ***@***.***
ownedByMe: True
permissions:
name: notes/1ijfsWK9MTQE_-6j-fP_dmuzo_sByN16N4FJPQdl6UBhIy0F90vgTwDx9t31duA/permissions/AfoJJ7ZHFg2WqB-REaP4RbU-ma6WieNFDjFPPkR5
role: OWNER
user: ***@***.***
text:
https://github.com/taers232c/GAMADV-XTD3/wiki/Users-Keep
Copy notes and permissions from one user to another.
gam redirect csv ./notes.csv user ***@***.*** print notes formatjson quotechar "'"
gam csv ./notes.csv quotechar "'" gam user ***@***.*** create note json "~JSON" copyacls
Google Keep
Backup Restore
Import Export
Migrate
Transfer
GAM
GAMADV-XTD3
—
Reply to this email directly, view it on GitHub <#251 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ACCTYL6SWEG3GLWOHAEVWJDU7FYLVANCNFSM5QJ5B5FQ>.
Triage notifications on the go with GitHub Mobile for iOS <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you commented.
|
Matt,
json.dumps is causing trouble
Ross
--
***@***.***
… On Mar 9, 2022, at 8:06 PM, Matt McClure ***@***.***> wrote:
I think something is still not quite right in versions 6.6.10 and 6.6.11 with respect to escaping characters in note text.
I have some Keep notes that contain single quotes and double quotes, so I tried using tab as the value of quotechar as follows.
$ gam redirect csv ./notes.csv user ***@***.*** print notes formatjson quotechar ' ' # I inserted a literal tab character in the real command using Control-V, tab. When I paste it into GitHub's comment editor, it pastes 7 spaces instead.
$ gam csv ../notes.csv quotechar " " gam user ***@***.*** create note json "~JSON" copyacls
2022-03-10T03:31:43.497+00:00,0/1,Using 1 process...
Command: gam user ***@***.*** create note json >>>"{"body": {"text": {"text": "https://github.com/taers232c/GAMADV-XTD3/wiki/Users-Keep\\n\\nCopy notes and permissions from one user to another.\\ngam redirect csv ./notes.csv user ***@***.*** print notes formatjson quotechar \\"'\\"\\ngam csv ./notes.csv quotechar \\"'\\" gam user ***@***.*** create note json \\"~JSON\\" copyacls\\n\\nGoogle Keep\\nBackup Restore\\nImport Export\\nMigrate\\nTransfer\\nGAM\\nGAMADV-XTD3"}}, "createTime": "2022-03-04T13:14:59Z", "name": "notes/1X6-eSgnbTmVlhqthCR_977N5QjU9jMxAEu-fusNAn4lQLulZOBg1wFA3_aHUC0ZUDTmH", "ownedByMe": true, "owner": ***@***.***", "permissions": [{"email": ***@***.***", "name": "notes/1X6-eSgnbTmVlhqthCR_977N5QjU9jMxAEu-fusNAn4lQLulZOBg1wFA3_aHUC0ZUDTmH/permissions/AfoJJ7Zibw0YeZH75trnRApOnHvsMfeqEZ-BwqzH", "role": "OWNER", "user": {"email": ***@***.***"}}], "trashTime": "Never", "updateTime": "2022-03-04T13:15:37Z"}"<<< copyacls
ERROR: Expecting ',' delimiter: line 1 column 233 (char 232): {"body": {"text": {"text": "https://github.com/taers232c/GAMADV-XTD3/wiki/Users-Keep\\n\\nCopy notes and permissions from one user to another.\\ngam redirect csv ./notes.csv user ***@***.*** print notes formatjson quotechar \\"'\\"\\ngam csv ./notes.csv quotechar \\"'\\" gam user ***@***.*** create note json \\"~JSON\\" copyacls\\n\\nGoogle Keep\\nBackup Restore\\nImport Export\\nMigrate\\nTransfer\\nGAM\\nGAMADV-XTD3"}}, "createTime": "2022-03-04T13:14:59Z", "name": "notes/1X6-eSgnbTmVlhqthCR_977N5QjU9jMxAEu-fusNAn4lQLulZOBg1wFA3_aHUC0ZUDTmH", "ownedByMe": true, "owner": ***@***.***", "permissions": [{"email": ***@***.***", "name": "notes/1X6-eSgnbTmVlhqthCR_977N5QjU9jMxAEu-fusNAn4lQLulZOBg1wFA3_aHUC0ZUDTmH/permissions/AfoJJ7Zibw0YeZH75trnRApOnHvsMfeqEZ-BwqzH", "role": "OWNER", "user": {"email": ***@***.***"}}], "trashTime": "Never", "updateTime": "2022-03-04T13:15:37Z"}
Help: Syntax in file /Users/matthewlmcclure/code/gamadv-xtd3/gamadv-xtd3/GamCommands.txt
Help: Documentation is at https://github.com/taers232c/GAMADV-XTD3/wiki
Notice above that the JSON contains sequences like \\n and \\". I believe those should be \n and \" respectively.
I edited notes.csv accordingly. I replaced \\n with \n and I replace \\" with \" throughout the JSON body. Then I re-ran the above command, and it worked as expected.
$ gam csv ../gam-continuousdelta.com/notes-4-head.csv quotechar " " gam user ***@***.*** create note json "~JSON" copyacls
2022-03-10T03:46:57.891+00:00,0/1,Using 1 process...
Note: notes/1ijfsWK9MTQE_-6j-fP_dmuzo_sByN16N4FJPQdl6UBhIy0F90vgTwDx9t31duA
title:
createTime: 2022-03-10T03:46:58Z
updateTime: 2022-03-10T03:46:58Z
trashTime: Never
owner: ***@***.***
ownedByMe: True
permissions:
name: notes/1ijfsWK9MTQE_-6j-fP_dmuzo_sByN16N4FJPQdl6UBhIy0F90vgTwDx9t31duA/permissions/AfoJJ7ZHFg2WqB-REaP4RbU-ma6WieNFDjFPPkR5
role: OWNER
user: ***@***.***
text:
https://github.com/taers232c/GAMADV-XTD3/wiki/Users-Keep
Copy notes and permissions from one user to another.
gam redirect csv ./notes.csv user ***@***.*** print notes formatjson quotechar "'"
gam csv ./notes.csv quotechar "'" gam user ***@***.*** create note json "~JSON" copyacls
Google Keep
Backup Restore
Import Export
Migrate
Transfer
GAM
GAMADV-XTD3
—
Reply to this email directly, view it on GitHub <#251 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ACCTYL6SWEG3GLWOHAEVWJDU7FYLVANCNFSM5QJ5B5FQ>.
Triage notifications on the go with GitHub Mobile for iOS <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you commented.
|
A one-character string consisting of Here's a more minimalist test case: https://gist.github.com/matthewlmcclure/ffbd7deae00215c954bee77bf3e71788 |
test.py
|
Matt, A fix for Python 3.10.0 breaks things in 3.10.2 Try 6.16.12 You can say quotechar "\t" to set the quote character to tab |
I don't see a 6.6.12 release at https://github.com/taers232c/GAMADV-XTD3/releases |
6.16.13 available
--
***@***.***
… On Mar 10, 2022, at 10:40 AM, Matt McClure ***@***.***> wrote:
I don't see a 6.6.12 release at https://github.com/taers232c/GAMADV-XTD3/releases <https://github.com/taers232c/GAMADV-XTD3/releases>
—
Reply to this email directly, view it on GitHub <#251 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ACCTYL2Q4OMIQNMJRKN76Q3U7I625ANCNFSM5QJ5B5FQ>.
Triage notifications on the go with GitHub Mobile for iOS <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you commented.
|
6.6.13 seems to have addressed this issue. Thanks! |
I tossed it, the fix to the fix was broken, it'll be back shortly
--
***@***.***
… On Mar 10, 2022, at 10:40 AM, Matt McClure ***@***.***> wrote:
I don't see a 6.6.12 release at https://github.com/taers232c/GAMADV-XTD3/releases <https://github.com/taers232c/GAMADV-XTD3/releases>
—
Reply to this email directly, view it on GitHub <#251 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ACCTYL2Q4OMIQNMJRKN76Q3U7I625ANCNFSM5QJ5B5FQ>.
Triage notifications on the go with GitHub Mobile for iOS <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you commented.
|
The commands documented at https://github.com/taers232c/GAMADV-XTD3/wiki/Users-Keep#copy-notes-and-permissions-from-one-user-to-another result in notes with "\n" escape sequences instead of new lines in Keep.
The text was updated successfully, but these errors were encountered: