Sat, 16 Feb 2019 10:27:50 +0100
Created global tag <release-19.02.1>.
6011
e6af0dcfbb35
Added the pip interface plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1 | # -*- coding: utf-8 -*- |
e6af0dcfbb35
Added the pip interface plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
2 | |
6645
ad476851d7e0
Updated copyright for 2019.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6342
diff
changeset
|
3 | # Copyright (c) 2015 - 2019 Detlev Offenbach <detlev@die-offenbachs.de> |
6011
e6af0dcfbb35
Added the pip interface plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
4 | # |
e6af0dcfbb35
Added the pip interface plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
5 | |
e6af0dcfbb35
Added the pip interface plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
6 | """ |
6342
c79ecba9cde7
pip Interface: changed to use the new VirtualEnv Manager
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6253
diff
changeset
|
7 | Package implementing the pip configuration page. |
6011
e6af0dcfbb35
Added the pip interface plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
8 | """ |
e6af0dcfbb35
Added the pip interface plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
9 | |
e6af0dcfbb35
Added the pip interface plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
10 | from __future__ import unicode_literals |
e6af0dcfbb35
Added the pip interface plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
11 | |
e6af0dcfbb35
Added the pip interface plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
12 | from Preferences.ConfigurationPages.ConfigurationPageBase import \ |
e6af0dcfbb35
Added the pip interface plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
13 | ConfigurationPageBase |
e6af0dcfbb35
Added the pip interface plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
14 | from .Ui_PipPage import Ui_PipPage |
e6af0dcfbb35
Added the pip interface plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
15 | |
6253
a148632e9610
pip interface plugin: fixed issues with the pip interface after they moved the index to the new site (pypi.org).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6048
diff
changeset
|
16 | from .. import DefaultPyPiUrl |
6011
e6af0dcfbb35
Added the pip interface plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
17 | |
e6af0dcfbb35
Added the pip interface plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
18 | |
e6af0dcfbb35
Added the pip interface plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
19 | class PipPage(ConfigurationPageBase, Ui_PipPage): |
e6af0dcfbb35
Added the pip interface plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
20 | """ |
6342
c79ecba9cde7
pip Interface: changed to use the new VirtualEnv Manager
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6253
diff
changeset
|
21 | Class implementing the pip configuration page. |
6011
e6af0dcfbb35
Added the pip interface plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
22 | """ |
e6af0dcfbb35
Added the pip interface plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
23 | def __init__(self, plugin): |
e6af0dcfbb35
Added the pip interface plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
24 | """ |
e6af0dcfbb35
Added the pip interface plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
25 | Constructor |
e6af0dcfbb35
Added the pip interface plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
26 | |
e6af0dcfbb35
Added the pip interface plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
27 | @param plugin reference to the plugin object |
6342
c79ecba9cde7
pip Interface: changed to use the new VirtualEnv Manager
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6253
diff
changeset
|
28 | @type PipInterfacePlugin |
6011
e6af0dcfbb35
Added the pip interface plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
29 | """ |
e6af0dcfbb35
Added the pip interface plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
30 | super(PipPage, self).__init__() |
e6af0dcfbb35
Added the pip interface plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
31 | self.setupUi(self) |
e6af0dcfbb35
Added the pip interface plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
32 | self.setObjectName("PipPage") |
e6af0dcfbb35
Added the pip interface plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
33 | |
e6af0dcfbb35
Added the pip interface plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
34 | self.__plugin = plugin |
e6af0dcfbb35
Added the pip interface plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
35 | |
e6af0dcfbb35
Added the pip interface plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
36 | self.indexLabel.setText(self.tr( |
e6af0dcfbb35
Added the pip interface plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
37 | '<b>Note:</b> Leave empty to use the default index URL (' |
e6af0dcfbb35
Added the pip interface plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
38 | '<a href="{0}">{0}</a>).') |
6253
a148632e9610
pip interface plugin: fixed issues with the pip interface after they moved the index to the new site (pypi.org).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6048
diff
changeset
|
39 | .format(DefaultPyPiUrl)) |
6011
e6af0dcfbb35
Added the pip interface plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
40 | |
e6af0dcfbb35
Added the pip interface plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
41 | # set initial values |
e6af0dcfbb35
Added the pip interface plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
42 | self.indexEdit.setText(self.__plugin.getPreferences("PipSearchIndex")) |
e6af0dcfbb35
Added the pip interface plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
43 | |
e6af0dcfbb35
Added the pip interface plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
44 | def save(self): |
e6af0dcfbb35
Added the pip interface plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
45 | """ |
e6af0dcfbb35
Added the pip interface plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
46 | Public slot to save the pip configuration. |
e6af0dcfbb35
Added the pip interface plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
47 | """ |
e6af0dcfbb35
Added the pip interface plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
48 | self.__plugin.setPreferences( |
e6af0dcfbb35
Added the pip interface plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
49 | "PipSearchIndex", self.indexEdit.text().strip()) |