File tree 4 files changed +34
-8
lines changed
4 files changed +34
-8
lines changed Original file line number Diff line number Diff line change @@ -25,12 +25,6 @@ Install [GUI](https://github.com/argosopentech/argos-translate-gui):
25
25
pip install argostranslategui
26
26
```
27
27
28
- ### Installation for macOS
29
-
30
- 1 . Download the latest [ macOS release.] ( https://github.com/argosopentech/argos-translate/releases/ )
31
- 2 . Extract the archive.
32
- 3 . Copy the ` .app ` file to the Applications directory.
33
-
34
28
### Python source installation into virtualenv
35
29
36
30
Download a copy of this repo and install with pip.
@@ -112,7 +106,6 @@ The GUI code is in a [separate repository](https://github.com/argosopentech/argo
112
106
113
107
![ Screenshot] ( /img/Screenshot.png )
114
108
![ Screenshot2] ( /img/Screenshot2.png )
115
- ![ Argos Translate macOS Screenshot] ( /img/ArgosTranslateMacOSScreenshot.png )
116
109
117
110
118
111
## [ Packages] ( https://www.argosopentech.com/argospm/index/ )
Original file line number Diff line number Diff line change @@ -413,8 +413,9 @@ def isolate_glossary(word, glossary):
413
413
414
414
415
415
if __name__ == "__main__" :
416
+
416
417
currentdir = os .path .dirname (
417
- os .path .abspath (inspect .getfile (inspect .currentframe ())) # type: ignore
418
+ os .path .abspath (inspect .getfile (inspect .currentframe ()))
418
419
)
419
420
newdir = os .path .join (currentdir , "subword_nmt" )
420
421
if os .path .isdir (newdir ):
Original file line number Diff line number Diff line change @@ -394,3 +394,27 @@ def uninstall(pkg):
394
394
with package_lock :
395
395
info ("Uninstalled package" , pkg )
396
396
shutil .rmtree (pkg .package_path )
397
+
398
+ def install_package_for_language_pair (from_code : str , to_code : str ) -> bool :
399
+ """Installs the necessary package to translate between a pair of languages
400
+ Args:
401
+ from_code (str): The ISO 639 code for the language being translated from
402
+ to_code (str): The ISO 639 code for the language being translated to
403
+ Returns:
404
+ True if the package was installed successfully,
405
+ False if the installation failed or was not possible
406
+ """
407
+ available_packages = get_available_packages ()
408
+ try :
409
+ package_to_install = next (
410
+ filter (
411
+ lambda x : x .from_code == from_code and x .to_code == to_code ,
412
+ available_packages ,
413
+ )
414
+ )
415
+ except StopIteration :
416
+ return False
417
+
418
+ install_from_path (package_to_install .download ())
419
+ return True
420
+
Original file line number Diff line number Diff line change 12
12
std_out_stream_handler = logging .StreamHandler (sys .stdout )
13
13
logger .addHandler (std_out_stream_handler )
14
14
15
+ # Python Logging Levels:
16
+ # https://docs.python.org/3/library/logging.html#levels
17
+
18
+
19
+ def debug (* argv ):
20
+ """Debug level log"""
21
+ logger .debug (str (argv ))
22
+
15
23
16
24
def get_json_string (argv ):
17
25
if len (argv ) == 1 :
You can’t perform that action at this time.
0 commit comments