aboutsummaryrefslogtreecommitdiffstats
path: root/tools/rdps.py
AgeCommit message (Collapse)AuthorFilesLines
2023-07-20rdps: generate big text arrays and one fwrite() call.Guy Harris1-9/+11
Rather than generating a bunch of individual fprintf() calls, one per line of the preamble and finale, generate two static const char arrays with the preamble and finale text, and have the routines just write them out with an fwrite().
2023-07-20rdps: no need to set script_name in start_code().Guy Harris1-1/+0
It's already been set by main().
2021-01-25rdps.py: Use string equality for comparing stringsMoshe Kaplan1-3/+3
In Python, `is` is meant for checking object equality, not string equality. For more info, see https://docs.python.org/3/reference/expressions.html#is
2020-11-05Tools+test: Call python3 explicitly.Gerald Combs1-1/+1
PEP 394[1] says, "In cases where the script is expected to be executed outside virtual environments, developers will need to be aware of the following discrepancies across platforms and installation methods: * Older Linux distributions will provide a python command that refers to Python 2, and will likely not provide a python2 command. * Some newer Linux distributions will provide a python command that refers to Python 3. * Some Linux distributions will not provide a python command at all by default, but will provide a python3 command by default." Debian has forced the issue by choosing the third option[2]: "NOTE: Debian testing (bullseye) has removed the "python" package and the '/usr/bin/python' symlink due to the deprecation of Python 2." Switch our shebang from "#!/usr/bin/env python" to "#!/usr/bin/env python3" in some places. Remove some 2/3 version checks if we know we're running under Python 3. Remove the "coding: utf-8" in a bunch of places since that's the default in Python 3. [1]https://www.python.org/dev/peps/pep-0394/#for-python-script-publishers [2]https://wiki.debian.org/Python
2020-09-26Fix issues discovered by common python lintersJeff Widman1-1/+8
Fix some issues discovered by common python linters including: * switch `None` comparisons to use `is` rather than `==`. Identity != equality, and I've spent 40+ hours before tracking down a subtle bug caused by exactly this issue. Note that this may introduce a problem if one of the scripts is depending on this behavior, in which case the comparison should be changed to `True`/`False` rather than `None`. * Use `except Exception:` as bare `except:` statements have been discouraged for years. Ideally for some of these we'd examine if there were specific exceptions that should be caught, but for now I simply caught all. Again, this could introduce very subtle behavioral changes under Python 2, but IIUC, that was all fixed in Python 3, so safe to move to `except Exception:`. * Use more idiomatic `if not x in y`--> `if x not in y` * Use more idiomatic 2 blank lines. I only did this at the beginning, until I realized how overwhelming this was going to be to apply, then I stopped. * Add a TODO where an undefined function name is called, so will fail whenever that code is run. * Add more idiomatic spacing around `:`. This is also only partially cleaned up, as I gave up when I saw how `asn2wrs.py` was clearly infatuated with the construct. * Various other small cleanups, removed some trailing whitespace and improper indentation that wasn't a multiple of 4, etc. There is still _much_ to do, but I haven't been heavily involved with this project before, so thought this was a sufficient amount to put up and see what the feedback is. Linters that I have enabled which highlighted some of these issues include: * `pylint` * `flake8` * `pycodestyle`
2019-07-26HTTPS (almost) everywhere.Guy Harris1-1/+1
Change all wireshark.org URLs to use https. Fix some broken links while we're at it. Change-Id: I161bf8eeca43b8027605acea666032da86f5ea1c Reviewed-on: https://code.wireshark.org/review/34089 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-02-13more SPDX convertions.Dario Lombardo1-13/+1
Change-Id: I6b8404c28b31a81767a3b64ffe9ba96156c4c217 Reviewed-on: https://code.wireshark.org/review/25757 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-02-09caputils/tools: more SPDX convertions.Dario Lombardo1-13/+1
Change-Id: I44a8d1848f768acf4c3b31a68c845264c74e4bba Reviewed-on: https://code.wireshark.org/review/25709 Petri-Dish: Dario Lombardo <lomato@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-02-14Remove $Id$ and other Subversion leftovers from the tools.Jeff Morriss1-2/+0
There are a few things in here which could still use attention. Don't regenerate anything now. Change-Id: I283c224d3523212144707fca3d6265916cb11792 Reviewed-on: https://code.wireshark.org/review/205 Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
2013-12-01Use 4-space (PEP 8) indentation. Add modelines.Gerald Combs1-0/+11
svn path=/trunk/; revision=53685
2012-06-28Update Free Software Foundation address.Jakub Zawadzki1-2/+2
(COPYING will be updated in next commit) svn path=/trunk/; revision=43536
2010-03-25Set svn:executable property for some .py and .pl filesBill Meier1-0/+0
svn path=/trunk/; revision=32287
2009-10-06Remove $Id$Kovarththanan Rajaratnam1-2/+0
svn path=/trunk/; revision=30368
2009-10-04Move rdps.py to tools/rdps.pyKovarththanan Rajaratnam1-0/+151
svn path=/trunk/; revision=30281