Przeglądaj źródła

♻️ refactor(translator): improve function naming consistency

- rename findSID to find_sid to align with snake_case naming convention
awwaawwa 1 rok temu
rodzic
commit
3e200493c8
1 zmienionych plików z 2 dodań i 2 usunięć
  1. 2 2
      pdf2zh/translator.py

+ 2 - 2
pdf2zh/translator.py

@@ -117,7 +117,7 @@ class BingTranslator(BaseTranslator):
             "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Edg/131.0.0.0",  # noqa: E501
         }
 
-    def findSID(self):
+    def find_sid(self):
         response = self.session.get(self.endpoint)
         response.raise_for_status()
         url = response.url[:-10]
@@ -130,7 +130,7 @@ class BingTranslator(BaseTranslator):
 
     def translate(self, text):
         text = text[:1000]  # bing translate max length
-        url, ig, iid, key, token = self.findSID()
+        url, ig, iid, key, token = self.find_sid()
         response = self.session.post(
             f"{url}ttranslatev3?IG={ig}&IID={iid}",
             data={