ProjectDjangoTagsMenu/FindTemplateTagDialog.py

branch
eric7
changeset 63
85418cf03fdb
parent 60
85d3931419d3
child 67
807714618a59
diff -r dba433b4f3d6 -r 85418cf03fdb ProjectDjangoTagsMenu/FindTemplateTagDialog.py
--- a/ProjectDjangoTagsMenu/FindTemplateTagDialog.py	Thu Dec 30 12:03:18 2021 +0100
+++ b/ProjectDjangoTagsMenu/FindTemplateTagDialog.py	Wed Sep 21 16:38:40 2022 +0200
@@ -16,94 +16,191 @@
 class FindTemplateTagDialog(QDialog, Ui_FindTemplateTagDialog):
     """
     Class implementing a dialog to search foe template tags.
-    
+
     @signal tag(str) emitted to indicate to generate template text for the
         given tag name
     """
+
     tag = pyqtSignal(str)
-    
+
     def __init__(self, parent=None):
         """
         Constructor
-        
+
         @param parent reference to the parent widget
         @type QWidget
         """
         super().__init__(parent)
         self.setupUi(self)
-        
-        self.__completer = QCompleter((
-            # template tags
-            'autoescape', 'block', 'comment', 'csrf_token', 'cycle', 'debug',
-            'extendsvariable', 'extendsfile', 'filter', 'firstof', 'for',
-            'for...empty', 'if', 'ifchanged', 'ifequal', 'ifnotequal',
-            'includevariable', 'includefile', 'load', 'now', 'regroup',
-            'spaceless', 'ssi', 'ssifile', 'templatetag', 'url', 'urlas',
-            'verbatim', 'widthratio', 'with',
-            
-            # template filters
-            'add', 'addslashes', 'capfirst', 'center', 'cut', 'date',
-            'default', 'default_if_none', 'dictsort', 'dictsortreversed',
-            'divisibleby', 'escape', 'escapejs', 'filesizeformat', 'first',
-            'fix_ampersands', 'floatformat', 'force_escape', 'get_digit',
-            'iriencode', 'join', 'last', 'lenght', 'lenght_is', 'linebreaks',
-            'linebreaksbr', 'linenumbers', 'ljust', 'lower', 'make_list',
-            'phone2numeric', 'pluralize', 'pprint', 'random', 'removetags',
-            'rjust', 'safe', 'safeseq', 'slice', 'slugify', 'stringformat',
-            'striptags', 'time', 'timesince', 'timeuntil', 'title',
-            'truncatechars', 'truncatewords', 'truncatewords_html',
-            'unordered_list', 'upper', 'urlencode', 'urlize', 'urlizetrunc',
-            'wordcount', 'wordwrap', 'yesno',
-            
-            # humanize tags
-            'loadhumanize', 'apnumber', 'intcomma', 'intword', 'naturalday',
-            'naturaltime', 'ordinal',
-            
-            # web design tags
-            'loadweb', 'lorem',
-            
-            # static tags
-            'loadstatic', 'staticfile', 'staticvariable', 'get_static_prefix',
-            'get_media_prefix',
-            
-            # comments
-            'singlelinecommentselect', 'multilinecommentselect',
-            'singlelinecommentdialog', 'multilinecommentdialog',
-            'singlelinecommentclipboard', 'multilinecommentclipboard',
-            'multilinecommentfile', 'singlelinecommentdatetime',
-            'htmlcomment', 'iecomment',
-            
-            # internationalisation
-            'loadi18n', 'trans', 'trans..as', 'blocktrans', 'blocktrans..with',
-            'plural', 'language', 'get_current_language',
-            'get_available_languages', 'get_current_language_bidi',
-            'get_language_info', 'get_language_info_list', 'language_name',
-            'language_name_local', 'bidi',
-            
-            # localization
-            'loadl10n', 'localize_on', 'localize_off', 'localize',
-            'unlocalize',
-            
-            # timezone
-            'loadtz', 'localtime_on', 'localtime_off', 'timezone_set',
-            'timezone_unset', 'get_current_timezone', 'localtime', 'utc',
-            'timezone',
-        ), self)
-        self.__completer.setCompletionMode(
-            QCompleter.CompletionMode.PopupCompletion)
+
+        self.__completer = QCompleter(
+            (
+                # template tags
+                "autoescape",
+                "block",
+                "comment",
+                "csrf_token",
+                "cycle",
+                "debug",
+                "extendsvariable",
+                "extendsfile",
+                "filter",
+                "firstof",
+                "for",
+                "for...empty",
+                "if",
+                "ifchanged",
+                "ifequal",
+                "ifnotequal",
+                "includevariable",
+                "includefile",
+                "load",
+                "now",
+                "regroup",
+                "spaceless",
+                "ssi",
+                "ssifile",
+                "templatetag",
+                "url",
+                "urlas",
+                "verbatim",
+                "widthratio",
+                "with",
+                # template filters
+                "add",
+                "addslashes",
+                "capfirst",
+                "center",
+                "cut",
+                "date",
+                "default",
+                "default_if_none",
+                "dictsort",
+                "dictsortreversed",
+                "divisibleby",
+                "escape",
+                "escapejs",
+                "filesizeformat",
+                "first",
+                "fix_ampersands",
+                "floatformat",
+                "force_escape",
+                "get_digit",
+                "iriencode",
+                "join",
+                "last",
+                "lenght",
+                "lenght_is",
+                "linebreaks",
+                "linebreaksbr",
+                "linenumbers",
+                "ljust",
+                "lower",
+                "make_list",
+                "phone2numeric",
+                "pluralize",
+                "pprint",
+                "random",
+                "removetags",
+                "rjust",
+                "safe",
+                "safeseq",
+                "slice",
+                "slugify",
+                "stringformat",
+                "striptags",
+                "time",
+                "timesince",
+                "timeuntil",
+                "title",
+                "truncatechars",
+                "truncatewords",
+                "truncatewords_html",
+                "unordered_list",
+                "upper",
+                "urlencode",
+                "urlize",
+                "urlizetrunc",
+                "wordcount",
+                "wordwrap",
+                "yesno",
+                # humanize tags
+                "loadhumanize",
+                "apnumber",
+                "intcomma",
+                "intword",
+                "naturalday",
+                "naturaltime",
+                "ordinal",
+                # web design tags
+                "loadweb",
+                "lorem",
+                # static tags
+                "loadstatic",
+                "staticfile",
+                "staticvariable",
+                "get_static_prefix",
+                "get_media_prefix",
+                # comments
+                "singlelinecommentselect",
+                "multilinecommentselect",
+                "singlelinecommentdialog",
+                "multilinecommentdialog",
+                "singlelinecommentclipboard",
+                "multilinecommentclipboard",
+                "multilinecommentfile",
+                "singlelinecommentdatetime",
+                "htmlcomment",
+                "iecomment",
+                # internationalisation
+                "loadi18n",
+                "trans",
+                "trans..as",
+                "blocktrans",
+                "blocktrans..with",
+                "plural",
+                "language",
+                "get_current_language",
+                "get_available_languages",
+                "get_current_language_bidi",
+                "get_language_info",
+                "get_language_info_list",
+                "language_name",
+                "language_name_local",
+                "bidi",
+                # localization
+                "loadl10n",
+                "localize_on",
+                "localize_off",
+                "localize",
+                "unlocalize",
+                # timezone
+                "loadtz",
+                "localtime_on",
+                "localtime_off",
+                "timezone_set",
+                "timezone_unset",
+                "get_current_timezone",
+                "localtime",
+                "utc",
+                "timezone",
+            ),
+            self,
+        )
+        self.__completer.setCompletionMode(QCompleter.CompletionMode.PopupCompletion)
         self.__completer.setCaseSensitivity(False)
         self.tagEdit.setCompleter(self.__completer)
-        
+
         msh = self.minimumSizeHint()
         self.resize(max(self.width(), msh.width()), msh.height())
-    
+
     @pyqtSlot()
     def on_tagEdit_returnPressed(self):
         """
         Private slot handling the user pressing the return key.
         """
         self.on_createButton_clicked()
-    
+
     @pyqtSlot()
     def on_createButton_clicked(self):
         """

eric ide

mercurial