Skip to content

Commit

Permalink
use pyupgrade --py36-plus to upgrade python code syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
khancyr committed Sep 13, 2023
1 parent 2d427f1 commit 4bb5cee
Show file tree
Hide file tree
Showing 15 changed files with 149 additions and 175 deletions.
15 changes: 7 additions & 8 deletions antennatracker/source/conf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
#
# ArduPilot documentation build configuration file, created by
# sphinx-quickstart on Sun Feb 28 02:44:23 2016.
Expand Down Expand Up @@ -50,9 +49,9 @@
master_doc = 'index'

# General information about the project.
project = u'AntennaTracker'
copyright = u'2023, ArduPilot Dev Team'
author = u'ArduPilot Dev Team'
project = 'AntennaTracker'
copyright = '2023, ArduPilot Dev Team'
author = 'ArduPilot Dev Team'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
Expand Down Expand Up @@ -244,8 +243,8 @@
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'ArduPilot.tex', u'ArduPilot Documentation',
u'ArduPilot Dev Team', 'manual'),
(master_doc, 'ArduPilot.tex', 'ArduPilot Documentation',
'ArduPilot Dev Team', 'manual'),
]

# The name of an image file (relative to this directory) to place at the top of
Expand Down Expand Up @@ -274,7 +273,7 @@
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'ardupilot', u'ArduPilot Documentation',
(master_doc, 'ardupilot', 'ArduPilot Documentation',
[author], 1)
]

Expand All @@ -288,7 +287,7 @@
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'ArduPilot', u'ArduPilot Documentation',
(master_doc, 'ArduPilot', 'ArduPilot Documentation',
author, 'ArduPilot', 'One line description of project.',
'Miscellaneous'),
]
Expand Down
16 changes: 7 additions & 9 deletions ardupilot/source/conf.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
#
# ArduPilot documentation build configuration file, created by
# sphinx-quickstart on Sun Feb 28 02:44:23 2016.
Expand Down Expand Up @@ -48,9 +46,9 @@
master_doc = 'index'

# General information about the project.
project = u'ArduPilot'
copyright = u'2023, ArduPilot Dev Team'
author = u'ArduPilot Dev Team'
project = 'ArduPilot'
copyright = '2023, ArduPilot Dev Team'
author = 'ArduPilot Dev Team'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
Expand Down Expand Up @@ -237,8 +235,8 @@
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'ArduPilot.tex', u'ArduPilot Documentation',
u'ArduPilot Dev Team', 'manual'),
(master_doc, 'ArduPilot.tex', 'ArduPilot Documentation',
'ArduPilot Dev Team', 'manual'),
]

# The name of an image file (relative to this directory) to place at the top of
Expand Down Expand Up @@ -267,7 +265,7 @@
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'ardupilot', u'ArduPilot Documentation',
(master_doc, 'ardupilot', 'ArduPilot Documentation',
[author], 1)
]

Expand All @@ -281,7 +279,7 @@
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'ArduPilot', u'ArduPilot Documentation',
(master_doc, 'ArduPilot', 'ArduPilot Documentation',
author, 'ArduPilot', 'One line description of project.',
'Miscellaneous'),
]
Expand Down
15 changes: 7 additions & 8 deletions blimp/source/conf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
#
# ArduPilot documentation build configuration file, created by
# sphinx-quickstart on Sun Feb 28 02:44:23 2016.
Expand Down Expand Up @@ -50,9 +49,9 @@
master_doc = 'index'

# General information about the project.
project = u'Blimp'
copyright = u'2023, ArduPilot Dev Team'
author = u'ArduPilot Dev Team'
project = 'Blimp'
copyright = '2023, ArduPilot Dev Team'
author = 'ArduPilot Dev Team'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
Expand Down Expand Up @@ -247,8 +246,8 @@
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'ArduPilot.tex', u'ArduPilot Documentation',
u'ArduPilot Dev Team', 'manual'),
(master_doc, 'ArduPilot.tex', 'ArduPilot Documentation',
'ArduPilot Dev Team', 'manual'),
]

# The name of an image file (relative to this directory) to place at the top of
Expand Down Expand Up @@ -277,7 +276,7 @@
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'ardupilot', u'ArduPilot Documentation',
(master_doc, 'ardupilot', 'ArduPilot Documentation',
[author], 1)
]

Expand All @@ -291,7 +290,7 @@
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'ArduPilot', u'ArduPilot Documentation',
(master_doc, 'ArduPilot', 'ArduPilot Documentation',
author, 'ArduPilot', 'One line description of project.',
'Miscellaneous'),
]
Expand Down
7 changes: 3 additions & 4 deletions build_parameters.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This script aims to provide multiple parameters source files for each vehicle based on the versions available at
https://firmware.ardupilot.org
Expand Down Expand Up @@ -251,7 +250,7 @@ def fetch_commit_hash(version_link, board, file):
version_number = version.split(" ")[2]
vehicle = version.split(" ")[1]

regex = re.compile('[@_!#$%^&*()<>?/\|}{~:]') # noqa: W605
regex = re.compile(r'[@_!#$%^&*()<>?/\|}{~:]') # noqa: W605

if (regex.search(vehicle) is None): # there are some non standart names
vehicle = vehicle_old_to_new_name[vehicle.strip()] # Names may not be standart as expected
Expand Down Expand Up @@ -318,7 +317,7 @@ def replace_anchors(source_file, dest_file, version_tag):
For each parameter file generate by param_parse.py, it inserts a version tag in anchors
to do not make confusing in sphinx toctrees.
"""
file_in = open(source_file, "r")
file_in = open(source_file)
file_out = open(dest_file, "w")
found_original_title = False
if "latest" not in version_tag:
Expand Down Expand Up @@ -480,7 +479,7 @@ def move_results(vehicles):
if ("latest" not in file): # Trying to re-enable toc list on the left bar on the wiki by forcing latest file name. # noqa: E501
os.rename(file, folder + file)
else:
os.rename(file, str((folder + "parameters.rst")))
os.rename(file, str(folder + "parameters.rst"))

except Exception as e:
error("Error while moving result files of vehicle " + vehicle + " pwd: " + str(os.getcwd()))
Expand Down
1 change: 0 additions & 1 deletion common_conf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
#
# This contains common configuration information for the ardupilot wikis.
# This information is imported by the conf.py files in each of the sub wikis
Expand Down
15 changes: 7 additions & 8 deletions copter/source/conf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
#
# ArduPilot documentation build configuration file, created by
# sphinx-quickstart on Sun Feb 28 02:44:23 2016.
Expand Down Expand Up @@ -50,9 +49,9 @@
master_doc = 'index'

# General information about the project.
project = u'Copter'
copyright = u'2023, ArduPilot Dev Team'
author = u'ArduPilot Dev Team'
project = 'Copter'
copyright = '2023, ArduPilot Dev Team'
author = 'ArduPilot Dev Team'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
Expand Down Expand Up @@ -247,8 +246,8 @@
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'ArduPilot.tex', u'ArduPilot Documentation',
u'ArduPilot Dev Team', 'manual'),
(master_doc, 'ArduPilot.tex', 'ArduPilot Documentation',
'ArduPilot Dev Team', 'manual'),
]

# The name of an image file (relative to this directory) to place at the top of
Expand Down Expand Up @@ -277,7 +276,7 @@
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'ardupilot', u'ArduPilot Documentation',
(master_doc, 'ardupilot', 'ArduPilot Documentation',
[author], 1)
]

Expand All @@ -291,7 +290,7 @@
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'ArduPilot', u'ArduPilot Documentation',
(master_doc, 'ArduPilot', 'ArduPilot Documentation',
author, 'ArduPilot', 'One line description of project.',
'Miscellaneous'),
]
Expand Down
15 changes: 7 additions & 8 deletions dev/source/conf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
#
# ArduPilot documentation build configuration file, created by
# sphinx-quickstart on Sun Feb 28 02:44:23 2016.
Expand Down Expand Up @@ -46,9 +45,9 @@
master_doc = 'index'

# General information about the project.
project = u'Dev'
copyright = u'2023, ArduPilot Dev Team'
author = u'ArduPilot Dev Team'
project = 'Dev'
copyright = '2023, ArduPilot Dev Team'
author = 'ArduPilot Dev Team'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
Expand Down Expand Up @@ -237,8 +236,8 @@
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'ArduPilot.tex', u'ArduPilot Documentation',
u'ArduPilot Dev Team', 'manual'),
(master_doc, 'ArduPilot.tex', 'ArduPilot Documentation',
'ArduPilot Dev Team', 'manual'),
]

# The name of an image file (relative to this directory) to place at the top of
Expand Down Expand Up @@ -267,7 +266,7 @@
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'ardupilot', u'ArduPilot Documentation',
(master_doc, 'ardupilot', 'ArduPilot Documentation',
[author], 1)
]

Expand All @@ -281,7 +280,7 @@
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'ArduPilot', u'ArduPilot Documentation',
(master_doc, 'ArduPilot', 'ArduPilot Documentation',
author, 'ArduPilot', 'One line description of project.',
'Miscellaneous'),
]
Expand Down
1 change: 0 additions & 1 deletion frontend/scripts/get_discourse_posts.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Script to get last blog entries on Discourse (https://discuss.ardupilot.org/)
"""
Expand Down
15 changes: 7 additions & 8 deletions mavproxy/source/conf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
#
# ArduPilot documentation build configuration file, created by
# sphinx-quickstart on Sun Feb 28 02:44:23 2016.
Expand Down Expand Up @@ -46,9 +45,9 @@
master_doc = 'index'

# General information about the project.
project = u'MAVProxy'
copyright = u'2023, ArduPilot Dev Team'
author = u'ArduPilot Dev Team'
project = 'MAVProxy'
copyright = '2023, ArduPilot Dev Team'
author = 'ArduPilot Dev Team'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
Expand Down Expand Up @@ -240,8 +239,8 @@
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'ArduPilot.tex', u'ArduPilot Documentation',
u'ArduPilot Dev Team', 'manual'),
(master_doc, 'ArduPilot.tex', 'ArduPilot Documentation',
'ArduPilot Dev Team', 'manual'),
]

# The name of an image file (relative to this directory) to place at the top of
Expand Down Expand Up @@ -270,7 +269,7 @@
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'ardupilot', u'ArduPilot Documentation',
(master_doc, 'ardupilot', 'ArduPilot Documentation',
[author], 1)
]

Expand All @@ -284,7 +283,7 @@
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'ArduPilot', u'ArduPilot Documentation',
(master_doc, 'ArduPilot', 'ArduPilot Documentation',
author, 'ArduPilot', 'One line description of project.',
'Miscellaneous'),
]
Expand Down
15 changes: 7 additions & 8 deletions plane/source/conf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
#
# ArduPilot documentation build configuration file, created by
# sphinx-quickstart on Sun Feb 28 02:44:23 2016.
Expand Down Expand Up @@ -50,9 +49,9 @@
master_doc = 'index'

# General information about the project.
project = u'Plane'
copyright = u'2023, ArduPilot Dev Team'
author = u'ArduPilot Dev Team'
project = 'Plane'
copyright = '2023, ArduPilot Dev Team'
author = 'ArduPilot Dev Team'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
Expand Down Expand Up @@ -246,8 +245,8 @@
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'ArduPilot.tex', u'ArduPilot Documentation',
u'ArduPilot Dev Team', 'manual'),
(master_doc, 'ArduPilot.tex', 'ArduPilot Documentation',
'ArduPilot Dev Team', 'manual'),
]

# The name of an image file (relative to this directory) to place at the top of
Expand Down Expand Up @@ -276,7 +275,7 @@
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'ardupilot', u'ArduPilot Documentation',
(master_doc, 'ardupilot', 'ArduPilot Documentation',
[author], 1)
]

Expand All @@ -290,7 +289,7 @@
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'ArduPilot', u'ArduPilot Documentation',
(master_doc, 'ArduPilot', 'ArduPilot Documentation',
author, 'ArduPilot', 'One line description of project.',
'Miscellaneous'),
]
Expand Down
Loading

0 comments on commit 4bb5cee

Please sign in to comment.