Philipp Hörist pushed to branch master at gajim / gajim

Commits:

2 changed files:

Changes:

  • gajim/gtk/filechoosers.py
    ... ... @@ -15,6 +15,8 @@
    15 15
     # You should have received a copy of the GNU General Public License
    
    16 16
     # along with Gajim. If not, see <http://www.gnu.org/licenses/>.
    
    17 17
     
    
    18
    +from typing import List
    
    19
    +
    
    18 20
     import os
    
    19 21
     import sys
    
    20 22
     from pathlib import Path
    
    ... ... @@ -27,7 +29,6 @@ from gajim.common import app
    27 29
     from gajim.common.i18n import _
    
    28 30
     
    
    29 31
     from gajim.gtk.const import Filter
    
    30
    -from gajim.gtk.types import FilterList  # pylint: disable=unused-import
    
    31 32
     
    
    32 33
     
    
    33 34
     def _require_native() -> bool:
    
    ... ... @@ -85,7 +86,7 @@ class BaseFileChooser:
    85 86
     class BaseFileOpenDialog:
    
    86 87
     
    
    87 88
         _title = _('Choose File to Send…')
    
    88
    -    _filters = [Filter(_('All files'), '*', True)]  # type: FilterList
    
    89
    +    _filters = [Filter(_('All files'), '*', True)]
    
    89 90
     
    
    90 91
     
    
    91 92
     class BaseAvatarChooserDialog:
    
    ... ... @@ -96,7 +97,7 @@ class BaseAvatarChooserDialog:
    96 97
         if _require_native():
    
    97 98
             _filters = [Filter(_('PNG files'), '*.png', True),
    
    98 99
                         Filter(_('JPEG files'), '*.jp*g', False),
    
    99
    -                    Filter(_('SVG files'), '*.svg', False)]  # type: FilterList
    
    100
    +                    Filter(_('SVG files'), '*.svg', False)]
    
    100 101
         else:
    
    101 102
             _filters = [Filter(_('Images'), ['image/png',
    
    102 103
                                              'image/jpeg',
    
    ... ... @@ -106,7 +107,7 @@ class BaseAvatarChooserDialog:
    106 107
     class NativeFileChooserDialog(Gtk.FileChooserNative, BaseFileChooser):
    
    107 108
     
    
    108 109
         _title = ''
    
    109
    -    _filters = []  # type: FilterList
    
    110
    +    _filters: List[Filter] = []
    
    110 111
         _action = Gtk.FileChooserAction.OPEN
    
    111 112
     
    
    112 113
         def __init__(self, accept_cb, cancel_cb=None, transient_for=None,
    
    ... ... @@ -158,7 +159,7 @@ class NativeAvatarChooserDialog(BaseAvatarChooserDialog, NativeFileChooserDialog
    158 159
     class GtkFileChooserDialog(Gtk.FileChooserDialog, BaseFileChooser):
    
    159 160
     
    
    160 161
         _title = ''
    
    161
    -    _filters = []  # type: FilterList
    
    162
    +    _filters: List[Filter] = []
    
    162 163
         _action = Gtk.FileChooserAction.OPEN
    
    163 164
         _preivew_size = (200, 200)
    
    164 165
     
    

  • gajim/gtk/types.py
    ... ... @@ -13,10 +13,3 @@
    13 13
     # along with Gajim.  If not, see <http://www.gnu.org/licenses/>.
    
    14 14
     
    
    15 15
     # Types for typechecking
    16
    -
    
    17
    -from typing import ClassVar
    
    18
    -from typing import List
    
    19
    -
    
    20
    -from gajim.gtk.const import Filter
    
    21
    -
    
    22
    -FilterList = ClassVar[List[Filter]]