Disable 'style PEP' messages
Hi... How do I set Pycharm to find only syntax errors?!! "When you pass through the waters, I will be with you: and when you pass through the rivers, they will not sweep over you. When you walk through the fire, you will not be burned: the flames will not set you ablaze." Isaiah 43:2 | | Virus-free.www.avg.com | -- https://mail.python.org/mailman/listinfo/python-list
Re: Disable 'style PEP' messages
On 5/4/23 10:28, Kevin M. Wilson via Python-list wrote: Hi... How do I set Pycharm to find only syntax errors?!! By configuring PyCharm the way you want. See PyCharm's documentation for how to do that. Hint: Settings -> Editor -> Code Style -> Inspections -- https://mail.python.org/mailman/listinfo/python-list
Re: Disable 'style PEP' messages
On 05/05/2023 04.28, Kevin M. Wilson via Python-list wrote: Hi... How do I set Pycharm to find only syntax errors?!! Please review response to previous message re:configuring PyCharm's helpful features towards to coders and quality-coding... -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list
[pygettext] --package-name and --package-version unknown
Hello, am I right to assume that "pygettext" is part of the official Python3 "package"? So it is OK to aks here? I do use pygettext to handle po and pot files. In the manpage I'm not able to find help about this. I would like to modify the header that pygettext does create in each po-file. How can I set the "Project-Id-Version"? With "xgettext" I would use the arguments "--package-name" and "--package-version" for this but they are unknown for "pygettext". Kind Christian -- https://mail.python.org/mailman/listinfo/python-list
Re: [pygettext] --package-name and --package-version unknown
On 04/05/2023 22:38, c.bu...@posteo.jp wrote: > Hello, > > am I right to assume that "pygettext" is part of the official Python3 > "package"? So it is OK to aks here? > No it doesn't appear to be. It is not listed in the standard library. It is mentioned in the documentation for gettext which is part of the standard library. It does seem to be part of the Python i18n toolkit however. There are extensive comments in the .py file. https://github.com/python/cpython/tree/main/Tools/i18n/pygettext.py > I would like to modify the header that pygettext does create in each > po-file. Sorry, I've never used pygettext so can't help there. -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www.amazon.com/author/alan_gauld Follow my photo-blog on Flickr at: http://www.flickr.com/photos/alangauldphotos -- https://mail.python.org/mailman/listinfo/python-list
Re: [pygettext] --package-name and --package-version unknown
On 5/4/23 17:38, c.bu...@posteo.jp wrote: am I right to assume that "pygettext" is part of the official Python3 "package"? So it is OK to aks here? How can I set the "Project-Id-Version"? With "xgettext" I would use the arguments "--package-name" and "--package-version" for this but they are unknown for "pygettext". pygettext is deprecated since xgettext supports python now, so using xgettext is recommended. That being said, pygettext does not support the options, but it could be modified pretty easily. Untested but if you wanted to add that functionality in just create a modified pygettext.py with something like: link PACKAGE and VERSION to variables: pot_header = _('''\ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR ORGANIZATION # FIRST AUTHOR , YEAR. # msgid "" msgstr "" "Project-Id-Version: %(packagename)s %(packageversion)s\\n" "POT-Creation-Date: %(time)s\\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\\n" "Last-Translator: FULL NAME \\n" "Language-Team: LANGUAGE \\n" "MIME-Version: 1.0\\n" "Content-Type: text/plain; charset=%(charset)s\\n" "Content-Transfer-Encoding: %(encoding)s\\n" "Generated-By: pygettext.py %(version)s\\n" ''') add attributes to Options class: class Options: # constants GNU = 1 SOLARIS = 2 # defaults extractall = 0 # FIXME: currently this option has no effect at all. escape = 0 keywords = [] outpath = '' outfile = 'messages.pot' writelocations = 1 locationstyle = GNU verbose = 0 width = 78 excludefilename = '' docstrings = 0 nodocstrings = {} packagename = "PACKAGE" packageversion = "VERSION" modify option parsing for loop to look for new options: for opt, arg in opts: elif opt in ('--package-name',): options.packagename = arg elif opt in ('--package-version',): options.packageversion = arg grab those options when generating file output: def write(self, fp): options = self.__options packagename = options.packagename packageversion = options.packageversion timestamp = time.strftime('%Y-%m-%d %H:%M%z') encoding = fp.encoding if fp.encoding else 'UTF-8' print(pot_header % {'packagename': packagename, 'packageversion': packageversion, 'time': timestamp, 'version': __version__, 'charset': encoding, 'encoding': '8bit'}, file=fp) (did not test, so might be a bug or two) -- https://mail.python.org/mailman/listinfo/python-list
Three (3) >>> in the debug screen of PyCharm... Que Es over?!!
"When you pass through the waters, I will be with you: and when you pass through the rivers, they will not sweep over you. When you walk through the fire, you will not be burned: the flames will not set you ablaze." Isaiah 43:2 | | Virus-free.www.avg.com | -- https://mail.python.org/mailman/listinfo/python-list