Coder Social home page Coder Social logo

power-flow-indicator's People

Contributors

bytecommander avatar sergkolo avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

power-flow-indicator's Issues

Locales which use decimal commas instead of dots break output parsing

My locale specifies German number formatting i.e. two and a half will be "2,5" instead of "2.5".

This breaks the part of your script which is responsible for parsing the output of upower because it expects only digits and a dot in floating point number literals.

You could either prefix the upower command with LANG=C to run it with a default English locale or translate commas into dots in the output string before parsing it.

Here's the exact traceback:

$ powerflow-indicator 
/usr/local/bin/powerflow-indicator:39: PyGIWarning: AppIndicator3 was imported without specifying a version first. Use gi.require_version('AppIndicator3', '0.1') before import to ensure that the right version gets loaded.
  from gi.repository import AppIndicator3 as appindicator
Traceback (most recent call last):
  File "/usr/local/bin/powerflow-indicator", line 172, in <module>
    main()
  File "/usr/local/bin/powerflow-indicator", line 168, in main
    indicator = LockKeyStatusIndicator(args.amps)
  File "/usr/local/bin/powerflow-indicator", line 59, in __init__
    self.update_label()
  File "/usr/local/bin/powerflow-indicator", line 153, in update_label
    label_text = self.get_power_info()[0]
  File "/usr/local/bin/powerflow-indicator", line 138, in get_power_info
    1000 * float(energy_rate[:-1]) / float(voltage[:-1]), 4)
ValueError: invalid literal for float(): 17,305

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.