question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Version 2 wishlist

See original GitHub issue

I’ve been brewing ideas for v2 for a while now (probably over a year), and I started implementing some of these ideas in a separate branch (completely rewriting the code). Inevitably, the master branch kept getting worked on, and it eventually fell apart.

So now I’m trying to reboot some of my ideas, but I’ll take a separate approach to implementing them: I’ll implement almost everything that can be done without making breaking changes, and then I’ll move the project into a state of v2, where we can properly progress towards a cleaner API. In general, I’d much rather have a stable, minimal API, than an unstable, comprehensive API!

I’ve tried to assemble a list of major things I’d like to see before making breaking changes:

  • Use flit as our build system (see #382)
  • Use black for formatting (see #386)
  • Refactor code into logical, separate files (client.py is far too large)
    • Would help us to make proper unit tests
  • ~Set up integration tests using something like VCR.py~
  • Clean up documentation
    • Fix setup (tracked in #391)
    • Make @carpedm20 set up the webhook, so that tag creation / deletion is tracked as well
    • API rundown (Use Google Docstring Style)
    • Introduction overview overhaul
    • Investigate tools for detecting docstring errors and spelling mistakes
  • Inline examples
  • More detailed examples (recommends good practice too)
  • API coherence (fetchThreadMessages can’t fetch “system” messages / events)

And a list of major things I’d like to change:

  • Drop Python 2 support (It’ll probably reach it’s EOL before we get everything done 😁)
  • Use type hints
  • Consider async options
  • Declare a proper public API. See trio as a reference to a project that fullfulls this promise (e.g. using _ before methods and filenames)
  • Declare a concise API (e.g. document expected exceptions)
    • Using datetimes, see #278, is a subtask of this
  • Use snake_cased method names like PEP8 suggests
  • Fix logging (see #258)
  • Make a distinction between models, like Message, and what you can send, as parameters in send. Though combining these sound good idea in theory, it’s really messy in practice, and not really that useful.
  • Make a distinction between user created models and recieved models
    • Building upon this idea, we can move a lot of implementations into the model instead of a central client. For example, I’d like to be able to do something like:
      message = Message(id="123", client=client)  # Does not make an external call (since you don't need to, to interact with the message)
      message.react(None)
      assert not hasattr(message, "text")
      # Or alternatively:
      message = client.get_message("123")  # Makes an external call, and returns `MessageData`, a subclass of `Message`
      message.react("👍")
      assert hasattr(message, "text")
      

But anyway, it’s late, and I’m rambling, and a lot of the later bullet points are still pretty abstract ideas. We should focus on the most pressing points first 😁.

If you have something you’d like to put on the wishlist, or would like to point the project in a different direction, suggest away, I’d love to hear what you have to say! 😊

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:14 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
joakimedcommented, Feb 26, 2019

@kapi2289 Ofcourse, so simple.

@szymonszl Thanks for the valuable pointers. I’m going to play around some more with this, focusing on making it safer. Hopefully with a single login request. As for session cookies, I intentionally avoided them in this script as they are not used in the other examples.

This is getting way off topic. It was never my intention to hijack this issue, so if i run into more problems I’ll open a new issue.

1reaction
szymonszlcommented, Feb 25, 2019

Wouldn’t it be simpler (and considering @madsmtm 's comment, propably also safer) to use an external event loop instead of playing with threading? IIRC the listen function is rather simple and should be not that hard to remake in a different eventloop. It should be possible to make your own while True which both calls doOneListen and whatever else you want, like checking for user input. When I’m able to I’ll try to check if it’s possible by integrating fbchat into, maybe tkinter? Let’s see.

Now that I think of it, it also might be possible to add some kind of onOneListen handler function to instead be able to use fbchat’s loop as the program’s main event loop.

PS. always store/use session cookies if you can, lots of consecutive logins can easily make your account flagged

Read more comments on GitHub >

github_iconTop Results From Across the Web

Version 2 Wishlist - #567 - @rappasoft - GitHub
So it's time to start thinking about version 2, which will be a ground up rebuild to try to address all of the...
Read more >
PERSONA WISHLIST in 2022 - Pinterest
PERSONA WISHLIST. Wishlist del album de Persona version 2.
Read more >
My Minecraft 1.20 Wishlist - YouTube
The Minecraft 1.20 Update may soon be announced at Minecraft Live 2022 on October 15th. Today we review the past mob and biome...
Read more >
How Can I Add Game Versions To Wishlist? :: Help and Tips
How Can I Add Game Versions To Wishlist? I am a big fan of the game Killing Floor and have bought it's sequel...
Read more >
Feature Wishlist – Minecraft: Education Edition Support
Your feedback is shared with our product development team each release cycle and we look forward to sharing which of your features made...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found