ranger.ext.widestring
index
../../ranger/ext/widestring.py

# -*- encoding: utf8 -*-
# Copyright (C) 2009-2013  Roman Zimbelmann <hut@lavabit.com>
# This software is distributed under the terms of the GNU GPL version 3.

 
Modules
       
sys

 
Classes
       
builtins.object
WideString

 
class WideString(builtins.object)
     Methods defined here:
__add__(self, string)
>>> (WideString("a") + WideString("b")).string
'ab'
>>> (WideString("a") + WideString("b")).chars
['a', 'b']
>>> (WideString("afd") + "bc").chars
['a', 'f', 'd', 'b', 'c']
__getitem__(self, i)
>>> WideString("asdf")[2]
<WideString 'd'>
>>> WideString("……")[0]
<WideString '…'>
>>> WideString("……")[1]
<WideString '…'>
__getslice__(self, a, z)
>>> WideString("asdf")[1:3]
<WideString 'sd'>
>>> WideString("asdf")[1:-100]
<WideString ''>
>>> WideString("モヒカン")[2:4]
<WideString 'ヒ'>
>>> WideString("モヒカン")[2:5]
<WideString 'ヒ '>
>>> WideString("モabカン")[2:5]
<WideString 'ab '>
>>> WideString("モヒカン")[1:5]
<WideString ' ヒ '>
>>> WideString("モヒカン")[:]
<WideString 'モヒカン'>
>>> WideString("aモ")[0:3]
<WideString 'aモ'>
>>> WideString("aモ")[0:2]
<WideString 'a '>
>>> WideString("aモ")[0:1]
<WideString 'a'>
__init__(self, string, chars=None)
__len__(self)
>>> len(WideString("poo"))
3
>>> len(WideString("モヒカン"))
8
__radd__(self, string)
>>> ("bc" + WideString("afd")).chars
['b', 'c', 'a', 'f', 'd']
__repr__(self)
__str__(self)

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
Functions
       
east_asian_width(...)
east_asian_width(unichr)
 
Returns the east asian width assigned to the Unicode character
unichr as string.
string_to_charlist(string)
Return a list of characters with extra empty strings after wide chars
utf_char_width(string)
Return the width of a single character
uwid(string)
Return the width of a string

 
Data
        ASCIIONLY = set(['\x01', '\x02', '\x03', '\x04', '\x05', '\x06', ...])
NARROW = 1
PY3 = True
WIDE = 2
WIDE_SYMBOLS = set(['F', 'W'])