269 args = PipListDialog.CommandArguments[self.__mode][:] |
268 args = PipListDialog.CommandArguments[self.__mode][:] |
270 if self.localCheckBox.isChecked(): |
269 if self.localCheckBox.isChecked(): |
271 args.append("--local") |
270 args.append("--local") |
272 if self.notRequiredCheckBox.isChecked(): |
271 if self.notRequiredCheckBox.isChecked(): |
273 args.append("--not-required") |
272 args.append("--not-required") |
|
273 if self.userCheckBox.isChecked(): |
|
274 args.append("--user") |
274 |
275 |
275 if self.__indexUrl: |
276 if self.__indexUrl: |
276 args.append("--index-url") |
277 args.append("--index-url") |
277 args.append(self.__indexUrl + "/simple") |
278 args.append(self.__indexUrl + "/simple") |
278 |
279 |
348 @pyqtSlot(bool) |
349 @pyqtSlot(bool) |
349 def on_localCheckBox_clicked(self, checked): |
350 def on_localCheckBox_clicked(self, checked): |
350 """ |
351 """ |
351 Private slot handling the switching of the local mode. |
352 Private slot handling the switching of the local mode. |
352 |
353 |
353 @param checked state of the local check box (boolean) |
354 @param checked state of the local check box |
|
355 @type bool |
354 """ |
356 """ |
355 self.__refresh() |
357 self.__refresh() |
356 |
358 |
357 @pyqtSlot(bool) |
359 @pyqtSlot(bool) |
358 def on_notRequiredCheckBox_clicked(self, checked): |
360 def on_notRequiredCheckBox_clicked(self, checked): |
359 """ |
361 """ |
360 Private slot handling the switching of the 'not required' mode. |
362 Private slot handling the switching of the 'not required' mode. |
361 |
363 |
362 @param checked state of the 'not required' check box (boolean) |
364 @param checked state of the 'not required' check box |
|
365 @type bool |
|
366 """ |
|
367 self.__refresh() |
|
368 |
|
369 @pyqtSlot(bool) |
|
370 def on_userCheckBox_clicked(self, checked): |
|
371 """ |
|
372 Private slot handling the switching of the 'user-site' mode. |
|
373 |
|
374 @param checked state of the 'user-site' check box |
|
375 @type bool |
363 """ |
376 """ |
364 self.__refresh() |
377 self.__refresh() |
365 |
378 |
366 @pyqtSlot() |
379 @pyqtSlot() |
367 def on_packageList_itemSelectionChanged(self): |
380 def on_packageList_itemSelectionChanged(self): |
484 if "pip" in packages: |
495 if "pip" in packages: |
485 self.__upgradePip() |
496 self.__upgradePip() |
486 else: |
497 else: |
487 self.__executeUpgradePackages(packages) |
498 self.__executeUpgradePackages(packages) |
488 |
499 |
489 # TODO: add support for --user |
|
490 def __upgradePip(self): |
500 def __upgradePip(self): |
491 """ |
501 """ |
492 Private slot to upgrade pip itself. |
502 Private slot to upgrade pip itself. |
493 """ |
503 """ |
494 pip = self.pipComboBox.currentText() |
504 pip = self.pipComboBox.currentText() |
495 if pip == self.__default: |
505 if pip == self.__default: |
496 pip = "" |
506 pip = "" |
497 |
507 |
498 res = self.__pip.upgradePip(pip=pip) |
508 res = self.__pip.upgradePip( |
|
509 pip=pip, userSite=self.userCheckBox.isChecked()) |
499 if res: |
510 if res: |
500 self.__refresh() |
511 self.__refresh() |
501 |
512 |
502 # TODO: add support for --user |
|
503 def __executeUpgradePackages(self, packages): |
513 def __executeUpgradePackages(self, packages): |
504 """ |
514 """ |
505 Private method to execute the pip upgrade command. |
515 Private method to execute the pip upgrade command. |
506 |
516 |
507 @param packages list of package names to be upgraded |
517 @param packages list of package names to be upgraded |
509 """ |
519 """ |
510 command = self.pipComboBox.currentText() |
520 command = self.pipComboBox.currentText() |
511 if command == self.__default: |
521 if command == self.__default: |
512 command = "" |
522 command = "" |
513 |
523 |
514 res = self.__pip.upgradePackages(packages, cmd=command) |
524 res = self.__pip.upgradePackages( |
|
525 packages, cmd=command, userSite=self.userCheckBox.isChecked()) |
515 if res: |
526 if res: |
516 self.__refresh() |
527 self.__refresh() |
517 |
528 |
518 def __uninstallPackages(self): |
529 def __uninstallPackages(self): |
519 """ |
530 """ |