Skip to content

Commit

Permalink
Add noqa comments for macpython constants, fixes flake8 F403,F405
Browse files Browse the repository at this point in the history
  • Loading branch information
tpikonen committed Nov 12, 2023
1 parent faaba4c commit b5e5840
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/gpodder/gtkui/macosx.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def aeKeyword(fourCharCode):
# for the kCoreEventClass, kAEOpenDocuments, ... constants
# comes with macpython
try:
from Carbon.AppleEvents import *
from Carbon.AppleEvents import * # noqa: F403
except ImportError:
...

Expand Down Expand Up @@ -62,18 +62,18 @@ def register(self, gp):
self.gp = gp
aem = NSAppleEventManager.sharedAppleEventManager()
aem.setEventHandler_andSelector_forEventClass_andEventID_(
self, 'openFileEvent:reply:', aeKeyword(kCoreEventClass), aeKeyword(kAEOpenDocuments))
self, 'openFileEvent:reply:', aeKeyword(kCoreEventClass), aeKeyword(kAEOpenDocuments)) # noqa: F405
aem.setEventHandler_andSelector_forEventClass_andEventID_(
self, 'subscribeEvent:reply:', aeKeyword('GURL'), aeKeyword('GURL'))

def openFileEvent_reply_(self, event, reply):
""" handles an 'Open With...' event"""
urls = []
filelist = event.paramDescriptorForKeyword_(aeKeyword(keyDirectObject))
filelist = event.paramDescriptorForKeyword_(aeKeyword(keyDirectObject)) # noqa: F405
numberOfItems = filelist.numberOfItems()
for i in range(1, numberOfItems + 1):
fileAliasDesc = filelist.descriptorAtIndex_(i)
fileURLDesc = fileAliasDesc.coerceToDescriptorType_(aeKeyword(typeFileURL))
fileURLDesc = fileAliasDesc.coerceToDescriptorType_(aeKeyword(typeFileURL)) # noqa: F405
fileURLData = fileURLDesc.data()
url = memoryview(fileURLData.bytes(), 0, fileURLData.length())
url = str(url)
Expand All @@ -86,7 +86,7 @@ def openFileEvent_reply_(self, event, reply):

def subscribeEvent_reply_(self, event, reply):
""" handles a 'Subscribe to...' event"""
filelist = event.paramDescriptorForKeyword_(aeKeyword(keyDirectObject))
filelist = event.paramDescriptorForKeyword_(aeKeyword(keyDirectObject)) # noqa: F405
fileURLData = filelist.data()
url = memoryview(fileURLData.bytes(), 0, fileURLData.length())
url = str(url)
Expand Down

0 comments on commit b5e5840

Please sign in to comment.