Skip to content
Merged
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 glazier/chooser/chooser.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def _GuiFooter(self):
def _GuiHeader(self):
"""Creates all UI elements above the input fields."""
self.root.columnconfigure(0, weight=1)
self.root.overrideredirect(1) # pytype: disable=wrong-arg-types
self.root.overrideredirect(1) # pyrefly: ignore[no-matching-overload]
top = self.root.winfo_toplevel()
top.rowconfigure(0, weight=1)
top.columnconfigure(0, weight=1)
Expand Down
2 changes: 1 addition & 1 deletion glazier/chooser/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class Label(tk.Frame):

def __init__(self, root, text, font_name='Helvetica', font_size=16):
tk.Frame.__init__(self, root)
self.label = tk.Label(self, text=text, font=font_name, font_size=font_size) # pytype: disable=wrong-keyword-args
self.label = tk.Label(self, text=text, font=font_name, font_size=font_size) # pyrefly: ignore[unexpected-keyword]
self.label.grid(row=0, column=0, padx=20)


Expand Down
4 changes: 2 additions & 2 deletions glazier/lib/actions/powershell.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def Run(self):

logging.info('Interpreting PowerShell script: %s', script)
try:
script = cache.Cache().CacheFromLine(script, self._build_info) # pytype: disable=annotation-type-mismatch
script = cache.Cache().CacheFromLine(script, self._build_info) # pyrefly: ignore[bad-assignment]
except cache.Error as e:
raise ActionError() from e

Expand Down Expand Up @@ -140,7 +140,7 @@ def Run(self):
if command[0] and command[0].endswith('.ps1'):
logging.info('Interpreting PowerShell script: %s', command[0])
try:
command[0] = cache.Cache().CacheFromLine(command[0], self._build_info) # pytype: disable=container-type-mismatch
command[0] = cache.Cache().CacheFromLine(command[0], self._build_info) # pyrefly: ignore[unsupported-operation]
except cache.Error as e:
raise ActionError() from e

Expand Down
2 changes: 1 addition & 1 deletion glazier/lib/buildinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ def Release(self) -> Optional[str]:
except files.Error as e:
raise YamlFileError(rel_id_file) from e
if data and 'release_id' in data:
return data['release_id'] # pytype: disable=unsupported-operands # always-use-return-annotations
return data['release_id']
return None

def _ReleaseInfo(self):
Expand Down
2 changes: 1 addition & 1 deletion glazier/lib/config/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def _GetAction(self, action, params):
return act_obj(args=params, build_info=self._build_info)
except AttributeError as e:
msg = 'Unknown imaging action: %s' % str(action)
raise ConfigError(msg) from e # pytype: disable=wrong-arg-types
raise ConfigError(msg) from e

def _IsRealtimeAction(self, action, params):
"""Determine whether $action should happen in realtime."""
Expand Down
4 changes: 2 additions & 2 deletions glazier/lib/config/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,11 @@ def _Start(self, conf_path, conf_file):
'SetTimer': [timer_start]
}
})
controls = yaml_config['controls'] # pytype: disable=unsupported-operands # always-use-return-annotations
controls = yaml_config['controls']
try:
for control in controls:
if 'pin' not in control or self._MatchPin(control['pin']):
self._StoreControls(control, yaml_config.get('templates')) # pytype: disable=attribute-error # always-use-return-annotations
self._StoreControls(control, yaml_config.get('templates'))
finally:
# close out any timers before raising a server change
timer_stop = 'stop_{}_{}'.format(conf_path.rstrip('/'), conf_file)
Expand Down
4 changes: 2 additions & 2 deletions glazier/lib/config/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ def _ProcessTasks(self, tasks):
dl.CheckUrl(url, [200])

while tasks:
self._build_info.ActiveConfigPath(set_to=tasks[0]['path']) # pytype: disable=unsupported-operands # always-use-return-annotations
entry = tasks[0]['data'] # pytype: disable=unsupported-operands # always-use-return-annotations
self._build_info.ActiveConfigPath(set_to=tasks[0]['path'])
entry = tasks[0]['data']
for element in entry:
if element == 'policy':
for line in entry['policy']:
Expand Down
4 changes: 2 additions & 2 deletions glazier/lib/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -529,10 +529,10 @@ def PrintDebugInfo(self):
on_giveup=BackoffGiveupHandler)
def _GetFileStreamSize(self, file_stream: 'http.client.HTTPResponse'):
url = file_stream.geturl()
total_size = int(file_stream.headers.get('Content-Length').strip()) # pytype: disable=attribute-error # re-none
total_size = int(file_stream.headers.get('Content-Length').strip()) # pyrefly: ignore[missing-attribute]
return (url, total_size)

def _StreamToDisk(self, # pytype: disable=annotation-type-mismatch
def _StreamToDisk(self,
file_stream: 'http.client.HTTPResponse',
show_progress: bool = None): # pyrefly: ignore[bad-function-definition]
"""Save a file stream to disk.
Expand Down
14 changes: 7 additions & 7 deletions glazier/lib/os_selector.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def _OSCode(self):
UnsupportedModelError
"""
try:
os_code = self.config['os'][0][1][0] # pytype: disable=unsupported-operands # always-use-return-annotations
os_code = self.config['os'][0][1][0]
except IndexError as e:
raise UnsupportedModelError(self.model) from e
return os_code
Expand Down Expand Up @@ -94,8 +94,8 @@ def _ShowMenu(self):
choices = 'pe'
# OS Selection Menu
print('\nPlease select the Windows OS to install:')
for os in self.config['os']: # pytype: disable=unsupported-operands # always-use-return-annotations
num = self.config['os'].index(os) # pytype: disable=unsupported-operands # always-use-return-annotations
for os in self.config['os']:
num = self.config['os'].index(os)
printstring = self._PrintOSOption(os, num)
if printstring:
print(printstring)
Expand All @@ -105,10 +105,10 @@ def _ShowMenu(self):
def _TrimOSConfig(self):
"""Helper method to trim the OS selection menu."""
config = []
for os in self.config['os']: # pytype: disable=unsupported-operands # always-use-return-annotations
for os in self.config['os']:
if self._IsModelAllowed(os):
config += [os]
self.config['os'] = config # pytype: disable=unsupported-operands # always-use-return-annotations
self.config['os'] = config

def _PrintOSOption(self, os, num):
if not os[3]:
Expand Down Expand Up @@ -142,8 +142,8 @@ def _GetResponse(self):
_StartPs()
else:
answer_os = int(response) - 1
answer_track = self._TrackMenu(self.config['os'][answer_os]) # pytype: disable=unsupported-operands # always-use-return-annotations
return self.config['os'][answer_os][1][answer_track] # pytype: disable=unsupported-operands # always-use-return-annotations
answer_track = self._TrackMenu(self.config['os'][answer_os])
return self.config['os'][answer_os][1][answer_track] # pyrefly: ignore[unbound-name]

def _TrackMenu(self, os):
"""Display track selection menu."""
Expand Down
2 changes: 1 addition & 1 deletion glazier/lib/policies/device_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def _ModelSupportPrompt(self, message: str, this_model: str) -> bool:
return True
return False

def Verify(self) -> bool: # pytype: disable=signature-mismatch # overriding-return-type-checks
def Verify(self) -> bool:
model = self._build_info.ComputerModel()
logging.debug('Verifying hardware support tier for %s.', model)
tier = self._build_info.SupportTier()
Expand Down
Loading