| 9 | |
| 10 | |
| 11 | class gibMacOS: |
| 12 | def __init__(self, interactive = True, download_dir = None): |
| 13 | self.interactive = interactive |
| 14 | self.download_dir = download_dir |
| 15 | self.d = downloader.Downloader() |
| 16 | self.u = utils.Utils("gibMacOS", interactive=interactive) |
| 17 | self.r = run.Run() |
| 18 | self.min_w = 80 |
| 19 | self.min_h = 24 |
| 20 | if os.name == "nt": |
| 21 | self.min_w = 120 |
| 22 | self.min_h = 30 |
| 23 | self.resize() |
| 24 | |
| 25 | self.catalog_suffix = { |
| 26 | "public" : "beta", |
| 27 | "publicrelease" : "", |
| 28 | "customer" : "customerseed", |
| 29 | "developer" : "seed" |
| 30 | } |
| 31 | |
| 32 | # Load settings.json if it exists in the Scripts folder |
| 33 | self.settings_path = os.path.join(os.path.dirname(os.path.realpath(__file__)),"Scripts","settings.json") |
| 34 | self.settings = {} |
| 35 | if os.path.exists(self.settings_path): |
| 36 | try: self.settings = json.load(open(self.settings_path)) |
| 37 | except: pass |
| 38 | |
| 39 | # Load prod_cache.json if it exists in the Scripts folder |
| 40 | self.prod_cache_path = os.path.join(os.path.dirname(os.path.realpath(__file__)),"Scripts","prod_cache.plist") |
| 41 | self.prod_cache = {} |
| 42 | if os.path.exists(self.prod_cache_path): |
| 43 | try: |
| 44 | with open(self.prod_cache_path,"rb") as f: |
| 45 | self.prod_cache = plist.load(f) |
| 46 | assert isinstance(self.prod_cache,dict) |
| 47 | except: |
| 48 | self.prod_cache = {} |
| 49 | |
| 50 | # If > 16, assume X-5, else 10.X |
| 51 | # e.g. 17 = Monterey, 18 = Ventura, 19 = Sonoma, 20 = Sequoia |
| 52 | self.current_macos = self.settings.get("current_macos",20) |
| 53 | self.min_macos = 5 |
| 54 | self.print_urls = self.settings.get("print_urls",False) |
| 55 | self.print_json = False |
| 56 | self.hide_pid = self.settings.get("hide_pid",False) |
| 57 | self.mac_os_names_url = { |
| 58 | "8" : "mountainlion", |
| 59 | "7" : "lion", |
| 60 | "6" : "snowleopard", |
| 61 | "5" : "leopard" |
| 62 | } |
| 63 | self.version_names = { |
| 64 | "tiger" : "10.4", |
| 65 | "leopard" : "10.5", |
| 66 | "snow leopard" : "10.6", |
| 67 | "lion" : "10.7", |
| 68 | "mountain lion" : "10.8", |