Git Product home page Git Product logo

Comments (9)

kellyjonbrazil avatar kellyjonbrazil commented on August 12, 2024 1

Sounds good - reopening this issue and I'll close when the next version is released.

from jc.

bzglve avatar bzglve commented on August 12, 2024

distro: Arch

jc version
image

Name            : jc
Version         : 1.24.0-1
Description     : Converts the output of popular command-line tools and file-types to JSON
Architecture    : any
URL             : https://github.com/kellyjonbrazil/jc
Licenses        : MIT
Groups          : None
Provides        : None
Depends On      : python  python-pygments  python-ruamel-yaml  python-xmltodict
Optional Deps   : None
Required By     : None
Optional For    : None
Conflicts With  : None
Replaces        : None
Installed Size  : 8.30 MiB
Packager        : George Rawlinson <[email protected]>
Build Date      : Thu 28 Dec 2023 11:31:34 AM +06
Install Date    : Mon 01 Jan 2024 03:51:46 PM +06
Install Reason  : Explicitly installed
Install Script  : No
Validated By    : Signature

iwconfig installed with wireless_tools

Name            : wireless_tools
Version         : 30.pre9-3
Description     : Tools allowing to manipulate the Wireless Extensions
Architecture    : x86_64
URL             : https://hewlettpackard.github.io/wireless-tools/Tools.html
Licenses        : GPL
Groups          : None
Provides        : None
Depends On      : None
Optional Deps   : None
Required By     : conky
Optional For    : None
Conflicts With  : None
Replaces        : None
Installed Size  : 352.27 KiB
Packager        : Evangelos Foutras <[email protected]>
Build Date      : Wed 13 Nov 2019 10:13:01 PM +06
Install Date    : Mon 13 Mar 2023 09:57:11 AM +06
Install Reason  : Installed as a dependency for another package
Install Script  : No
Validated By    : Signature

image

from jc.

kellyjonbrazil avatar kellyjonbrazil commented on August 12, 2024

Hi - thanks for reporting this. Could you copy/paste the iwconfig output in a code block here? Something like this:

$ iwconfig > iwconfig.out
$ cat iwconfig.out
...

from jc.

bzglve avatar bzglve commented on August 12, 2024

sure
image

from jc.

lubomir-brindza avatar lubomir-brindza commented on August 12, 2024

It's likely the parser trips up due to the ESSID string containing the caret (^) character:

$ cat orig.txt
wlp0s20f3  IEEE 802.11  ESSID:"Sacharidy"  
          Mode:Managed  Frequency:5.22 GHz  Access Point: E6:63:DA:A8:E4:91   
          Bit Rate=270 Mb/s   Tx-Power=22 dBm   
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Power Management:on
          Link Quality=38/70  Signal level=-72 dBm  
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:4143   Missed beacon:0

$ cat orig.txt | jc --iwconfig
[{"name":"wlp0s20f3","protocol":"IEEE 802.11","essid":"Sacharidy","mode":"Managed","frequency":5.22,"frequency_unit":"GHz","access_point":"E6:63:DA:A8:E4:91","bit_rate":270.0,"bit_rate_unit":"Mb/s","tx_power":22,"tx_power_unit":"dBm","retry_short_limit":7,"rts_threshold":false,"fragment_threshold":false,"power_management":true,"link_quality":"38/70","signal_level":-72,"signal_level_unit":"dBm","rx_invalid_nwid":0,"rx_invalid_crypt":0,"rx_invalid_frag":0,"tx_excessive_retries":0,"invalid_misc":4143,"missed_beacon":0}]

$ cat broken.txt
wlp0s20f3  IEEE 802.11  ESSID:"^_^"  
          Mode:Managed  Frequency:5.22 GHz  Access Point: E6:63:DA:A8:E4:91   
          Bit Rate=270 Mb/s   Tx-Power=22 dBm   
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Power Management:on
          Link Quality=38/70  Signal level=-72 dBm  
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:4143   Missed beacon:0

$ cat broken.txt | jc --iwconfig
[]

(running jc 1.25.1)

from jc.

bzglve avatar bzglve commented on August 12, 2024

thank, it work
sry for bothering
I'll wait for 1.25.x build for Arch

upd: I'm sorry, I didn't read your message correctly and hurriedly. Why did I think that 1.25.* fixes the problem

from jc.

kellyjonbrazil avatar kellyjonbrazil commented on August 12, 2024

This is fixed in the dev branch: https://github.com/kellyjonbrazil/jc/blob/dev/jc/parsers/iwconfig.py

You can test by copying the file above to your jc parser plugin directory:

  • Linux/unix: $HOME/.local/share/jc/jcparsers
  • macOS: $HOME/Library/Application Support/jc/jcparsers
  • Windows: $LOCALAPPDATA\jc\jc\jcparsers

from jc.

bzglve avatar bzglve commented on August 12, 2024

thanks
I don't know much regex but I think it should work fine
Waiting for merge dev to master and bulding package for Arch

from jc.

kellyjonbrazil avatar kellyjonbrazil commented on August 12, 2024

Added in v1.25.2

from jc.

Related Issues (20)

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.