CondaInterface/Conda.py

branch
conda
changeset 6724
ca89c7d94c94
parent 6715
f1bf1985434e
child 6728
ba077788a882
equal deleted inserted replaced
6721:48c3ca1ac264 6724:ca89c7d94c94
607 ## special methods below 607 ## special methods below
608 ####################################################################### 608 #######################################################################
609 609
610 def updateConda(self): 610 def updateConda(self):
611 """ 611 """
612 Private method to update conda itself. 612 Public method to update conda itself.
613 """ 613 """
614 args = [ 614 args = [
615 "update", 615 "update",
616 "--json", 616 "--json",
617 "--yes", 617 "--yes",
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

eric ide

mercurial