GithubHelp home page GithubHelp logo

lupin's People

Contributors

akhater avatar digitalknk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lupin's Issues

Obsidian usecase?

Can this be modified to be used for an Obsidian vault stored in a git repo?

Deployment error with Heroku

Hi, I was able to successfully test Lupin locally using Docker container but when deployed to Heroku, it came up with the following error:

2021-04-04T18:18:53.519062+00:00 heroku[web.1]: Starting process with command `python -u main.py`
2021-04-04T18:18:56.907306+00:00 app[web.1]: Traceback (most recent call last):
2021-04-04T18:18:56.907339+00:00 app[web.1]:   File "/app/main.py", line 7, in <module>
2021-04-04T18:18:56.907446+00:00 app[web.1]:     import flashcards
2021-04-04T18:18:56.907447+00:00 app[web.1]:   File "/app/flashcards.py", line 10, in <module>
2021-04-04T18:18:56.907551+00:00 app[web.1]:     from config import getflashcardsTag
2021-04-04T18:18:56.907552+00:00 app[web.1]:   File "/app/config.py", line 14, in <module>
2021-04-04T18:18:56.907650+00:00 app[web.1]:     BotToken = config.get('Bot','BotToken')
2021-04-04T18:18:56.907651+00:00 app[web.1]:   File "/usr/local/lib/python3.9/configparser.py", line 781, in get
2021-04-04T18:18:56.907975+00:00 app[web.1]:     d = self._unify_values(section, vars)
2021-04-04T18:18:56.907975+00:00 app[web.1]:   File "/usr/local/lib/python3.9/configparser.py", line 1149, in _unify_values
2021-04-04T18:18:56.908355+00:00 app[web.1]:     raise NoSectionError(section) from None

I'm assuming this is not a lupin related error but wondering if anyone had success deploying to Heroku.

I used the heroku.yml to deploy the Dockerfile.

Mindmap terminal error

Hey there,

I'm excited to test the mind map functionality, I have an error in the terminal that I can't seem to solve.

What I've done

I have a file called mindmap1

which looks like this
image

After making sure Lupin is running correctly, I do the following in Telegram

/getMM mindmap1

However the message is stuck in there, without returning the .html file

image

Then I checked that there's an error in the terminal

TypeError: can only concatenate str (not "NoneType") to str

The whole terminal message

No error handlers are registered, logging exception.
Traceback (most recent call last):
  File "/home/santi/.local/lib/python3.9/site-packages/telegram/ext/dispatcher.py", line 442, in process_update
    handler.handle_update(update, self, check, context)
  File "/home/santi/.local/lib/python3.9/site-packages/telegram/ext/handler.py", line 160, in handle_update
    return self.callback(update, context)

  File "/home/santi/Lupin/main.py", line 118, in generateMinmapHTML
    HTMLOut = """
TypeError: can only concatenate str (not "NoneType") to str

Specs

Linux Manjaro
Lupin v3.3.0e
Logseq version 0.0.9
For Lupin I'm using a Github repo in Firefox

Thanks a lot!

Lupin sometimes work, sometimes doesn't work, sometimes takes a few hours to work

Hi akhater

So I was finally able to setup Lupin using Docker and though it's connected and generally works it takes a really long time for a message posted on Lupin to show up in Logseq. It often takes more than 20 minutes and sometimes hours. This is a random guess but I think it may have something to do with this error I keep seeing. Can you help?

`'utf-8' codec can't decode byte 0x89 in position 0: invalid start byte

'utf-8' codec can't decode byte 0x89 in position 0: invalid start byte

'utf-8' codec can't decode byte 0x89 in position 0: invalid start byte

403 {"message": "This API returns blobs up to 1 MB in size. The requested blob is too large to fetch via the API, but you can use the Git Data API to request blobs up to 100 MB in size.", "errors": [{"resource": "Blob", "field": "data", "code": "too_large"}], "documentation_url": "https://docs.github.com/rest/reference/repos#get-repository-content"}

403 {"message": "This API returns blobs up to 1 MB in size. The requested blob is too large to fetch via the API, but you can use the Git Data API to request blobs up to 100 MB in size.", "errors": [{"resource": "Blob", "field": "data", "code": "too_large"}], "documentation_url": "https://docs.github.com/rest/reference/repos#get-repository-content"}

403 {"message": "This API returns blobs up to 1 MB in size. The requested blob is too large to fetch via the API, but you can use the Git Data API to request blobs up to 100 MB in size.", "errors": [{"resource": "Blob", "field": "data", "code": "too_large"}], "documentation_url": "https://docs.github.com/rest/reference/repos#get-repository-content"}

403 {"message": "This API returns blobs up to 1 MB in size. The requested blob is too large to fetch via the API, but you can use the Git Data API to request blobs up to 100 MB in size.", "errors": [{"resource": "Blob", "field": "data", "code": "too_large"}], "documentation_url": "https://docs.github.com/rest/reference/repos#get-repository-content"}

403 {"message": "This API returns blobs up to 1 MB in size. The requested blob is too large to fetch via the API, but you can use the Git Data API to request blobs up to 100 MB in size.", "errors": [{"resource": "Blob", "field": "data", "code": "too_large"}], "documentation_url": "https://docs.github.com/rest/reference/repos#get-repository-content"}

403 {"message": "This API returns blobs up to 1 MB in size. The requested blob is too large to fetch via the API, but you can use the Git Data API to request blobs up to 100 MB in size.", "errors": [{"resource": "Blob", "field": "data", "code": "too_large"}], "documentation_url": "https://docs.github.com/rest/reference/repos#get-repository-content"}

403 {"message": "This API returns blobs up to 1 MB in size. The requested blob is too large to fetch via the API, but you can use the Git Data API to request blobs up to 100 MB in size.", "errors": [{"resource": "Blob", "field": "data", "code": "too_large"}], "documentation_url": "https://docs.github.com/rest/reference/repos#get-repository-content"}

403 {"message": "This API returns blobs up to 1 MB in size. The requested blob is too large to fetch via the API, but you can use the Git Data API to request blobs up to 100 MB in size.", "errors": [{"resource": "Blob", "field": "data", "code": "too_large"}], "documentation_url": "https://docs.github.com/rest/reference/repos#get-repository-content"}

`

Encryption exception of image upload

Hi. I have tested encryption mode for some time.
Normal text works fine only for the first time, but when later I uploaded an image or typed in a simple word, there pops up the following errors:

Ignoring unknown recipient type 'BLts-grease'
No error handlers are registered, logging exception.
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/telegram/ext/dispatcher.py", line 432, in process_update
    handler.handle_update(update, self, check, context)
  File "/usr/local/lib/python3.6/site-packages/telegram/ext/handler.py", line 156, in handle_update
    return self.callback(update, context)
  File "main.py", line 87, in image_handler
    updateJournal(path, ignoreURL=True)
  File "/home/christlurker/softwares/Lupin_bot_encrypt/git.py", line 54, in updateJournal
    data =  (AgeEncHandler.ageDecrypt(data))
  File "/home/christlurker/softwares/Lupin_bot_encrypt/AgeEncHandler.py", line 33, in ageDecrypt
    decrypt(infile=io.BytesIO(content),ascii_armored=True)
  File "/home/christlurker/.local/lib/python3.6/site-packages/age/cli.py", line 141, in decrypt
    with Decryptor(keys, infile) as decryptor:
  File "/home/christlurker/.local/lib/python3.6/site-packages/age/file.py", line 77, in __init__
    self._decrypt_header(identities)
  File "/home/christlurker/.local/lib/python3.6/site-packages/age/file.py", line 108, in _decrypt_header
    HMAC(self._hkdf(HEADER_HKDF_LABEL)).verify(header_stream.getvalue(), mac)
  File "/home/christlurker/.local/lib/python3.6/site-packages/age/primitives/hmac.py", line 48, in verify
    self.mac.verify(tag)
  File "/home/christlurker/.local/lib/python3.6/site-packages/cryptography/hazmat/primitives/hmac.py", line 74, in verify
    ctx.verify(signature)
  File "/home/christlurker/.local/lib/python3.6/site-packages/cryptography/hazmat/backends/openssl/hmac.py", line 75, in verify
    raise InvalidSignature("Signature did not match digest.")
cryptography.exceptions.InvalidSignature: Signature did not match digest.

Afterward, no matter what I type in, there always have such errors, including /anno, etc.

github.GithubException.UnknownObjectException

I'm trying to install Lupin for the first time and get the following error:

Traceback (most recent call last):
  File "main.py", line 15, in <module>
    from git import updateJournal, updateAsset, Git2Json, updateCalendarsFile, encryptGraph, decryptGraph, getAllThemes, switchTheme #, updateFlashCards
  File "/root/Lupin/git.py", line 20, in <module>
    repo = g.get_repo(GitHubFullRepo)
  File "/usr/local/lib/python3.6/site-packages/github/MainClass.py", line 346, in get_repo
    "GET", f"{url_base}{full_name_or_id}"
  File "/usr/local/lib/python3.6/site-packages/github/Requester.py", line 317, in requestJsonAndCheck
    verb, url, parameters, headers, input, self.__customConnection(url)
  File "/usr/local/lib/python3.6/site-packages/github/Requester.py", line 340, in __check
    raise self.__createException(status, responseHeaders, output)
github.GithubException.UnknownObjectException: 404 {"message": "Not Found", "documentation_url": "https://docs.github.com/rest/reference/repos#get-a-repository"}

Turning off Timestamps

I was wondering if it's possible to quickly turn off the timestamps in config.ini

In this section

[Misc]
hour24 = true

If I undesrtand correctly I can set it to false to create a 12 hour format, and of course "true" keeps it in a 24 hour format

I'd like to turn it off

I've tried the following things

  • commenting it out
  • deleting that line
    both of these return an error

I've also tried

hour24 = None
hour24 = none
hour24 = null
hour24 = 

but I can't seem to get it to hide the time-stamps

This might be a quick solution, but unfortunatly I couldn't figure it out

Thanks!

Potential risk of data loss by encryption

I tried to encrypt all and it failed in the middle, part of the notes were encrypted and part were not.

Then I encryptall again and this time it works, telling me "All your graph contents are now encrypted & I've set AgeEncrypted to true in your config.ini". But I found the contents page has become:
image

Mar 1, 2021 and Feb 28, 2021 also same issue:
image

So far haven't found other files corrupted like this.

Some websites cannot be imported.

I don't have enough samples but I met the following error when type /anno https://moritz.digital/blog/cas.

404
No error handlers are registered logging exception.
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/telegram/ext/dispatcher.py", line 432, in process_update
    handler.handle_update(update, self, check, context)
  File "/usr/local/lib/python3.6/site-packages/telegram/ext/handler.py", line 156, in handle_update
    return self.callback(update, context)
  File "main.py", line 58, in hypothesis
    updateJournal(getHypothesisAnnotations(context.args[0]), False, path, True, pageAlias)
  File "/home/xxx/softwares/Lupin.LogSeqPyBot/git.py", line 53, in updateJournal
    data =  "---\ntitle: " + getPageTitle(path) + "\nalias: " + alias + "\n---\n\n" + (entry).strip() + "\n"
TypeError: must be str, not Exception

Problem with a link

Tried to send this link to Lupin - https://editorial.rottentomatoes.com/article/new-on-netflix-in-march-2021/ and Lupin errored.

No error handlers are registered, logging exception.
Traceback (most recent call last):
File "/home/ec2-user/.local/lib/python3.7/site-packages/telegram/ext/dispatcher.py", line 442, in process_update
handler.handle_update(update, self, check, context)
File "/home/ec2-user/.local/lib/python3.7/site-packages/telegram/ext/handler.py", line 160, in handle_update
return self.callback(update, context)
File "main.py", line 37, in addEntry
updateJournal(update.message.text)
File "/home/ec2-user/Lupin/git.py", line 40, in updateJournal
entry = buildJournalEntry(entry, ignoreURL)
File "/home/ec2-user/Lupin/git.py", line 96, in buildJournalEntry
journalEntry = journalEntry.replace(journalEntryURL, '#' + config.BookmarkTag + ' [' + title + '](' + journalEntryURL + ')')
TypeError: can only concatenate str (not "Exception") to str

Syntax error

I'm trying to install Lupin for the first time and get the following error:

  File "main.py", line 106
    buf.name = f'{PageName}.md'
                              ^
SyntaxError: invalid syntax

I'm prepared for the fact that this may be me missing something terribly obvious, but I can't see what it is.

Hypothe.is tags

Thanks for the new update for the hypothesis import!
Just one tiny issue of the tags with multiple words separated by space. Could you transfer the tags into the form of [[]] or #[[]] instead of #?

Calendar color update

Hi.
Firstly really love this tool and it is now my daily tool!

I am wondering how does Lupin scan the daily notes and update the state in a repeated way?

E.g. the date of generating the calendar was 19th and today is already 23th but the bold date is still 19.

image

Also wish you could scan the files and if it is empty, also label that daily note as "void", the same as the dates with no files.

Calendar view option

We could provide more options to display the calendar.

For me, I would like to display only the current month view, so we could have an option of displaying "current month", "3 consecutive months", etc. (In the future can even have "week view")

PS: I am sometimes annoyed by clicking on the blank space between dates entering the "edit mode". I know with pure html this cannot be resolved ๐Ÿ˜…

task with LATER Command

Hey!

Thanks a lot for the excellent tool

in config.ini

there's the following command

TODOCommand = TODO

I have this set to
TODOCommand = T which works great

However I use the Command LATER for creating tasks in Logseq

image

Is is possible to have a quick command for later

LATERCommand = LATER

so that I can set it like this

LATERCommand = L

I tried it like that, but doesn't seem to work, I'm sure there's more involved in the code to allow for this to be able to be set. As a non-programmer I looked into the code, but I'm not sure if it's simple or if there's more involved that I'm not aware of.

if so I'd truly appreciate this feature

Thanks a lot!

Send image to journal

I think it is also possible to send image to either asset/ folder under your note or github CDN of URL, via "bot.send_photo" command. Look forward to that function!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.