622 dlg.start(args) |
622 dlg.start(args) |
623 dlg.exec_() |
623 dlg.exec_() |
624 ok, _ = dlg.getResult() |
624 ok, _ = dlg.getResult() |
625 |
625 |
626 return ok |
626 return ok |
|
627 |
|
628 def writeDefaultConfiguration(self): |
|
629 """ |
|
630 Public method to create a conda configuration with default values. |
|
631 """ |
|
632 args = [ |
|
633 "config", |
|
634 "--write-default", |
|
635 "--quiet" |
|
636 ] |
|
637 |
|
638 exe = Preferences.getConda("CondaExecutable") |
|
639 if not exe: |
|
640 exe = "conda" |
|
641 |
|
642 proc = QProcess() |
|
643 proc.start(exe, args) |
|
644 proc.waitForStarted(15000) |
|
645 proc.waitForFinished(30000) |
|
646 |
|
647 def getCondaInformation(self): |
|
648 """ |
|
649 Public method to get a dictionary containing information about conda. |
|
650 |
|
651 @return dictionary containing information about conda |
|
652 @rtype dict |
|
653 """ |
|
654 exe = Preferences.getConda("CondaExecutable") |
|
655 if not exe: |
|
656 exe = "conda" |
|
657 |
|
658 infoDict = {} |
|
659 |
|
660 proc = QProcess() |
|
661 proc.start(exe, ["info", "--json"]) |
|
662 if proc.waitForStarted(15000): |
|
663 if proc.waitForFinished(15000): |
|
664 output = str(proc.readAllStandardOutput(), |
|
665 Preferences.getSystem("IOEncoding"), |
|
666 'replace').strip() |
|
667 try: |
|
668 infoDict = json.loads(output) |
|
669 except Exception: |
|
670 infoDict = {} |
|
671 |
|
672 return infoDict |