about summary refs log tree commit diff stats
path: root/po/sl.po
Commit message (Collapse)AuthorAgeFilesLines
* snapshot of project "lynx", label v2-8-8dev_3cThomas E. Dickey2010-05-031-0/+5999
|
* snapshot of project "lynx", label v2_8_8dev_6cThomas E. Dickey2010-04-291-5999/+0
|
* snapshot of project "lynx", label v2-8-7dev_11Thomas E. Dickey2008-12-151-2/+1
|
* snapshot of project "lynx", label v2-8-7dev_10cThomas E. Dickey2008-12-081-194/+195
|
* snapshot of project "lynx", label v2-8-7dev_10bThomas E. Dickey2008-09-241-2/+1
|
* snapshot of project "lynx", label v2-8-7dev_9nThomas E. Dickey2008-09-211-201/+341
|
* snapshot of project "lynx", label v2-8-7dev_9eThomas E. Dickey2008-07-191-147/+147
|
* snapshot of project "lynx", label v2-8-7dev_8cThomas E. Dickey2008-04-271-37/+37
|
* snapshot of project "lynx", label v2-8-7dev_7eThomas E. Dickey2008-02-171-847/+886
|
* snapshot of project "lynx", label v2-8-7dev_c-pbmThomas E. Dickey2008-02-101-6/+1
|
* snapshot of project "lynx", label v2-8-7dev_5fThomas E. Dickey2007-08-021-446/+475
|
* snapshot of project "lynx", label v2-8-7dev_4dThomas E. Dickey2007-05-061-1/+1
|
* snapshot of project "lynx", label v2-8-7dev_3Thomas E. Dickey2006-11-131-198/+198
|
* snapshot of project "lynx", label v2-8-7dev_1Thomas E. Dickey2006-10-131-77/+83
|
* snapshot of project "lynx", label v2-8-6dev_19Thomas E. Dickey2006-08-311-304/+330
|
* snapshot of project "lynx", label v2-8-6dev_18Thomas E. Dickey2006-05-291-74/+78
|
* snapshot of project "lynx", label v2-8-6dev_17Thomas E. Dickey2006-01-231-185/+185
|
* snapshot of project "lynx", label v2-8-6dev_16Thomas E. Dickey2005-12-181-91/+96
|
* snapshot of project "lynx", label v2-8-6dev_14Thomas E. Dickey2005-10-171-207/+210
|
* snapshot of project "lynx", label v2-8-6dev_12Thomas E. Dickey2005-06-021-244/+244
|
* snapshot of project "lynx", label v2-8-6dev_10Thomas E. Dickey2005-01-021-123/+123
|
* snapshot of project "lynx", label v2-8-6dev_9Thomas E. Dickey2004-12-301-400/+418
|
* snapshot of project "lynx", label v2-8-6dev_8Thomas E. Dickey2004-11-071-190/+190
|
* snapshot of project "lynx", label v2-8-6dev_7Thomas E. Dickey2004-10-171-135/+139
|
* snapshot of project "lynx", label v2-8-6dev_6Thomas E. Dickey2004-10-111-235/+281
|
* snapshot of project "lynx", label v2-8-6dev_5Thomas E. Dickey2004-07-011-75/+79
|
* snapshot of project "lynx", label v2-8-6dev_4Thomas E. Dickey2004-05-231-349/+390
|
* snapshot of project "lynx", label v2-8-6dev_3Thomas E. Dickey2004-05-071-627/+614
|
* snapshot of project "lynx", label v2-8-6dev_1Thomas E. Dickey2004-04-201-268/+496
|
* snapshot of project "lynx", label v2-8-5pre_3Thomas E. Dickey2004-01-251-2/+2
|
* snapshot of project "lynx", label v2-8-5dev_17Thomas E. Dickey2004-01-081-278/+303
|
* snapshot of project "lynx", label v2-8-5dev_15Thomas E. Dickey2003-04-281-233/+266
|
* snapshot of project "lynx", label v2-8-5dev_13Thomas E. Dickey2003-01-221-1020/+1086
|
* snapshot of project "lynx", label v2-8-5dev_9Thomas E. Dickey2002-10-071-2/+2
|
* snapshot of project "lynx", label v2-8-4rel_1Thomas E. Dickey2001-07-171-2/+2
|
* snapshot of project "lynx", label v2-8-4dev_21Thomas E. Dickey2001-06-031-830/+717
|
* snapshot of project "lynx", label v2-8-4dev_17Thomas E. Dickey2001-02-091-608/+537
|
* snapshot of project "lynx", label v2-8-4dev_15Thomas E. Dickey2000-12-221-12/+5477
|
* snapshot of project "lynx", label v2-8-3dev_18Thomas E. Dickey2000-01-071-1/+10
|
* snapshot of project "lynx", label v2-8-2dev_2Thomas E. Dickey1998-11-101-0/+11
<git@nfnty.se> 2017-02-01 23:55:55 +0100 committer nfnty <git@nfnty.se> 2017-02-01 23:56:56 +0100 gui.curses_shortcuts: addstr, addnstr: Handle `UnicodeError`' href='/akspecs/ranger/commit/ranger/gui/curses_shortcuts.py?h=v1.9.3&id=2192e81ae9e435a28874641ce5734e511fb9c974'>2192e81a ^
d1a1173d ^
4f51adb3 ^
d1a1173d ^
7c869ebd ^

d1a1173d ^

d842a314 ^
d1a1173d ^
a23a3649 ^
d1a1173d ^




2d8affdd ^
d1a1173d ^
ba3f04ea ^
d1a1173d ^




2d8affdd ^
d1a1173d ^
ea87d005 ^
d1a1173d ^


2d8affdd ^
d1a1173d ^
43e0f44a ^
d1a1173d ^


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95

                                                                 
 
                                                                  
 
          
             
 
                                      
                                            
 

                                                
 
                          

                                                                           
 
 
                                     
                                                                         
 





                                                                      
 


                       
                            

                               

                                  
                                                     

                                                                        
                             

                                   

                                                           
                                                    
                        
 
                             

                               

                                   
                                         
                             

                                   

                                                            
                                                    
                        
 
                           

                                                      

                                 
                                         
                
 




                                                        
                            
                
 




                                                         
                            
                
 


                                                                         
                            
                
 


                                                     
# This file is part of ranger, the console file manager.
# License: GNU GPL version 3, see the file "AUTHORS" for details.

from __future__ import (absolute_import, division, print_function)

import sys
import curses

from ranger.gui.color import get_color
from ranger.core.shared import SettingsAware

REVERSE_ADDCH_ARGS = sys.version[0:5] == '3.4.0'


def _fix_surrogates(args):
    return [isinstance(arg, str) and arg.encode('utf-8', 'surrogateescape')
            .decode('utf-8', 'replace') or arg for arg in args]


class CursesShortcuts(SettingsAware):
    """This class defines shortcuts to facilitate operations with curses.

    color(*keys) -- sets the color associated with the keys from
        the current colorscheme.
    color_at(y, x, wid, *keys) -- sets the color at the given position
    color_reset() -- resets the color to the default
    addstr(*args) -- failsafe version of self.win.addstr(*args)
    """

    def __init__(self):
        self.win = None

    def addstr(self, *args):
        y, x = self.win.getyx()

        try:
            self.win.addstr(*args)
        except (curses.error, TypeError, ValueError):
            # a TypeError changed to ValueError from version 3.5 onwards
            # https://bugs.python.org/issue22215
            if len(args) > 1:
                self.win.move(y, x)

                try:
                    self.win.addstr(*_fix_surrogates(args))
                except (curses.error, UnicodeError):
                    pass

    def addnstr(self, *args):
        y, x = self.win.getyx()

        try:
            self.win.addnstr(*args)
        except (curses.error, TypeError):
            if len(args) > 2:
                self.win.move(y, x)

                try:
                    self.win.addnstr(*_fix_surrogates(args))
                except (curses.error, UnicodeError):
                    pass

    def addch(self, *args):
        if REVERSE_ADDCH_ARGS and len(args) >= 3:
            args = [args[1], args[0]] + list(args[2:])
        try:
            self.win.addch(*args)
        except (curses.error, TypeError):
            pass

    def color(self, *keys):
        """Change the colors from now on."""
        attr = self.settings.colorscheme.get_attr(*keys)
        try:
            self.win.attrset(attr)
        except curses.error:
            pass

    def color_at(self, y, x, wid, *keys):
        """Change the colors at the specified position"""
        attr = self.settings.colorscheme.get_attr(*keys)
        try:
            self.win.chgat(y, x, wid, attr)
        except curses.error:
            pass

    def set_fg_bg_attr(self, fg, bg, attr):
        try:
            self.win.attrset(curses.color_pair(get_color(fg, bg)) | attr)
        except curses.error:
            pass

    def color_reset(self):
        """Change the colors to the default colors"""
        CursesShortcuts.color(self, 'reset')