📄 unix.py
字号:
# vim: ts=4:sw=4:expandtab# -*- coding: UTF-8 -*-## BleachBit## Copyright (C) 2009 Andrew Ziem## http://bleachbit.sourceforge.net#### This program is free software: you can redistribute it and/or modify## it under the terms of the GNU General Public License as published by## the Free Software Foundation, either version 3 of the License, or## (at your option) any later version.#### This program is distributed in the hope that it will be useful,## but WITHOUT ANY WARRANTY; without even the implied warranty of## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the## GNU General Public License for more details.#### You should have received a copy of the GNU General Public License## along with this program. If not, see <http://www.gnu.org/licenses/>."""Integration specific to Unix-like operating systems"""import globimport osimport reimport ConfigParserimport FileUtilitiesdef locale_to_language(locale): """Convert the locale code to a language code (generally ISO 639)""" if 'klingon' == locale: return locale matches = re.findall("^([a-z]{2,3})([_-][a-zA-Z]{2,4})?(\.[a-zA-Z0-9-]*)?(@[a-zA-Z]*)?$", locale) if 1 > len(matches): raise ValueError("Invalid locale_code '%s'" % (locale,)) return matches[0][0]class Locales: """Find languages and localization files""" __native_locale_names = \ { 'ar' : '丕賱毓乇亘賷丞', \ 'bg' : '斜褗谢谐邪褉褋泻懈 械蟹懈泻', \ 'bn' : '唳
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -