diff --git a/watcher_dashboard/api/watcher.py b/watcher_dashboard/api/watcher.py index 2418b6e..0fb4cdd 100644 --- a/watcher_dashboard/api/watcher.py +++ b/watcher_dashboard/api/watcher.py @@ -13,7 +13,7 @@ import logging from django.conf import settings -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from openstack_dashboard.api import base from watcherclient import client as wc diff --git a/watcher_dashboard/content/action_plans/panel.py b/watcher_dashboard/content/action_plans/panel.py index 5137675..b7e858e 100644 --- a/watcher_dashboard/content/action_plans/panel.py +++ b/watcher_dashboard/content/action_plans/panel.py @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ import horizon diff --git a/watcher_dashboard/content/action_plans/tables.py b/watcher_dashboard/content/action_plans/tables.py index 36d240e..80a34ff 100644 --- a/watcher_dashboard/content/action_plans/tables.py +++ b/watcher_dashboard/content/action_plans/tables.py @@ -17,9 +17,9 @@ import logging from django.template.defaultfilters import title # noqa from django import urls +from django.utils.translation import gettext_lazy as _ +from django.utils.translation import ngettext_lazy from django.utils.translation import pgettext_lazy -from django.utils.translation import ugettext_lazy as _ -from django.utils.translation import ungettext_lazy import horizon.exceptions import horizon.messages import horizon.tables @@ -55,7 +55,7 @@ class ArchiveActionPlan(horizon.tables.DeleteAction): @staticmethod def action_present(count): - return ungettext_lazy( + return ngettext_lazy( u"Archive Action Plan", u"Archive Action Plans", count @@ -63,7 +63,7 @@ class ArchiveActionPlan(horizon.tables.DeleteAction): @staticmethod def action_past(count): - return ungettext_lazy( + return ngettext_lazy( u"Action Plan archived", u"Action Plans archived", count @@ -81,7 +81,7 @@ class StartActionPlan(horizon.tables.BatchAction): @staticmethod def action_present(count): - return ungettext_lazy( + return ngettext_lazy( u"Start Action Plan", u"Start Action Plans", count @@ -89,7 +89,7 @@ class StartActionPlan(horizon.tables.BatchAction): @staticmethod def action_past(count): - return ungettext_lazy( + return ngettext_lazy( u"Action Plan started", u"Action Plans started", count diff --git a/watcher_dashboard/content/action_plans/tabs.py b/watcher_dashboard/content/action_plans/tabs.py index 868654c..2654bde 100644 --- a/watcher_dashboard/content/action_plans/tabs.py +++ b/watcher_dashboard/content/action_plans/tabs.py @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from horizon import tabs diff --git a/watcher_dashboard/content/action_plans/urls.py b/watcher_dashboard/content/action_plans/urls.py index 680525f..2183c35 100644 --- a/watcher_dashboard/content/action_plans/urls.py +++ b/watcher_dashboard/content/action_plans/urls.py @@ -13,16 +13,16 @@ # See the License for the specific language governing permissions and # limitations under the License. -from django.conf import urls +from django.urls import re_path from watcher_dashboard.content.action_plans import views urlpatterns = [ - urls.url(r'^$', - views.IndexView.as_view(), name='index'), - urls.url(r'^(?P[^/]+)/detail$', - views.DetailView.as_view(), name='detail'), - urls.url(r'^archive/$', - views.ArchiveView.as_view(), name='archive'), + re_path(r'^$', + views.IndexView.as_view(), name='index'), + re_path(r'^(?P[^/]+)/detail$', + views.DetailView.as_view(), name='detail'), + re_path(r'^archive/$', + views.ArchiveView.as_view(), name='archive'), ] diff --git a/watcher_dashboard/content/action_plans/views.py b/watcher_dashboard/content/action_plans/views.py index b97804b..3217cd4 100644 --- a/watcher_dashboard/content/action_plans/views.py +++ b/watcher_dashboard/content/action_plans/views.py @@ -15,7 +15,7 @@ import logging -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ import horizon.exceptions from horizon import forms import horizon.tables diff --git a/watcher_dashboard/content/actions/panel.py b/watcher_dashboard/content/actions/panel.py index 9c4c971..d882664 100644 --- a/watcher_dashboard/content/actions/panel.py +++ b/watcher_dashboard/content/actions/panel.py @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ import horizon diff --git a/watcher_dashboard/content/actions/tables.py b/watcher_dashboard/content/actions/tables.py index 88b1418..d8be9e7 100644 --- a/watcher_dashboard/content/actions/tables.py +++ b/watcher_dashboard/content/actions/tables.py @@ -17,8 +17,8 @@ import logging from django.template.defaultfilters import title # noqa from django import urls +from django.utils.translation import gettext_lazy as _ from django.utils.translation import pgettext_lazy -from django.utils.translation import ugettext_lazy as _ import horizon.exceptions import horizon.messages import horizon.tables diff --git a/watcher_dashboard/content/actions/tabs.py b/watcher_dashboard/content/actions/tabs.py index 2ccae68..791f945 100644 --- a/watcher_dashboard/content/actions/tabs.py +++ b/watcher_dashboard/content/actions/tabs.py @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from horizon import tabs diff --git a/watcher_dashboard/content/actions/urls.py b/watcher_dashboard/content/actions/urls.py index d6aab04..e441dcb 100644 --- a/watcher_dashboard/content/actions/urls.py +++ b/watcher_dashboard/content/actions/urls.py @@ -13,14 +13,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -from django.conf import urls +from django.urls import re_path from watcher_dashboard.content.actions import views urlpatterns = [ - urls.url(r'^$', - views.IndexView.as_view(), name='index'), - urls.url(r'^(?P[^/]+)/detail$', - views.DetailView.as_view(), name='detail'), + re_path(r'^$', + views.IndexView.as_view(), name='index'), + re_path(r'^(?P[^/]+)/detail$', + views.DetailView.as_view(), name='detail'), ] diff --git a/watcher_dashboard/content/actions/views.py b/watcher_dashboard/content/actions/views.py index d2e19ce..09f73b7 100644 --- a/watcher_dashboard/content/actions/views.py +++ b/watcher_dashboard/content/actions/views.py @@ -15,7 +15,7 @@ import collections -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ import horizon.exceptions import horizon.tables import horizon.tabs diff --git a/watcher_dashboard/content/audit_templates/forms.py b/watcher_dashboard/content/audit_templates/forms.py index 55fa36d..ad61d03 100644 --- a/watcher_dashboard/content/audit_templates/forms.py +++ b/watcher_dashboard/content/audit_templates/forms.py @@ -20,7 +20,7 @@ import logging from django.core import exceptions as core_exc from django.urls import reverse -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from horizon import exceptions from horizon import forms from horizon import messages diff --git a/watcher_dashboard/content/audit_templates/panel.py b/watcher_dashboard/content/audit_templates/panel.py index f67cf81..fc98d1d 100644 --- a/watcher_dashboard/content/audit_templates/panel.py +++ b/watcher_dashboard/content/audit_templates/panel.py @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ import horizon diff --git a/watcher_dashboard/content/audit_templates/tables.py b/watcher_dashboard/content/audit_templates/tables.py index 526eacc..77ef535 100644 --- a/watcher_dashboard/content/audit_templates/tables.py +++ b/watcher_dashboard/content/audit_templates/tables.py @@ -13,8 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from django.utils.translation import ugettext_lazy as _ -from django.utils.translation import ungettext_lazy +from django.utils.translation import gettext_lazy as _ +from django.utils.translation import ngettext_lazy import horizon.exceptions import horizon.messages import horizon.tables @@ -49,7 +49,7 @@ class LaunchAudit(horizon.tables.BatchAction): @staticmethod def action_present(count): - return ungettext_lazy( + return ngettext_lazy( "Launch Audit", "Launch Audits", count @@ -57,7 +57,7 @@ class LaunchAudit(horizon.tables.BatchAction): @staticmethod def action_past(count): - return ungettext_lazy( + return ngettext_lazy( "Launched Audit", "Launched Audits", count @@ -76,7 +76,7 @@ class ArchiveAuditTemplates(horizon.tables.DeleteAction): @staticmethod def action_present(count): - return ungettext_lazy( + return ngettext_lazy( "Archive Template", "Archive Templates", count @@ -84,7 +84,7 @@ class ArchiveAuditTemplates(horizon.tables.DeleteAction): @staticmethod def action_past(count): - return ungettext_lazy( + return ngettext_lazy( "Archived Template", "Archived Templates", count diff --git a/watcher_dashboard/content/audit_templates/tabs.py b/watcher_dashboard/content/audit_templates/tabs.py index 20fad34..dd440f8 100644 --- a/watcher_dashboard/content/audit_templates/tabs.py +++ b/watcher_dashboard/content/audit_templates/tabs.py @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from horizon import tabs diff --git a/watcher_dashboard/content/audit_templates/urls.py b/watcher_dashboard/content/audit_templates/urls.py index 23fdd67..84a4497 100644 --- a/watcher_dashboard/content/audit_templates/urls.py +++ b/watcher_dashboard/content/audit_templates/urls.py @@ -13,15 +13,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -from django.conf import urls +from django.urls import re_path from watcher_dashboard.content.audit_templates import views urlpatterns = [ - urls.url(r'^$', views.IndexView.as_view(), name='index'), - urls.url(r'^create/$', views.CreateView.as_view(), name='create'), - urls.url(r'^(?P[^/]+)/detail$', - views.DetailView.as_view(), - name='detail'), + re_path(r'^$', views.IndexView.as_view(), name='index'), + re_path(r'^create/$', views.CreateView.as_view(), name='create'), + re_path(r'^(?P[^/]+)/detail$', + views.DetailView.as_view(), + name='detail'), ] diff --git a/watcher_dashboard/content/audit_templates/views.py b/watcher_dashboard/content/audit_templates/views.py index 249882f..aeb129f 100644 --- a/watcher_dashboard/content/audit_templates/views.py +++ b/watcher_dashboard/content/audit_templates/views.py @@ -17,7 +17,7 @@ import json import logging from django.urls import reverse_lazy -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ import horizon.exceptions from horizon import forms import horizon.tables diff --git a/watcher_dashboard/content/audits/forms.py b/watcher_dashboard/content/audits/forms.py index 449ffbb..f25fe5f 100644 --- a/watcher_dashboard/content/audits/forms.py +++ b/watcher_dashboard/content/audits/forms.py @@ -19,7 +19,7 @@ Forms for starting Watcher Audits. import logging from django.urls import reverse -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from horizon import exceptions from horizon import forms diff --git a/watcher_dashboard/content/audits/panel.py b/watcher_dashboard/content/audits/panel.py index 2a6523f..94c3bfa 100644 --- a/watcher_dashboard/content/audits/panel.py +++ b/watcher_dashboard/content/audits/panel.py @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ import horizon diff --git a/watcher_dashboard/content/audits/tables.py b/watcher_dashboard/content/audits/tables.py index a31e0cd..d3d2b25 100644 --- a/watcher_dashboard/content/audits/tables.py +++ b/watcher_dashboard/content/audits/tables.py @@ -16,9 +16,9 @@ from django import shortcuts from django.template.defaultfilters import title # noqa from django import urls +from django.utils.translation import gettext_lazy as _ +from django.utils.translation import ngettext_lazy from django.utils.translation import pgettext_lazy -from django.utils.translation import ugettext_lazy as _ -from django.utils.translation import ungettext_lazy import horizon.exceptions import horizon.messages import horizon.tables @@ -88,7 +88,7 @@ class ArchiveAudits(horizon.tables.DeleteAction): @staticmethod def action_present(count): - return ungettext_lazy( + return ngettext_lazy( "Archive Audit", "Archive Audits", count @@ -96,7 +96,7 @@ class ArchiveAudits(horizon.tables.DeleteAction): @staticmethod def action_past(count): - return ungettext_lazy( + return ngettext_lazy( "Archived Audit", "Archived Audits", count diff --git a/watcher_dashboard/content/audits/tabs.py b/watcher_dashboard/content/audits/tabs.py index 023fa80..7a1f1a4 100644 --- a/watcher_dashboard/content/audits/tabs.py +++ b/watcher_dashboard/content/audits/tabs.py @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from horizon import tabs diff --git a/watcher_dashboard/content/audits/urls.py b/watcher_dashboard/content/audits/urls.py index e857cc5..ea85b3e 100644 --- a/watcher_dashboard/content/audits/urls.py +++ b/watcher_dashboard/content/audits/urls.py @@ -13,16 +13,16 @@ # See the License for the specific language governing permissions and # limitations under the License. -from django.conf import urls +from django.urls import re_path from watcher_dashboard.content.audits import views urlpatterns = [ - urls.url(r'^$', - views.IndexView.as_view(), name='index'), - urls.url(r'^create/$', - views.CreateView.as_view(), name='create'), - urls.url(r'^(?P[^/]+)/detail$', - views.DetailView.as_view(), name='detail'), + re_path(r'^$', + views.IndexView.as_view(), name='index'), + re_path(r'^create/$', + views.CreateView.as_view(), name='create'), + re_path(r'^(?P[^/]+)/detail$', + views.DetailView.as_view(), name='detail'), ] diff --git a/watcher_dashboard/content/audits/views.py b/watcher_dashboard/content/audits/views.py index 69ca509..b2873da 100644 --- a/watcher_dashboard/content/audits/views.py +++ b/watcher_dashboard/content/audits/views.py @@ -17,7 +17,7 @@ import logging from django.urls import reverse from django.urls import reverse_lazy -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ import horizon.exceptions from horizon import forms import horizon.tables diff --git a/watcher_dashboard/content/goals/panel.py b/watcher_dashboard/content/goals/panel.py index 6a304c4..2bf8c72 100644 --- a/watcher_dashboard/content/goals/panel.py +++ b/watcher_dashboard/content/goals/panel.py @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ import horizon diff --git a/watcher_dashboard/content/goals/tables.py b/watcher_dashboard/content/goals/tables.py index 4c5c815..6d61458 100644 --- a/watcher_dashboard/content/goals/tables.py +++ b/watcher_dashboard/content/goals/tables.py @@ -14,7 +14,7 @@ # limitations under the License. from django.template.defaultfilters import title # noqa -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ import horizon.exceptions import horizon.messages import horizon.tables diff --git a/watcher_dashboard/content/goals/tabs.py b/watcher_dashboard/content/goals/tabs.py index ea344f4..0464f4f 100644 --- a/watcher_dashboard/content/goals/tabs.py +++ b/watcher_dashboard/content/goals/tabs.py @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from horizon import tabs diff --git a/watcher_dashboard/content/goals/urls.py b/watcher_dashboard/content/goals/urls.py index 67b657f..915b1d1 100644 --- a/watcher_dashboard/content/goals/urls.py +++ b/watcher_dashboard/content/goals/urls.py @@ -13,14 +13,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -from django.conf import urls +from django.urls import re_path from watcher_dashboard.content.goals import views urlpatterns = [ - urls.url(r'^$', - views.IndexView.as_view(), name='index'), - urls.url(r'^(?P[^/]+)/detail$', - views.DetailView.as_view(), name='detail'), + re_path(r'^$', + views.IndexView.as_view(), name='index'), + re_path(r'^(?P[^/]+)/detail$', + views.DetailView.as_view(), name='detail'), ] diff --git a/watcher_dashboard/content/goals/views.py b/watcher_dashboard/content/goals/views.py index 78d0363..bda02d2 100644 --- a/watcher_dashboard/content/goals/views.py +++ b/watcher_dashboard/content/goals/views.py @@ -15,7 +15,7 @@ import logging -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ import horizon.exceptions import horizon.tables import horizon.tabs diff --git a/watcher_dashboard/content/strategies/panel.py b/watcher_dashboard/content/strategies/panel.py index 88585df..01c2fa0 100644 --- a/watcher_dashboard/content/strategies/panel.py +++ b/watcher_dashboard/content/strategies/panel.py @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ import horizon diff --git a/watcher_dashboard/content/strategies/tables.py b/watcher_dashboard/content/strategies/tables.py index d4228a5..07db783 100644 --- a/watcher_dashboard/content/strategies/tables.py +++ b/watcher_dashboard/content/strategies/tables.py @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ import horizon.exceptions import horizon.messages import horizon.tables diff --git a/watcher_dashboard/content/strategies/tabs.py b/watcher_dashboard/content/strategies/tabs.py index e75bccd..0f95764 100644 --- a/watcher_dashboard/content/strategies/tabs.py +++ b/watcher_dashboard/content/strategies/tabs.py @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from horizon import tabs diff --git a/watcher_dashboard/content/strategies/urls.py b/watcher_dashboard/content/strategies/urls.py index cbf4632..7d0bfb1 100644 --- a/watcher_dashboard/content/strategies/urls.py +++ b/watcher_dashboard/content/strategies/urls.py @@ -13,14 +13,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -from django.conf import urls +from django.urls import re_path from watcher_dashboard.content.strategies import views urlpatterns = [ - urls.url(r'^$', - views.IndexView.as_view(), name='index'), - urls.url(r'^(?P[^/]+)/detail$', - views.DetailView.as_view(), name='detail'), + re_path(r'^$', + views.IndexView.as_view(), name='index'), + re_path(r'^(?P[^/]+)/detail$', + views.DetailView.as_view(), name='detail'), ] diff --git a/watcher_dashboard/content/strategies/views.py b/watcher_dashboard/content/strategies/views.py index 33b895c..0a83ce0 100644 --- a/watcher_dashboard/content/strategies/views.py +++ b/watcher_dashboard/content/strategies/views.py @@ -15,7 +15,7 @@ import logging -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ import horizon.exceptions import horizon.tables import horizon.tabs diff --git a/watcher_dashboard/local/enabled/_31020_watcher_panelgroup.py b/watcher_dashboard/local/enabled/_31020_watcher_panelgroup.py index dccad6e..cd0d98b 100644 --- a/watcher_dashboard/local/enabled/_31020_watcher_panelgroup.py +++ b/watcher_dashboard/local/enabled/_31020_watcher_panelgroup.py @@ -10,7 +10,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ # The slug of the panel group to be added to HORIZON_CONFIG. Required. PANEL_GROUP = 'watcher' diff --git a/watcher_dashboard/test/urls.py b/watcher_dashboard/test/urls.py index cf28475..82acd92 100644 --- a/watcher_dashboard/test/urls.py +++ b/watcher_dashboard/test/urls.py @@ -12,8 +12,9 @@ # under the License. from django.conf import urls +from django.urls import re_path import openstack_dashboard.urls urlpatterns = [ - urls.url(r'', urls.include(openstack_dashboard.urls)) + re_path(r'', urls.include(openstack_dashboard.urls)) ]