Received: by 10.192.165.148 with SMTP id m20csp2272893imm; Thu, 3 May 2018 13:28:36 -0700 (PDT) X-Google-Smtp-Source: AB8JxZr1OLBDpIG5pHjFbet8HzmksLMWw1Ri1hQVFke/9MZgZHhrddSTRf+ehOUQ/38/WT7EEagh X-Received: by 2002:a17:902:9004:: with SMTP id a4-v6mr23921563plp.143.1525379316682; Thu, 03 May 2018 13:28:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525379316; cv=none; d=google.com; s=arc-20160816; b=M/njkL2ZWq7S0WAPSz3hB/2drzZJPjy9EOtwH2dtGz8taIckBk7gf4yhptCOqmSWGj VgceNqcddaQwFGy5YXtfCo5TT0Rb0RznMN8ysw5wMn+0iskPIm4dJLJUY7LxVeFJ4IVf yRcPUcvxqG3fESh7ATzdcClL7E3G7NWyNWuMWTLQ1SNKk9oCiM4TiYhkC2932/BdOu+8 R9g65mYtdK1+wHm8FUI0ogeIBtPTA5FFOacUujApyG5wP/Yql2WhrqnFGggmIi5/RPj5 dlgBva51fyOO0yvfvcRIB7vRSdWsNN7056HESdzoMDbwxlD3LuGw/MNkSgdnq44B2/Sz +yyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=XlnyTrieXvjmetSFSSi4vpYsaWk0+ujdK3Ir8PQ7UbY=; b=Z2qKlyzbVZTVPKy1TZ4XPK+RM+68rTcoNTeOs0DgIAwR7mKHzONFNp/4tGVljjS0Ll sOidUcqrais8vDbjIOoC+TqApruO7vcZZZiO1BJsgg00baHDfsIQlfrCf9TFaLZwXvVk LKcsCVTaONMlJU1bO306a7IPQyLUkh/2rAGR3rTUmX8aYu001Wb1wCgatQSPLiahgroO 5/gVcRIFdBtbxFAF+r4p0tCWQrJs1bmKW5Z0lxz6bSVJkUKqL2ko4Nrhu1dmeamJ6p4U Jhk5PQU9RZCY5+hMmTdRsmwOYV9xJKRGjPVh3zDxBgiuVAo1Je2jfgftLhExtDdD3itw cRlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=mOA4TjoP; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v1-v6si877275pgr.30.2018.05.03.13.28.21; Thu, 03 May 2018 13:28:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=mOA4TjoP; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751220AbeECU2M (ORCPT + 99 others); Thu, 3 May 2018 16:28:12 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:57656 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750822AbeECU2K (ORCPT ); Thu, 3 May 2018 16:28:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To: Subject:Sender:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=XlnyTrieXvjmetSFSSi4vpYsaWk0+ujdK3Ir8PQ7UbY=; b=mOA4TjoPmE8IkTtdfDuIcWRtP 2HX4RWFkAS1+efRGlzZI0Iwihb1uO2fd2pofGSVMFdBYziQqbV+B4fi0+TM38k0gKzR1Dc81R7KBf B6Mr1F9I2vbVSYLLQTiwY/aTYQnm/2zXA/pNATXdP6BGkTXd2ejxiS+v/DrBEPKJxyXTKUeIUcDXG KKNrIRY8y0nlv15+GwOcNeJ3pUlEcLbpjeQRkgdgN3UPNjlv0PI3wyNejwyRtquoxBijPCcn7RTEf WnOIYOzjcIt2LxVWJqUsc0aCL1G2k4B7dEO+Do90tVldGUAFdyr1dXFkh1zPTK10zFqBC0c1ssdxw mdXkgqfZA==; Received: from static-50-53-52-16.bvtn.or.frontiernet.net ([50.53.52.16] helo=midway.dunlab) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fEKpl-0003Lh-Vf; Thu, 03 May 2018 20:28:10 +0000 Subject: Re: [ANNOUNCE] Kconfiglib menuconfig implementation To: Ulf Magnusson Cc: Linux Kbuild mailing list , Linux Kernel Mailing List References: From: Randy Dunlap Message-ID: <3d9be2f2-3fbe-411b-8529-0e0847f01346@infradead.org> Date: Thu, 3 May 2018 13:28:07 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/01/2018 02:07 PM, Ulf Magnusson wrote: > On Tue, May 1, 2018 at 9:47 PM, Ulf Magnusson wrote: >> On Tue, May 1, 2018 at 9:12 PM, Ulf Magnusson wrote: >>> On Tue, May 1, 2018 at 7:56 PM, Randy Dunlap wrote: >>>> On 04/30/2018 05:57 PM, Ulf Magnusson wrote: >>>>> Hello, >>>>> >>>>> Kconfiglib (https://github.com/ulfalizer/Kconfiglib) now has a >>>>> terminal menuconfig implementation, implemented in plain curses >>>>> (which is in the Python standard library). >>>>> >>>>> The interface should feel familiar to people used to mconf. It has >>>>> some features that mconf lacks: >>>>> >>>>> - Seamless resizing >>>>> >>>>> - Unicode support >>>>> >>>>> - Runs on Windows (via 'pip install windows-curses', which uses >>>>> PDCurses) >>>>> >>>>> - Improved information displays: >>>>> >>>>> * All expressions are split into readable chunks >>>>> >>>>> * Menus and comments have information displays >>>>> >>>>> - Relatively easy-to-read and easy-to-tweak code. >>>>> >>>>> Kconfiglib automatically invalidates symbols as needed, and >>>>> values can never get stale, which helps. >>>>> >>>>> Some upcoming features are mouse support and a search feature that >>>>> can jump directly to the definition of a symbol. The jump-to feature >>>>> will use a "show-all" mode in case the symbol isn't visible. >>>>> >>>>> See the Kconfiglib GitHub page for screenshots. The menuconfig >>>>> implementation is at >>>>> https://github.com/ulfalizer/Kconfiglib/blob/master/menuconfig.py. >>>>> The docstring at the top has some more information. >>>> >>>> Hi, >>>> >>>> I'm probably missing some python additive (I hope it's that easy), but >>>> menuconfig.py is not liking the "degree" symbol in drivers/net/can/peak_canfd/Kconfig: >>>> >>>> config CAN_PEAK_PCIEFD >>>> depends on PCI >>>> tristate "PEAK-System PCAN-PCIe FD cards" >>>> ---help--- >>>> This driver adds support for the PEAK-System PCI Express FD >>>> CAN-FD cards family. >>>> These 1x or 2x CAN-FD channels cards offer CAN 2.0 a/b as well as >>>> CAN-FD access to the CAN bus. Besides the nominal bitrate of up to >>>> 1 Mbit/s, the data bytes of CAN-FD frames can be transmitted with >>>> up to 12 Mbit/s. A galvanic isolation of the CAN ports protects the >>>> electronics of the card and the respective computer against >>>> disturbances of up to 500 Volts. The PCAN-PCI Express FD can be >>>> operated with ambient temperatures in a range of -40 to +85 °C. >>>> >>>> >>>> kconfiglib.KconfigSyntaxError: >>>> Malformed ascii in drivers/net/can/peak_canfd/Kconfig >>>> Context: b't temperatures in a range of -40 to +85 \xc2\xb0C.\n' >>>> Problematic data: b'\xc2' >>>> Reason: ordinal not in range(128) >>>> >>>> >>>> thanks, >>>> -- >>>> ~Randy >>> >>> Thanks for trying it out! >>> >>> You're probably running in the C locale, which implies an ASCII >>> encoding. That has caused enough trouble that the Python devs decided >>> to automatically convert it to UTF-8 in Python 3.7: >>> https://www.python.org/dev/peps/pep-0538/. LC_CTYPE=C.UTF-8 should fix >>> it. >>> >>> It's a bit silly to have it crash for something like that though. I >>> could force UTF-8 instead of respecting the locale (though it feels >>> neater to respect settings), or tell Python to ignore decoding errors. >>> Should probably do something at least... >>> >>> Cheers, >>> Ulf >> >> Leaning towards just forcing UTF-8. It's what you want in 99% of >> cases, and ignoring decoding errors would be unsafe for Unicode string >> values. >> >> Could make the forcing optional, and default to on... >> >> Cheers, >> Ulf > > Went with a more general solution: > https://github.com/ulfalizer/Kconfiglib/commit/da40c014398f329b324a2eb9de062344e773dc74 > > You can now specify any encoding (or None, to use the encoding > specified in the environment), with "utf-8" as the default. That > default probably saves a bunch of pain in practice. Hi, (with new kconfiglib.py and menuconfig.py) Thanks for the fixes. If I use "LC_CTYPE=C.UTF-8" then I get the down arrows in the bottom colored bar. Without that, I get an upside-down T (that is 193, 0xc1, line drawing character in the IBM extended character set). Hm. With LC_CTYPE=C.UTF-8, the upper colored bar prints up arrows. Without that, it prints ^^^^^^^^^^^^^^. That's nice that it can do either. Being a vim user, I do like the optional navigation keys. -- ~Randy