(self)
| 313 | |
| 314 | |
| 315 | def getconfigfile(self): |
| 316 | if (os.name == "posix"): |
| 317 | # if!windows |
| 318 | # ~/.algorithmia/config |
| 319 | # create the api key file if it does not exist |
| 320 | keyPath = os.environ['HOME'] + "/.algorithmia/" |
| 321 | |
| 322 | elif (os.name == "nt"): |
| 323 | # ifwindows |
| 324 | # %LOCALAPPDATA%\Algorithmia\config |
| 325 | # create the api key file if it does not exist |
| 326 | keyPath = os.path.expandvars("%LOCALAPPDATA%\\Algorithmia\\") |
| 327 | |
| 328 | keyFile = "config" |
| 329 | |
| 330 | if (not os.path.exists(keyPath)): |
| 331 | os.mkdir(keyPath) |
| 332 | |
| 333 | if (not os.path.exists(keyPath + keyFile)): |
| 334 | with open(keyPath + keyFile, "w") as file: |
| 335 | file.write("[profiles]\n") |
| 336 | file.write("[profiles.default]\n") |
| 337 | file.write("api_key = ''\n") |
| 338 | file.write("api_server = ''\n") |
| 339 | file.write("ca_cert = ''\n") |
| 340 | file.write("bearer_token = ''\n") |
| 341 | |
| 342 | key = keyPath + keyFile |
| 343 | |
| 344 | return key |
| 345 | |
| 346 | def get_template(self, envid, dest, client): |
| 347 | response = client.get_template(envid, dest) |
no test coverage detected