Commit Graph

11 Commits

Author SHA1 Message Date
Gerald Combs 51c714bfb5 Tools: Fetch IANA data over HTTPS. 2021-11-02 16:46:18 +00:00
Jeff Widman 8d7ebc732e Fix issues discovered by common python linters
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`
2020-09-26 04:38:18 +00:00
Guy Harris 20800366dd HTTPS (almost) everywhere.
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>
2019-07-26 18:44:40 +00:00
Gerald Combs 83b2f1bca5 Tools: Make a couple of scripts Python 3-only.
Remove Python 2 support from make-services.py and update-tools-help.py.

Change-Id: I1304038ca07d1d7354795f7b7faacd3747313653
Reviewed-on: https://code.wireshark.org/review/32943
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-04-22 18:41:35 +00:00
Dario Lombardo 8a5385b9c9 More licenses converted to SPDX.
Change-Id: Id4f987dcdacf06622d70263f4659a4400e30dc39
Reviewed-on: https://code.wireshark.org/review/26332
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-03-07 13:35:49 +00:00
João Valverde c09f3ed774 Make the services dictionary ordering stable
Change-Id: I1d148fc5bc58998818043885615965eecc86b3de
Reviewed-on: https://code.wireshark.org/review/22965
Reviewed-by: João Valverde <j@v6e.pt>
2017-08-06 09:52:06 +00:00
João Valverde 733c19a072 Optimize the "services" dictionary
Remove assignee and other miscellaneous information that changes more
frequently than service name and can be consulted directly in the IANA
registry.

Allow merging identical transports into a single line for convenience
and size/speed optimization (a backward-compatible change).

Remove obsolete make-services.pl.

Change-Id: I3ecbd1a6a68d87c084d77498a0eeb44b7afdab67
Reviewed-on: https://code.wireshark.org/review/22872
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-08-04 05:55:08 +00:00
Jeff Morriss 82e2865739 Remove $Id$ and other Subversion leftovers from the tools.
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>
2014-02-14 01:35:57 +00:00
Gerald Combs 5364626e07 Fix error handling.
svn path=/trunk/; revision=51240
2013-08-09 22:47:35 +00:00
Gerald Combs 2dab57f425 Switch to make-services.py. Fix some variable names and version tests.
svn path=/trunk/; revision=51189
2013-08-07 16:33:39 +00:00
Gerald Combs 79713e0ce7 Add a Python version of make-services.pl. Instead of trying to parse the
plain text version of the registry it parses the CSV version (which
should hopefully be more reliable). Tested with Pythons 2.5, 2.6, 2.7,
and 3.3.

Update the services file.

svn path=/trunk/; revision=51178
2013-08-06 23:45:51 +00:00