Code Monkey home page Code Monkey logo

termsaver's People

Contributors

akbkuku avatar ariccio avatar brunobraga avatar eddiedover avatar ggf avatar wkentaro 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

termsaver's Issues

Unable to install with apt.

When installing on a raspberry pi running Raspberry Pi OS Lite (64 bit) [Debian Bullseye] the following occurs.

pi@raspberrypi:~ $ sudo apt-get install termsaver
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package termsaver
pi@raspberrypi:~ $

Broken installing with pip

Hello, today I tried to install your app to Ubuntu Server 20.04, I have last version of pip installed here, how you're saying in README.md, i ran sudo pip install termsaver . And got that output:

Collecting termsaver
  Using cached termsaver-0.4.tar.gz (46 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [7 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-zk6wuiq_/termsaver_62fe2076d8a1406e9920047884ff730c/setup.py", line 101
          print """
          ^^^^^^^^^
      SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

I'm not Python developer, (more i know in golang), but how i can undersatnd, it have Syntax Error. And pip i ssaying, that note: This is an issue with the package mentioned above, not pip..
So, if you can, please, explain to me, that i did wrong, or fix that error.
Thank you for putting your time in this post.

Python 3 support

System: macOS 10.15

Command: pip3 install termsaver

Expected result: cool screensavers

Actual result:

Installer falls over while trying thank me

Downloading https://files.pythonhosted.org/packages/9a/b0/4428c151d94b5358dd92b92c045cd40b448ff65a37b994ecb7252ad559f8/termsaver-0.4.tar.gz (46kB)
     |████████████████████████████████| 51kB 1.1MB/s
    ERROR: Complete output from command python setup.py egg_info:
    ERROR: Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/c7/vx918ndx0v3g_j49c1tf4_8w0000gn/T/pip-install-x0k8wubc/termsaver/setup.py", line 103
        """
          ^
    SyntaxError: Missing parentheses in call to 'print'. Did you mean print("""
    Thank you for trying termsaver.
    """)?
    ----------------------------------------
ERROR: Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/c7/vx918ndx0v3g_j49c1tf4_8w0000gn/T/pip-install-x0k8wubc/termsaver/

Implement figlet based screensaver

The figlet application is a complete ascii text formatter with a huge diversity in fonts and sizes, a perfect match to termsaver.

Currently available there are the figlet and pyfiglet, which is the python implementation of the original application.

Still considering which way to go:

  • use figlet as it is and force users to install it
  • use pyfiget by installing (then I think I would prefer the above option)
  • use pyfiglet embedded to termsaver code so for the end-user is just transparent functionality

References

Unable to install from source

Hi!
When I try to install using sudo python /home/dexter/termsaver/setup.py install, it says the following:
Traceback (most recent call last):
File "/home/dexter/termsaver/setup.py", line 56, in
'termsaver.mo')]) for lang in os.listdir('locale')]
FileNotFoundError: [Errno 2] No such file or directory: 'locale'

I'm on Fedora 36.

asciiartfarts is offline

termsaver.asciiartfarts: Connecting to http://www.asciiartfarts.com/random.cgi ... (this could take a while)
Traceback (most recent call last):
File "/usr/lib/python3.10/urllib/request.py", line 1348, in do_open
h.request(req.get_method(), req.selector, req.data, headers,
File "/usr/lib/python3.10/http/client.py", line 1282, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/usr/lib/python3.10/http/client.py", line 1328, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/usr/lib/python3.10/http/client.py", line 1277, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/usr/lib/python3.10/http/client.py", line 1037, in _send_output
self.send(msg)
File "/usr/lib/python3.10/http/client.py", line 975, in send
self.connect()
File "/usr/lib/python3.10/http/client.py", line 941, in connect
self.sock = self._create_connection(
File "/usr/lib/python3.10/socket.py", line 824, in create_connection
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
File "/usr/lib/python3.10/socket.py", line 955, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -3] Temporary failure in name resolution

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/termsaver/termsaverlib/screen/helper/urlfetcher.py", line 172, in fetch
resp = urlopen(req)
File "/usr/lib/python3.10/urllib/request.py", line 216, in urlopen
return opener.open(url, data, timeout)
File "/usr/lib/python3.10/urllib/request.py", line 519, in open
response = self._open(req, data)
File "/usr/lib/python3.10/urllib/request.py", line 536, in _open
result = self._call_chain(self.handle_open, protocol, protocol +
File "/usr/lib/python3.10/urllib/request.py", line 496, in _call_chain
result = func(*args)
File "/usr/lib/python3.10/urllib/request.py", line 1377, in http_open
return self.do_open(http.client.HTTPConnection, req)
File "/usr/lib/python3.10/urllib/request.py", line 1351, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [Errno -3] Temporary failure in name resolution>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/bin/termsaver", line 8, in
sys.exit(entryPoint())
File "/usr/local/lib/python3.10/dist-packages/termsaver/init.py", line 129, in entryPoint
screen(parser=parser)._parse_args()
File "/usr/local/lib/python3.10/dist-packages/termsaver/termsaverlib/screen/asciiartfarts.py", line 110, in _parse_args
self.autorun()
File "/usr/local/lib/python3.10/dist-packages/termsaver/termsaverlib/screen/base/init.py", line 239, in autorun
self._run_cycle()
File "/usr/local/lib/python3.10/dist-packages/termsaver/termsaverlib/screen/asciiartfarts.py", line 99, in _run_cycle
new_text = self.process_data(self.fetch(self.url)).decode("utf-8")
File "/usr/local/lib/python3.10/dist-packages/termsaver/termsaverlib/screen/helper/urlfetcher.py", line 177, in fetch
raise exception.UrlException(uri,
termsaver.termsaverlib.exception.UrlException: Could not fetch URL, because [Errno -3] Temporary failure in name resolution

Colorize the clock

Hi team,
Regarding to the clock, could you please make it be colored?
That's great if the clock is able to be colorized/glowed.

Fix python version dependency

Although set as "all" in debian packaging, I received a message about problems when running the debian package in older Ubuntu versions (Ubuntu 10 uses python 2.6). Since there are no fancy stuff done in the code, it should be, for maximum reach of users, accepted under python 2.4.

Create debian package

To be able to release on apt-get stream, we need to provide a deb package and submit it to debian.

Sysmon Crash - Mac OS X 10.9.4

I ran the sysmon (both sudo and reg. level), and I got this error message from the verbose output:

Exception: (IOError)
Traceback (most recent call last):
File "/usr/local/bin/termsaver", line 161, in
parse_args(sys.argv[1:])
File "/usr/local/bin/termsaver", line 143, in parse_args
screen().autorun(args[1:])
File "/usr/local/Cellar/python/2.7.7_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/termsaverlib/screen/base/init.py", line 238, in autorun
self._run_cycle()
File "/usr/local/Cellar/python/2.7.7_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/termsaverlib/screen/sysmon.py", line 168, in _run_cycle
self.update_stats()
File "/usr/local/Cellar/python/2.7.7_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/termsaverlib/screen/sysmon.py", line 249, in update_stats
for line in open('/proc/meminfo'):
IOError: [Errno 2] No such file or directory: '/proc/meminfo'

TermSaver's Sysmon Throws Cannot Divide by Zero Errors

Greetings,

Not sure what is causing this. I'm running Raspbian on a Raspberry Pi 3, if it makes any difference. Running Python 2.7.9.

Oops! Something went terribly wrong.
Error details: float division by zero
 
===================================
Exception: (ZeroDivisionError) float division by zero
Traceback (most recent call last):
  File "/usr/bin/termsaver", line 161, in <module>
    parse_args(sys.argv[1:])
  File "/usr/bin/termsaver", line 143, in parse_args
    screen().autorun(args[1:])
  File "/usr/share/termsaver/termsaverlib/screen/base/__init__.py", line 238, in autorun
    self._run_cycle()
  File "/usr/share/termsaver/termsaverlib/screen/sysmon.py", line 168, in _run_cycle
    self.update_stats()
  File "/usr/share/termsaver/termsaverlib/screen/sysmon.py", line 274, in update_stats
    cpu = 100 - (dt[len(dt) - 1] * 100.00 / sum(dt))
ZeroDivisionError: float division by zero
 
===================================
 
 
You are more than welcome to report this at:
        http://github.com/brunobraga/termsaver

If you have any questions or there's anything I can do to help you test further, please let me know.

Cheers,
Zzyzx

Asciiartfarts screen with broken first/last lines

Running is, you will see bad ascii image formatting on first and last lines:

Eg:

       /^\                                             
           /   \                                            
   _______/_/_\ \_______                                    
   \  ____ ____\ \___  /                                    
    \ \ / /     \ \ / /                                     
     \ / /       \ / /                                      
      / /         / /      WHAT'S WRONG WITH THIS WEIRD STAR
     / / \       / / \      WHY DOES IT LOOK SO WEIRD       
    / /_\ \_____/_/_\ \                                     
   /_____\ \___________\                                    
          \ \ / /                                           
    jgs    \ ` /                                            
                                  \_/

Cant install termsaver, issue with setup.py

Hello, I am having trouble installing termsaver. Currently on macos, getting this error:

$ pip install termsaver 
Collecting termsaver
  Downloading termsaver-0.4.tar.gz (46 kB)
     |████████████████████████████████| 46 kB 3.1 MB/s 
    ERROR: Command errored out with exit status 1:
     command: /Users/kylepollina/d3/app/smart-search/env/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/qr/b30k7lmx2fsf4cdzr371yn_w0000gp/T/pip-install-3l5etrka/termsaver/setup.py'"'"'; __file__='"'"'/private/var/folders/qr/b30k7lmx2fsf4cdzr371yn_w0000gp/T/pip-install-3l5etrka/termsaver/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/qr/b30k7lmx2fsf4cdzr371yn_w0000gp/T/pip-pip-egg-info-m3ppf9mu
         cwd: /private/var/folders/qr/b30k7lmx2fsf4cdzr371yn_w0000gp/T/pip-install-3l5etrka/termsaver/
    Complete output (6 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/qr/b30k7lmx2fsf4cdzr371yn_w0000gp/T/pip-install-3l5etrka/termsaver/setup.py", line 101
        print """
              ^
    SyntaxError: Missing parentheses in call to 'print'. Did you mean print(""")?
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

I think something is wrong with the current setup file on pypi?

Can't install on Ubuntu Server 21.04 on raspberry pi 4

I am trying to install termsaver on my raspberry pi 4 running ubuntu server 21.04.

I tried sudo apt update and sudo apt install termsaver, but it says no such package.

I tried to add ppa:bruno-braga/termsaver but it doesn't work.

I also tried to pip install but theres an error.

Is there a way to do it?

How to install a simple plugin?

What is the simplest way to add a screen saver to my local termsaver?

I've seen the figlet plugin and it is a little bulky. I wrote a screen but I'm having difficulty getting termsaver to pick it up. Here is my plugin.

import time
import sys

from termsaverlib.screen.base import ScreenBase
from termsaverlib.screen.helper.typing import TypingHelperBase
from termsaverlib.screen.helper.position import PositionHelperBase
from termsaverlib import common, exception, constants
from termsaverlib.i18n import _


class LocalQuotesScreen(ScreenBase, TypingHelperBase, PositionHelperBase):

    sleep_between_items = 0
    char_delay = 0.15
    line_delay = 1.5
    data = None

    def __init__(self):
        ScreenBase.__init__(self, "quotes", "display quotes from local file", {
            'opts': ':p:',
            'long_opts': ['path='],
        })

    def _usage_options_example(self):
        print _(""" """)

    def _parse_args(self, prepared_args):
        for option, arg in prepared_args[0]:
            if option in ("-p", "--path"):
                self._read_file_into_data(arg)

    def _read_file_into_data(self, path):
        with open(path, 'r') as content_file:
            self.data = content_file.read().split("\n\n")

    def _run_cycle(self):
        self.clear_screen()

        for item in self.data:
            self.get_terminal_size()
            item = self.center_text_vertically(item)
            item = self.center_text_horizontally(item)

            ##
            lines = item.split('\n')
            for index, line in enumerate(lines):
                for char in line:
                    sys.stdout.write(char)
                    if char != ' ':
                        time.sleep(self.char_delay)
                    sys.stdout.flush()
                sys.stdout.write('\n')
                if not line.isspace():
                    time.sleep(self.line_delay)
            ##

            time.sleep(self.sleep_between_items)

            self.clear_screen()

Add a "quit on any input" option

Another great addition would be the ability to quit termsaver with any input, like cmatrix -s, instead of necessarily having to SIGINT out of it.

urllib without close causes connection reset by peer on Mac

By running:

$ termsaver quotes4all -v

When it comes time for the loop to reconnect to the internet, it throws the following error:


termsaver.quotes4all: Connecting to http://quotes4all.net/rss/360010110/quotes.xml ... (this could take a while)
Oops! Error while trying to fetch from http://quotes4all.net/rss/360010110/quotes.xml. Could not fetch URL, because [Errno 54] Connection reset by peer

Exception: (UrlException) Could not fetch URL, because [Errno 54] Connection reset by peer
Traceback (most recent call last):
File "/usr/local/bin/termsaver", line 159, in
parse_args(sys.argv[1:])
File "/usr/local/bin/termsaver", line 143, in parse_args
screen().autorun(args[1:])
File "/Library/Python/2.7/site-packages/termsaverlib/screen/base/init.py", line 237, in autorun
self._run_cycle()
File "/Library/Python/2.7/site-packages/termsaverlib/screen/base/rssfeed.py", line 238, in _run_cycle
self.doc_xml_string(self.fetch(self.url))
File "/Library/Python/2.7/site-packages/termsaverlib/screen/helper/urlfetcher.py", line 167, in fetch
_("Could not fetch URL, because %s") % e.reason)
UrlException: Could not fetch URL, because [Errno 54] Connection reset by peer

common.randomize_text_horizontally breaks for long strings

Fond this while implementing figlet plugin:

Crash Report:

Oops! Something went terribly wrong.
Error details: empty range for randrange() (0,-154, -154)

===================================
Exception: (ValueError) empty range for randrange() (0,-154, -154)
Traceback (most recent call last):
  File "./termsaver", line 159, in <module>
    parse_args(sys.argv[1:])
  File "./termsaver", line 143, in parse_args
    screen().autorun(args[1:])
  File "/home/bruno/git/termsaver/termsaverlib/screen/base/__init__.py", line 237, in autorun
    self._run_cycle()
  File "/home/bruno/git/termsaver/termsaverlib/screen/figlet_stat.py", line 127, in _run_cycle
    self.randomize_text_horizontally(figlet_text))
  File "/home/bruno/git/termsaver/termsaverlib/screen/helper/position.py", line 154, in randomize_text_horizontally
    self.pos_x = random.randint(0, self.screen_width - len(text))
  File "/usr/lib/python2.7/random.py", line 241, in randint
    return self.randrange(a, b+1)
  File "/usr/lib/python2.7/random.py", line 217, in randrange
    raise ValueError, "empty range for randrange() (%d,%d, %d)" % (istart, istop, width)
ValueError: empty range for randrange() (0,-154, -154)

===================================

Support additional keybind to exit

I am trying to integrate termsaver in nnn as the default termsaver. I am facing 2 problems:

  • nnn disables ^C at start. Would it be possible to support an additional keybind to exit termsaver? Perhaps ^Q?

  • termsaver clears the terminal on exit. However, I need to restore the nnn window.

Failure to build from source

After having downloaded the source files and running "sudo python setup.py install" it returns a SyntaxError: Missing parentheses in call to 'print' in setup.py, Line 100.

I am running the latest release of Arch Linux and Python.

asciiquarium

Is there a Way, maybe in the near future to run asciiquarium as an screensaver.
Thanks,

Incorrect URL for Django Source in Help for TermSaver

In TermSaver v.0.3, if you run termsaver programmer without a path, part of the error message states:

    If you have access to subversion, you may download it at:
        svn co https://code.djangoproject.com/svn/django/trunk/ django-trunk

However, Django no longer uses subversion, so the it should be updated to read:

    If you have access to git, you may download it at:
        git clone https://github.com/django/django.git

Cheers and thanks for the awesome tools,
Zzyzx

support for locking terminal

Would be cool if possible to password-protect, similar to xscreensaver-command -lock.

Perhaps integrate with vlock?

Add option to slow down scroll/typing speed

I really think RFC and Programmer modules would be more comfortable if they were slower, but I think it would not be much harder to implement a speed setting.

As of now, the scroll speed is way too fast for an idle screen who would stay in sight while working on another screen, and is very distractive.

asciiartfarts - randomization.

Since asciiartfarts is dead since 2014 could we have a randomization option to start farts display at different offset each time?

termsaver clock - Friday, 11st March 2016

The clock says Friday, 11st March 2016.

Is this a bug on the system clock termsaver uses, or something in termsaver? 'st' works fine for 1st, 21st, 31st, but 11st just sounds weird.

hide cursor when termsaver is running

It would be kinda nice to have the terminal cursor hidden when termsaver is running and back to normal on exit.

I am currently running this:

$ setterm --cursor off && termsaver clock && setterm --cursor on

But if there's any way to make this an option or a default it would be great.

Thanks :)

Modernize Plugin System

The plugin system needs to be adjusted to align with new changes and updates to how plugins can be handled in Python 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.