Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build_addon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9
python-version: 3.11
cache: 'pip'

- name: Install dependencies
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.venv/
.env/
addon/doc/*.css
addon/doc/en/
*_docHandler.py
Expand Down
2 changes: 1 addition & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"ms-python.python",
"ms-python.vscode-pylance",
"redhat.vscode-yaml",
"ms-python.flake8"
"charliermarsh.ruff"
],
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
"unwantedRecommendations": []
Expand Down
4 changes: 0 additions & 4 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
{
"editor.accessibilitySupport": "on",
"flake8.args": [
"--config=flake8.ini"
],
"flake8.importStrategy": "fromEnvironment",
"python.autoComplete.extraPaths": [
"../nvda/source",
"../nvda/miscDeps/python"
Expand Down
1 change: 0 additions & 1 deletion addon/globalPlugins/webAccess/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@


import config
from logHandler import log

from . import webModuleHandler

Expand Down
2 changes: 1 addition & 1 deletion addon/globalPlugins/webAccess/gui/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def __init__(self, *args, **kwargs):
super(ContextualSettingsPanel, self).__init__(*args, **kwargs)

def initData(self, context):
raise NotImplemented()
raise NotImplementedError()

# Set to True if the view depends on data that can be edited on other panels of the same dialog
initData.onPanelActivated = False
Expand Down
1 change: 0 additions & 1 deletion addon/globalPlugins/webAccess/gui/criteriaEditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@

import controlTypes
import gui
from logHandler import log

from ..ruleHandler import ruleTypes
from ..utils import guarded, updateOrDrop
Expand Down
1 change: 0 additions & 1 deletion addon/globalPlugins/webAccess/gui/menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
from ... import webAccess
from .. import ruleHandler
from .. import webModuleHandler
from . import webModulesManager


def show(context):
Expand Down
3 changes: 1 addition & 2 deletions addon/globalPlugins/webAccess/gui/ruleEditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
__author__ = "Shirley Noël <[email protected]>"


from collections import OrderedDict, namedtuple
from collections import OrderedDict
import wx
# TODO: Work-arround ExpandoTextCtrl mishandling maxHeight and vscroll
# from wx.lib.expando import EVT_ETC_LAYOUT_NEEDED, ExpandoTextCtrl
Expand All @@ -36,7 +36,6 @@
import inputCore
from logHandler import log

from .. import ruleHandler
from ..ruleHandler import ruleTypes
from ..ruleHandler.controlMutation import (
MUTATIONS_BY_RULE_TYPE,
Expand Down
1 change: 0 additions & 1 deletion addon/globalPlugins/webAccess/gui/rulesManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,6 @@ def onTreeKeyDown(self, evt):
evt.Skip()

def onTreeSelChanged(self, evt):
from logHandler import log
if (
evt is not None
and (evt.EventObject is None or evt.EventObject.IsBeingDeleted())
Expand Down
3 changes: 0 additions & 3 deletions addon/globalPlugins/webAccess/gui/webModuleEditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,7 @@
import os
import wx

from NVDAObjects import NVDAObject, IAccessible
import addonHandler
import api
import controlTypes
import config
import gui
from logHandler import log
Expand Down
3 changes: 0 additions & 3 deletions addon/globalPlugins/webAccess/gui/webModulesManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,7 @@
import addonHandler
addonHandler.initTranslation()
import config
import core
import globalVars
import gui
import languageHandler
from logHandler import log

from gui.nvdaControls import AutoWidthColumnListCtrl
Expand Down
1 change: 0 additions & 1 deletion addon/globalPlugins/webAccess/overlay.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@


from six import iteritems
from six.moves import xrange

from garbageHandler import TrackedObject

Expand Down
1 change: 0 additions & 1 deletion addon/globalPlugins/webAccess/ruleHandler/ruleTypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
__author__ = "Julien Cochuyt <[email protected]>"


from collections import OrderedDict

import addonHandler

Expand Down
2 changes: 1 addition & 1 deletion addon/globalPlugins/webAccess/store/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def route(self, ref=None, item=None, **kwargs):
if len(ref) == 1:
ref = ref[0]
else:
ValueError("Unexpected ref format: {ref}".format(ref))
ValueError("Unexpected ref format: {ref}".format())
else:
storeKey = ref
store = None
Expand Down
2 changes: 1 addition & 1 deletion addon/globalPlugins/webAccess/store/addons.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
class AddonsStore(DispatchStore):

def __init__(self, *args, **kwargs):
if not "name" in kwargs:
if "name" not in kwargs:
kwargs["name"] = "addons"
self.addonStoreFactory = kwargs["addonStoreFactory"]
super(AddonsStore, self).__init__(*args, **kwargs)
Expand Down
5 changes: 1 addition & 4 deletions addon/globalPlugins/webAccess/store/webModule.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,16 @@

from collections import OrderedDict
import errno
import imp
import os
import os.path
from pprint import pformat
import re
import sys

import config
import globalVars
from logHandler import log

from ..lib.packaging import version
from ..webModuleHandler import InvalidApiVersion, WebModule, WebModuleDataLayer, getWebModuleFactory
from ..webModuleHandler import WebModule, WebModuleDataLayer, getWebModuleFactory
from . import DispatchStore
from . import DuplicateRefError
from . import MalformedRefError
Expand Down
1 change: 0 additions & 1 deletion addon/globalPlugins/webAccess/webAppLib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ def trace (msg="trace"):
speech.speakMessage (msg)

def beep (freq=1000, dur=50):
import tones
tones.beep (freq, dur)

def reportFocus (obj):
Expand Down
1 change: 0 additions & 1 deletion addon/globalPlugins/webAccess/webAppScheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import wx

import api
import textInfos

from .overlay import WebAccessBmdti, WebAccessObject
from .webAppLib import *
Expand Down
4 changes: 2 additions & 2 deletions addon/globalPlugins/webAccess/webModuleHandler/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ def save(webModule, layerName=None, prompt=True, force=False, fromRuleEditor=Fal
)
else:
store.update(webModule, layerName=layer.name, force=force)
except DuplicateRefError as e:
except DuplicateRefError:
if not prompt or force:
return False
from ..gui import webModuleEditor
Expand Down Expand Up @@ -303,7 +303,7 @@ def showEditor(context, new=False):
force=force
)
keepShowing = keepTrying = False
except DuplicateRefError as e:
except DuplicateRefError:
if webModuleEditor.promptOverwrite():
force = True
else:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@
from collections import OrderedDict
import datetime
import inspect
import os
from pprint import pformat

import addonHandler
addonHandler.initTranslation()
Expand Down
5 changes: 0 additions & 5 deletions addon/globalPlugins/webAccess/webModuleHandler/webModule.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,13 @@


from collections import OrderedDict
import datetime
import json
import os

import addonHandler
addonHandler.initTranslation()
import api
import baseObject
import braille
import config
import controlTypes
import globalVars
from logHandler import log
import scriptHandler
import speech
Expand Down
40 changes: 40 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
[tool.ruff]
line-length = 110

builtins = [
# translation lookup
"_",
# translation lookup
"ngettext",
# translation lookup
"pgettext",
# translation lookup
"npgettext",
]

include = [
"*.py",
"sconstruct",
]

exclude = [
".git",
"__pycache__",
]

[tool.ruff.format]
indent-style = "tab"

[tool.ruff.lint.mccabe]
max-complexity = 15

[tool.ruff.lint]
ignore = [
# indentation contains tabs
"W191",
]

[tool.ruff.lint.per-file-ignores]
# sconstruct contains many inbuilt functions not recognised by the lint,
# so ignore F821.
"sconstruct" = ["F821"]
6 changes: 6 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,9 @@ SCons==4.5.2

# Building user documentation
Markdown==3.5.1

# Linter and code formatting tool
ruff==0.5.5

# Git hook scripts to automate tasks
pre-commit==3.7.1
Loading