Re: [PATCH v2 1/2] usertools/devbind: update coding style

2024-12-04 Thread Burakov, Anatoly
On 12/3/2024 11:16 PM, Stephen Hemminger wrote: On Tue, 3 Dec 2024 11:25:00 + Anatoly Burakov wrote: Devbind is one of the oldest tools in DPDK, and is written in a way that uses a lot of string matching, no type safety, lots of global variables, and has a few inconsistencies in the way i

Re: [PATCH v2 1/2] usertools/devbind: update coding style

2024-12-04 Thread Burakov, Anatoly
On 12/3/2024 6:07 PM, Stephen Hemminger wrote: On Tue, 3 Dec 2024 11:25:00 + Anatoly Burakov wrote: + +def check_installed(program: str, package: str) -> None: +"""Check if a program is installed.""" +if subprocess.call( +["which", program], stdout=subprocess.DEVNULL, std

Re: [PATCH v2 1/2] usertools/devbind: update coding style

2024-12-03 Thread Stephen Hemminger
On Tue, 3 Dec 2024 11:25:00 + Anatoly Burakov wrote: > + > +def check_installed(program: str, package: str) -> None: > +"""Check if a program is installed.""" > +if subprocess.call( > +["which", program], stdout=subprocess.DEVNULL, > stderr=subprocess.DEVNULL > +): > +

[PATCH v2 1/2] usertools/devbind: update coding style

2024-12-03 Thread Anatoly Burakov
Devbind is one of the oldest tools in DPDK, and is written in a way that uses a lot of string matching, no type safety, lots of global variables, and has a few inconsistencies in the way it handles data (such as differences between lspci calls and parsing in different circumstances). This patch is