Skip to content

Commit

Permalink
Fix low hanging lint issues (#20)
Browse files Browse the repository at this point in the history
Co-authored-by: Zion Leonahenahe Basque <zion@zionbasque.com>
  • Loading branch information
twizmwazin and mahaloz authored Nov 19, 2023
1 parent b2ff6e0 commit a7708e1
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 15 deletions.
3 changes: 1 addition & 2 deletions dailalib/binsync_plugin/ai_bs_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@
import shutil
from pathlib import Path
import tempfile
from typing import Union, Dict
from typing import Dict
import math
import threading

from binsync.api import load_decompiler_controller, BSController
from binsync.decompilers import ANGR_DECOMPILER
from binsync.data.state import State
from binsync.data import (
Function, Comment, StackVariable
Expand Down
9 changes: 1 addition & 8 deletions dailalib/binsync_plugin/ai_user_config_ui.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import os
from pathlib import Path
import logging
from threading import Thread

from binsync.ui.qt_objects import (
QComboBox,
Expand All @@ -12,17 +11,11 @@
QHBoxLayout,
QLabel,
QLineEdit,
QMessageBox,
QPushButton,
QVBoxLayout,
QTableWidget,
QTableWidgetItem,
QHeaderView
QVBoxLayout
)
from binsync.ui.utils import QProgressBarDialog
from . import AIBSUser, add_ai_user_to_project
from binsync.api.controller import BSController
from binsync.decompilers import ANGR_DECOMPILER, IDA_DECOMPILER

_l = logging.getLogger(__name__)
AUTO_DECOMPILER = "automatic"
Expand Down
2 changes: 1 addition & 1 deletion dailalib/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class DAILAInstaller(Installer):
def __init__(self):
super().__init__(targets=("ida", "ghidra", "binja"))
self.plugins_path = Path(
pkg_resources.resource_filename("dailalib", f"plugins")
pkg_resources.resource_filename("dailalib", "plugins")
)

def display_prologue(self):
Expand Down
5 changes: 5 additions & 0 deletions dailalib/interfaces/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
from .generic_ai_interface import GenericAIInterface
from .openai_interface import OpenAIInterface

__all__ = [
"GenericAIInterface",
"OpenAIInterface",
]
2 changes: 1 addition & 1 deletion dailalib/interfaces/generic_ai_interface.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Dict, Optional
from typing import Optional

from binsync.api import load_decompiler_controller, BSController

Expand Down
3 changes: 1 addition & 2 deletions dailalib/interfaces/openai_interface.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import re
from typing import Optional, Dict
import os
import textwrap
import json
from functools import wraps

Expand Down Expand Up @@ -201,7 +200,7 @@ def query_for_cmd(self, cmd, func_addr=None, decompilation=None, edit_dec=False,

kwargs.update(self.AI_COMMANDS[cmd])
if func_addr is None and decompilation is None:
raise Exception(f"You must provide either a function address or decompilation!")
raise Exception("You must provide either a function address or decompilation!")

prompt = self.PROMPTS[cmd]
if decompilation is not None:
Expand Down
2 changes: 1 addition & 1 deletion plugins/daila_ida.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def __init__(self):
def _decompile(self, func_addr: int, **kwargs):
try:
cfunc = ida_hexrays.decompile(func_addr)
except Exception as e:
except Exception:
return None

return str(cfunc)
Expand Down

0 comments on commit a7708e1

Please sign in to comment.