Git Product home page Git Product logo

Comments (6)

felixp7 avatar felixp7 commented on June 22, 2024

Hi there! Thanks for the suggestion, but one of my goals is to avoid major dependencies outside of the Python standard library. A single-file module I could ship with Gophersnake might work. A major library with native components, not so much.

As for searches, a query string is just plain text. You send the server a selector as usual, followed by a tab character, then your search. You can see it at work in load_as_directory. It should be explained in the RFC, but for some reason I don't have a copy. Hope this helps!

from gophersnake.

sloumdrone avatar sloumdrone commented on June 22, 2024

Hello :) Thanks for getting back to me. I was trying to avoid that too. Sadly it just didnt seem possible in python to offer image display without PIL. I generally also try to avoid dependencies in that way. You could still distribute by freezing if need be...but that is a whole other pain.

I'm not certain, as I have not tried, but you may be able to get it to work without PIL for GIF images specifically by using the io module (a built in) like so:

from io import BytesIO

stream = BytesIO(bytes_string_from_request_response)
gif_image = tk.PhotoImage(stream)

# then put gif_image where you need it:
# text_widget.image_create(tk.END, image = gif_image)

Since tk has native support for GIFs, passing the file-like object ('stream' above) seems like it should work.

Just as an FYI: on Ubuntu specifically, but possibly also on other debian distros, you already have a dependency in that Ubuntu does not come with Tk support and you have to get it through apt:
sudo apt-get install python3-tk

I did see you doing that in your code, but it confused me. I had seen the RFC...I guess it just felt weird to send something like:

host = 'blahblah.org'
port = 70
resource = '/search-server/\tkittens'

Am I thinking about that wrong?

from gophersnake.

felixp7 avatar felixp7 commented on June 22, 2024

Thanks for the alternate solution, I'll be sure to try it whenever Gophersnake returns to active development. And it's not the same thing: Tkinter is preinstalled on the Mac, included with Python for Windows and there by default on plenty of Linux distributions. It's by and large considered a standard part of Python. Also, it can't be avoided if Gophersnake is to exist at all. Not all dependencies are equal!

Last but not least, dunno if it's weird or not, but that's really how Gopher does it. Seems to work, too.

from gophersnake.

sloumdrone avatar sloumdrone commented on June 22, 2024

Definitely agree that it isnt the same thing, just thought I'd mention in case you ever decided to build a .deb or the like.

Cool. Hopefully that approach to inline GIFs works. If you'd like (I get this isn't a particularly active project, so it may not matter), I could try it out and submit a PR. Let me know.

Cool! Thank you for the info, I'll try that on my client :)

from gophersnake.

felixp7 avatar felixp7 commented on June 22, 2024

A pull request would be much appreciated. Thank you!

from gophersnake.

felixp7 avatar felixp7 commented on June 22, 2024

Mostly resolved through this pull request.

from gophersnake.

Related Issues (3)

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.