18 |
18 |
19 from eric7 import Globals, Preferences |
19 from eric7 import Globals, Preferences |
20 from eric7.EricNetwork.EricNetworkProxyFactory import proxyAuthenticationRequired |
20 from eric7.EricNetwork.EricNetworkProxyFactory import proxyAuthenticationRequired |
21 from eric7.EricWidgets import EricMessageBox |
21 from eric7.EricWidgets import EricMessageBox |
22 from eric7.EricWidgets.EricApplication import ericApp |
22 from eric7.EricWidgets.EricApplication import ericApp |
|
23 from eric7.UI.DeleteFilesConfirmationDialog import DeleteFilesConfirmationDialog |
23 |
24 |
24 try: |
25 try: |
25 from eric7.EricNetwork.EricSslErrorHandler import EricSslErrorHandler |
26 from eric7.EricNetwork.EricSslErrorHandler import EricSslErrorHandler |
26 |
27 |
27 SSL_AVAILABLE = True |
28 SSL_AVAILABLE = True |
503 @return flag indicating a successful execution |
504 @return flag indicating a successful execution |
504 @rtype bool |
505 @rtype bool |
505 """ |
506 """ |
506 res = False |
507 res = False |
507 if packages and venvName: |
508 if packages and venvName: |
508 from eric7.UI.DeleteFilesConfirmationDialog import ( |
|
509 DeleteFilesConfirmationDialog, |
|
510 ) |
|
511 |
|
512 dlg = DeleteFilesConfirmationDialog( |
509 dlg = DeleteFilesConfirmationDialog( |
513 self.parent(), |
510 self.parent(), |
514 self.tr("Uninstall Packages"), |
511 self.tr("Uninstall Packages"), |
515 self.tr("Do you really want to uninstall these packages?"), |
512 self.tr("Do you really want to uninstall these packages?"), |
516 packages, |
513 packages, |
531 Public method to uninstall packages as given in a requirements file. |
528 Public method to uninstall packages as given in a requirements file. |
532 |
529 |
533 @param venvName name of the virtual environment to be used |
530 @param venvName name of the virtual environment to be used |
534 @type str |
531 @type str |
535 """ |
532 """ |
|
533 from .PipFileSelectionDialog import PipFileSelectionDialog |
|
534 |
536 if venvName: |
535 if venvName: |
537 from .PipFileSelectionDialog import PipFileSelectionDialog |
|
538 |
|
539 dlg = PipFileSelectionDialog(self, "requirements", install=False) |
536 dlg = PipFileSelectionDialog(self, "requirements", install=False) |
540 if dlg.exec() == QDialog.DialogCode.Accepted: |
537 if dlg.exec() == QDialog.DialogCode.Accepted: |
541 requirements, _user = dlg.getData() |
538 requirements, _user = dlg.getData() |
542 if requirements and os.path.exists(requirements): |
539 if requirements and os.path.exists(requirements): |
543 try: |
540 try: |
544 with open(requirements, "r") as f: |
541 with open(requirements, "r") as f: |
545 reqs = f.read().splitlines() |
542 reqs = f.read().splitlines() |
546 except OSError: |
543 except OSError: |
547 return |
544 return |
548 |
|
549 from eric7.UI.DeleteFilesConfirmationDialog import ( |
|
550 DeleteFilesConfirmationDialog, |
|
551 ) |
|
552 |
545 |
553 dlg = DeleteFilesConfirmationDialog( |
546 dlg = DeleteFilesConfirmationDialog( |
554 self.parent(), |
547 self.parent(), |
555 self.tr("Uninstall Packages"), |
548 self.tr("Uninstall Packages"), |
556 self.tr("Do you really want to uninstall these packages?"), |
549 self.tr("Do you really want to uninstall these packages?"), |