Created
June 5, 2012 12:04
-
-
Save StanAngeloff/2874594 to your computer and use it in GitHub Desktop.
Глобул 3G + Sakis 3G за Lubuntu 12.04
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##2 | |
# If first line starts with "##" and has a single digit following it, | |
# it should denote average count of bytes used in representing UTF-8 | |
# characters of this locale. This value is utilized into properly | |
# wrapping translated text. | |
# | |
# This is a translation file for Sakis3G All-in-one script. | |
# | |
# All translation files should strictly remain in UTF-8 encoding. | |
# Make sure your editor loads and saves file using UTF-8. | |
# | |
# File information: | |
# - Translator(s): | |
# - Email (optional): xxxxxx is local part. Domain is xxxxxxx. | |
# - Locale: xx_xx.UTF-8 | |
# - Location: messages/xx_xx.UTF-8 | |
# | |
# To test your translation, execute sakis3g with TRANSLATE argument, | |
# sakis3g TRANSLATE="/home/me/translationfile" | |
# | |
# Notes and guidelines: | |
# - Please respect \n \t or any other character when translating. | |
# - Please respect count, order and datatype of "%" arguments when | |
# translating. | |
# - If a specific statement appears the same way, in your locale, and to | |
# original text, you should place an empty line below it. Do not | |
# copy-paste same content to denote identical original and translated | |
# text. Doing so will lead into problems | |
# - Feel free to alter order of statements according to your taste, as | |
# long as each translation comes after its English text. | |
# - Lines starting with # are ignored. | |
# - Empty line means that above statement does not have a translation. You | |
# should therefore only allow empty lines in pairs. Like those below: | |
## End of comments. More comments appear within text to help you translating. | |
"Относно Sakis3G" | |
"Взимане на ексклузивно заключване за HAL" | |
"Взимане на администраторски привилегии" | |
"Вече избраната стойност %s=\"%s\" не е валидна.\n" | |
# | |
# This statement appears within connection information which when | |
# displayed from "zenity" displays text aligned. Make sure you append | |
# statements with enough \t characters so that they appear aligned. | |
# All statements appearing in connection information dialog have | |
# "CONNECTION_INFORMATION" tag for you to search for. | |
# | |
"APN:\t\t\t%s" | |
"APN:\t\t\t\t%s" | |
"Наличните опции са:\n" | |
"Bluetooth модем" | |
"\"%s\" и \"%s\" липсват." | |
"Отказ" | |
"Проверявам за необходими пакети" | |
"Проверявам за необходими скриптове" | |
"Изберете действие, което да бъде изпълнено" | |
"Почистване" | |
"Компилирай Usb-ModeSwitch всичко-в-едно" | |
"Компилиране" | |
"Свързан!" | |
"Свързан" | |
# | |
# This statement appears within connection information which when | |
# displayed from "zenity" displays text aligned. Make sure you append | |
# statements with enough \t characters so that they appear aligned. | |
# All statements appearing in connection information dialog have | |
# "CONNECTION_INFORMATION" tag for you to search for. | |
# | |
"Свързан:\t%s\n" | |
"Свързан към %s." | |
"Свързан към %s (%s)." | |
"Свързване" | |
"Свързване (втори опит)" | |
"Информация за връзката" | |
"Информация за Връзката" | |
"Връзка чрез 3G" | |
"Създай отметка на работния плот" | |
"Създай отметка" | |
# | |
# Make sure you include your name between final "\n\n" like this: | |
# | |
# "(c) Sakis Dimopoulos 2009, 2010 under GNU GPL v2\nTranslation for English: Sakis Dimopoulos\n" | |
# | |
# | |
"(c) Sakis Dimopoulos 2009, 2010 under GNU GPL v2\n\n" | |
"(c) Сакис Димопулос 2009, 2010 под лиценз GNU GPL v2\nБърз превод на български: Станимир Ангелов\n" | |
"Ръчно APN..." | |
"Ръчно tty..." | |
# | |
# This statement appears within connection information which when | |
# displayed from "zenity" displays text aligned. Make sure you append | |
# statements with enough \t characters so that they appear aligned. | |
# All statements appearing in connection information dialog have | |
# "CONNECTION_INFORMATION" tag for you to search for. | |
# | |
"Път(ища) по подразбиране:\t%s\n" | |
"Икона на работния плот" | |
"Икона на работния плот беше създадена в %s." | |
"Устройството не показва да има GSM възможности. Може да пропуснете тази проверка като добавите --noprobe към командата.\n" | |
"Устройството \"%s\" не съществува или не може да бъде открито.\n" | |
"Устройството \"%s\" не съществува или не може да бъде открито. Връзката се провали." | |
# | |
# This statement appears within connection information which when | |
# displayed from "zenity" displays text aligned. Make sure you append | |
# statements with enough \t characters so that they appear aligned. | |
# All statements appearing in connection information dialog have | |
# "CONNECTION_INFORMATION" tag for you to search for. | |
# | |
"Устройството:\t\t\t%s\n" | |
"Разкачане" | |
"Разкачане и набиране отново" | |
"Разкачен.\n" | |
"Разкачане" | |
"Either enable interactive mode:\n" | |
"Embedded Usb-ModeSwitch binary is not valid for your architect. You need to recompile for devices to switch properly. Start by issueing: %s recompile" | |
"Enter Bluetooth address" | |
"Enter Bluetooth address of undiscoverable device, or leave empty to abort" | |
"Enter correct APN, or leave empty to abort. Contact your operator if unsure" | |
"Enter name of appropriate kernel module that should be used, or leave empty to abort" | |
"Enter password required by APN, or leave empty to abort. Contact your operator if unsure. This information is usually easily retrieved through a fast call to customer support" | |
"Enter RFCOMM channel that should be used, or leave empty to abort [1-255]" | |
"Enter tty node where your 3G modem resides, or leave empty to abort" | |
"Enter username required by APN, or leave empty to abort. Contact your operator if unsure. This information, along with APN password, is usually easily retrieved through a fast call to customer support" | |
"Грешка" | |
"Беше намерена грешка" | |
"Изход" | |
"Грешка при преминаването към администраторски режим." | |
"Failed to compile. Compilation output:\n%s\n" | |
"Грешка при свързването.\n" | |
"Грешка при създаването на устройството \"%s\"." | |
"Failed to detach wrong driver \"%s\". Please do it yourself and retry.\n" | |
"Failed to detect driver of interface %d.\n" | |
"Failed to disassemble Sakis3G package.\n" | |
"Грешка при разкачането.\n" | |
"Грешка при чакането за отговор от модема след подаване на ПИН." | |
"Failed to link %s. This usually indicates libusb (or libusb-compat) development kit missing.\n" | |
"Грешка при зареждането на модул \"%s\".\n" | |
"Грешка при подготовката на модема.\n" | |
"Грешка при настройката на модема.\n" | |
"Failed to succesfully create new version. Old version is still available at \"%s\".\n" | |
"Failed to succesfully place new version. You are still using old version.\n" | |
"Грешка при опита да се включи модема.\n" | |
"Failed to unbind driver %s. I am sorry." | |
"Failed to unload module \"%s\".\n" | |
"Failed to verify result of compilation.\n" | |
"Failure to write on %s.\n" | |
"Поправка на връзката" | |
"Following dependencies not found within path: %s\n" | |
"Header file %s missing from your system.\n" | |
"Header file %s missing from your system. This usually indicates libusb (or libusb-compat) development kit missing.\n" | |
"Помощ към този въпрос" | |
# | |
# This statement appears within connection information which when | |
# displayed from "zenity" displays text aligned. Make sure you append | |
# statements with enough \t characters so that they appear aligned. | |
# All statements appearing in connection information dialog have | |
# "CONNECTION_INFORMATION" tag for you to search for. | |
# | |
"Интерфейс:\t\t\tP-t-P (%s)\n" | |
# | |
# This statement appears within connection information which when | |
# displayed from "zenity" displays text aligned. Make sure you append | |
# statements with enough \t characters so that they appear aligned. | |
# All statements appearing in connection information dialog have | |
# "CONNECTION_INFORMATION" tag for you to search for. | |
# | |
"IP адрес:\t\t%s\n" | |
# | |
# This statement appears within connection information which when | |
# displayed from "zenity" displays text aligned. Make sure you append | |
# statements with enough \t characters so that they appear aligned. | |
# All statements appearing in connection information dialog have | |
# "CONNECTION_INFORMATION" tag for you to search for. | |
# | |
"Kernel драйвър:\t\t%s\n" | |
# | |
# This statement appears within connection information which when | |
# displayed from "zenity" displays text aligned. Make sure you append | |
# statements with enough \t characters so that they appear aligned. | |
# All statements appearing in connection information dialog have | |
# "CONNECTION_INFORMATION" tag for you to search for. | |
# | |
"KBs получени:\t%d\n" | |
# | |
# This statement appears within connection information which when | |
# displayed from "zenity" displays text aligned. Make sure you append | |
# statements with enough \t characters so that they appear aligned. | |
# All statements appearing in connection information dialog have | |
# "CONNECTION_INFORMATION" tag for you to search for. | |
# | |
"KBs изпратени:\t%d\n" | |
"Зарездане на драйвър %s" | |
"Намиране на tty" | |
"Manages 3G internet connection and 3G USB modems" | |
"Manually enter non-discovered channel..." | |
"Manually enter undiscoverable device..." | |
"Модемът се нуждае от PIN" | |
"Modem on %s is registered to %s.\n" | |
"Modem refused to register operator \"%s\" (currently registered to \"%s\").\n" | |
"Modem refused to register operator \"%s\".\n" | |
"Modem responded \"%s\" while checking for PIN." | |
"Модемът бебе избран.\n" | |
"Настройката на модема се намира на %s.\n" | |
"Модемът беше включен.\n" | |
"Модемът беше включен към %s.\n" | |
# | |
# This statement appears within connection information which when | |
# displayed from "zenity" displays text aligned. Make sure you append | |
# statements with enough \t characters so that they appear aligned. | |
# All statements appearing in connection information dialog have | |
# "CONNECTION_INFORMATION" tag for you to search for. | |
# | |
"Модем:\t\t\t%s\n" | |
# | |
# This statement appears within connection information which when | |
# displayed from "zenity" displays text aligned. Make sure you append | |
# statements with enough \t characters so that they appear aligned. | |
# All statements appearing in connection information dialog have | |
# "CONNECTION_INFORMATION" tag for you to search for. | |
# | |
"Тип на модема:\t\tBluetooth\n" | |
# | |
# This statement appears within connection information which when | |
# displayed from "zenity" displays text aligned. Make sure you append | |
# statements with enough \t characters so that they appear aligned. | |
# All statements appearing in connection information dialog have | |
# "CONNECTION_INFORMATION" tag for you to search for. | |
# | |
"Тип на модема:\t\tДруг\n" | |
# | |
# This statement appears within connection information which when | |
# displayed from "zenity" displays text aligned. Make sure you append | |
# statements with enough \t characters so that they appear aligned. | |
# All statements appearing in connection information dialog have | |
# "CONNECTION_INFORMATION" tag for you to search for. | |
# | |
"Тип на модема:\t\tНе се знае\n" | |
# | |
# This statement appears within connection information which when | |
# displayed from "zenity" displays text aligned. Make sure you append | |
# statements with enough \t characters so that they appear aligned. | |
# All statements appearing in connection information dialog have | |
# "CONNECTION_INFORMATION" tag for you to search for. | |
# | |
"Тип на модема:\t\tНе беше посочен\n" | |
# | |
# This statement appears within connection information which when | |
# displayed from "zenity" displays text aligned. Make sure you append | |
# statements with enough \t characters so that they appear aligned. | |
# All statements appearing in connection information dialog have | |
# "CONNECTION_INFORMATION" tag for you to search for. | |
# | |
"Тип на модема:\t\tUSB\n" | |
"Модемът не можа да се регистрира към мрежата." | |
"Module \"%s\" loaded but did not bind to device \"%s\".\n" | |
"Module \"%s\" loaded but refused to bind to device \"%s\".\n" | |
"Още опции..." | |
"\nНаличните опции са:\n" | |
# | |
# This statement appears within connection information which when | |
# displayed from "zenity" displays text aligned. Make sure you append | |
# statements with enough \t characters so that they appear aligned. | |
# All statements appearing in connection information dialog have | |
# "CONNECTION_INFORMATION" tag for you to search for. | |
# | |
"ИД на мрежата:\t\t%s" | |
"\nПример:\n" | |
"No method for acquiring root privileges found." | |
"Не беше избран модем.\n" | |
"Без връзка" | |
"Без връзка.\n" | |
"Известие" | |
"Not running from within package.\n" | |
"Няма намерен USB модем" | |
"Няма избран USB модел. No need for a udev example.\n" | |
"No write access to temporary folder \"%s\".\n" | |
"\nUtility \"%s\" found but cannot be used since we are not interactive.\n" | |
"Добре" | |
"Only prepare modem (Setup + PIN unlock + Register Network + Update HAL)" | |
"Only setup modem (Switch + Load module + Setup tty)" | |
"Only switch modem (if applicable)" | |
"Oops. Weird \"%s\" version. Deleted temporary folder \"%s\".\n" | |
# | |
# This statement appears within connection information which when | |
# displayed from "zenity" displays text aligned. Make sure you append | |
# statements with enough \t characters so that they appear aligned. | |
# All statements appearing in connection information dialog have | |
# "CONNECTION_INFORMATION" tag for you to search for. | |
# | |
"Име на оператора:\t%s" | |
"Опция" | |
"Опция %s не е довършена.\n" | |
"or, force using %s instead:\n" | |
"Друг..." | |
"Друг драйвър..." | |
# | |
# This statement appears within connection information which when | |
# displayed from "zenity" displays text aligned. Make sure you append | |
# statements with enough \t characters so that they appear aligned. | |
# All statements appearing in connection information dialog have | |
# "CONNECTION_INFORMATION" tag for you to search for. | |
# | |
"Peer IP Address:\t%s\n" | |
"Please appropriate interface" | |
"Please enter APN" | |
"Please enter name of driver" | |
"Please enter PIN number, or leave empty to abort" | |
"Please enter RFCOMM channel" | |
"Please enter tty" | |
"Please select an action" | |
"Please select APN" | |
"Please select appropriate driver" | |
"Please select Bluetooth device" | |
"Please select modem" | |
"Please select modem type" | |
"Please select RFCOMM service" | |
"Please select USB modem" | |
"Please use numbers %d-%d to perform your selection: " | |
"Port %s is currently occupied by %s." | |
"Включване на модема" | |
"Problem while parsing %s sources.\n" | |
"Връзка към %s беше установена наново.\n" | |
"Включване към мрежата" | |
"Reported by your modem (%s)" | |
"Reported package location is not executable: %s\n" | |
"Продължаване" | |
"Retrieving operator icon" | |
"Sakis 3G All-in-one script - Version %s\n" | |
"Sakis3G tux icon" | |
"%s by using %s variable, or by enabling interactive mode.\n" | |
"Scan device again" | |
"Scan devices again" | |
"Scanning bluetooth devices" | |
# | |
# First argument is modem name. Second argument is operator name. | |
# | |
"%s свързан към %s." | |
# | |
# First argument is modem name. Second argument is operator name. | |
# | |
"%s свързан към %s (%s)." | |
# | |
# Argument is bluetooth address of selected device, in the form | |
# xx:xx:xx:xx:xx:xx | |
# | |
"Търсене %s" | |
"Избор" | |
"Select APN that best describes your connection. Contact your operator if unsure. This information, along with APN username and password, is usually easily retrieved through a fast call to customer support" | |
"Select Bluetooth device that provides 3G modem capabilities." | |
"Select icon to use for shortcut" | |
"Select kernel module that should be used." | |
"Select modem category that best fits your 3G modem." | |
"Select modem interface of USB device that provides modem capabilities." | |
"Select modem that will be used for establishing 3G connection." | |
"Select RFCOMM service of Bluetooth device that provides 3G modem capabilities." | |
"Select USB device that provides modem capabilities." | |
"Отключване на ПИН" | |
"Помощ" | |
"Something really bad happened. I am really sorry. You may need to re-download Sakis3G.\n" | |
"Spurious changes in tty %s. Consider using \"killstorage\" switch in case it improves stability." | |
"Spurious changes in tty %s. Problem may be solved by upgrading your kernel or by choosing another driver." | |
"Стартиране" | |
# | |
# This statement appears within connection information which when | |
# displayed from "zenity" displays text aligned. Make sure you append | |
# statements with enough \t characters so that they appear aligned. | |
# All statements appearing in connection information dialog have | |
# "CONNECTION_INFORMATION" tag for you to search for. | |
# | |
"Subnet Mask:\t\t%s\n" | |
"Succesfully recompiled.\n" | |
"Включване на модема" | |
"Включване на модема (използвайки %s)" | |
"Testing compiler" | |
"To automatically repeat result of last action, immediately upon device connection, include following line within a %s file within \"%s\" directory:\n%s\n" | |
"To automatically repeat result of last action, use following command line:\n%s\n" | |
"Unable to check if module is currently loaded or if it has users.\n" | |
"Unable to check if %s is occupied. Not root." | |
"Unable to create a safe backup to \"%s\".\n" | |
"Unable to create device node \"%s\"." | |
"Unable to create file %s.\n" | |
"Unable to create rfcomm device node \"%s\"." | |
"Unable to create rfcomm node %s." | |
"Unable to create temporary folder \"%s\".\n" | |
"Unable to create temporary pppd config file within %s directory.\n" | |
"Unable to create temporary wvdial config file within %s directory.\n" | |
"Unable to delete previously existing \"%s\".\n" | |
"Unable to delete \"%s\".\n" | |
"Unable to determine my path.\n" | |
"Unable to discover connected USB devices. Script will now abort." | |
"Unable to extract %s source from package.\n" | |
"Unable to find available rfcomm device index. Minors occupied.\n" | |
"Unable to gather connection information.\n" | |
"Unable to get %s icon, unknown reason." | |
"Unable to install tray icon to system notification area. You need to install %s.\n" | |
"Unable to load driver \"%s\" for device \"%s\"" | |
"Unable to locate dependency \"%s\". Script will now abort." | |
"Unable to locate driver to use for device \"%s\"" | |
"Unable to overwrite existing package %s. Check if on read-only filesystem.\n" | |
"Unable to stop running pppd session. Both %s and % were not found.\n" | |
"Unloading driver %s" | |
"Unusable binary after including \"%s\".\n" | |
"Updating HAL" | |
"USB устройството" | |
"Изчакване на устройството" | |
"Waiting HAL to mount device(s)" | |
"Waiting %s to be released by PID %s." | |
"Работя..." | |
"WRONG PIN. Aborting to prevent you from locking your SIM card." | |
"You can automate this selection by setting %s variable.\n" | |
"You can automate this selection by setting %s variable.\nEnter \"*\" to discover how.\n" | |
"You can automate this selection by setting %s variable on command line, click here to discover how.\n" | |
"You can automate this selection by setting %s variable on command line.\n" | |
"Проверка на данните за интернет" | |
"Начално зареждане на модема" | |
"Confirm exit" | |
"Exiting will also remove tray icon. Are you sure you want to exit Sakis3G?" | |
"Разкачен" | |
"USB модем включен" | |
"Модем %s беше засечен към компютъра." | |
"Модем %s е свързан към %s." | |
"Модем %s е свързан." | |
"Вие се свързахте към %s." | |
"Компютърът е свързан с интернет." | |
"Модем беше изваден от компютъра." | |
"No USB modem is anymore plugged on computer." | |
"You were disconnected due to modem being unplugged." | |
"Вие се разкачихте от интернет." | |
"Seems like an electrical/USB bus error occured. You may need to replug your modem for it to properly work.\n" | |
"Намиране на устройството" | |
"Unable to locate a configuration file for switching device %s.\n" | |
"You are running a binary free version of Sakis3G. Unable to recompile %s.\n" | |
"%s is not installed on your system.\n" | |
"You are running a binary free version of Sakis3G. This action is not available.\n" | |
"Trying emergency switch" | |
"You need to be connected for generating report.\n" | |
"Please report following text:\n" | |
"Generate success report" | |
"You can automate this selection by setting --%syes or --%sno switches.\n" | |
"Търсена на мрежа" | |
"Модемът не успя да се регистрира в мрежата. Бихте ли искали да опитате това ръчно?" | |
"Търсене на мрежа" | |
"Моля изберете мрежа" | |
"Изберете мрежа към която да се регистрира модемът." | |
"You are running a stripped version of Sakis3G. This action is not available.\n" | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# vim: set fileencoding=utf-8 | |
import os | |
import re | |
import subprocess | |
import sys | |
import time | |
from gi.repository import Gdk, GObject, Gtk | |
SCRIPT_PATH = '$HOME/Плот/' | |
SCRIPT_NAME = ('%s.sakis3g' % SCRIPT_PATH) | |
USB_MODEM_MOUNT_POINT = '/media/GLOBUL MODEM' | |
USB_MODEM_MANUFACTURER = 'ZTE' | |
USB_MODEM_INTERFACE = 1 | |
USB_MODEM_PIN = 'XXXX' | |
USB_MODEM_APN = 'globul' | |
USB_MODEM_APN_USER = USB_MODEM_APN | |
USB_MODEM_APN_PASSWORD = USB_MODEM_APN | |
class ConnectionWindow(Gtk.Window): | |
def __init__(self): | |
Gtk.Window.__init__(self, title=u'Връзка с Глобул') | |
self.set_icon(Gtk.Image.new_from_file('/home/USER/.local/share/icons/globul.png').get_pixbuf()) | |
align = Gtk.Alignment() | |
align.set_padding(50, 50, 80, 80) | |
vbox = Gtk.VBox(spacing=25) | |
self._waiting = Gtk.Label(label=u"Проверка на връзката...") | |
vbox.add(self._waiting) | |
hbox = Gtk.HBox(homogeneous=True, spacing=10) | |
hbox.add(self._button_connect()) | |
hbox.add(self._button_disconnect()) | |
vbox.add(hbox) | |
align.add(vbox) | |
self.add(align) | |
self.resize(1, 1) | |
self.set_position(Gtk.WindowPosition.CENTER) | |
self.connect('show', self._check_connection) | |
def _check_connection(self, event): | |
self._setup_buttons(_is_connected()) | |
def _button_connect(self): | |
self._btn_connect = Gtk.Button(label=u"Свържи Се", sensitive=False) | |
self._btn_connect.connect('clicked', self._connect) | |
return self._btn_connect | |
def _button_disconnect(self): | |
self._btn_disconnect = Gtk.Button(label=u"Разкачи Се", sensitive=False) | |
self._btn_disconnect.connect('clicked', self._disconnect) | |
return self._btn_disconnect | |
def _setup_buttons(self, is_connected): | |
if self._waiting is not None: | |
self._waiting.get_parent().remove(self._waiting) | |
self._waiting = None | |
if is_connected: | |
self._btn_connect.set_sensitive(False) | |
self._btn_disconnect.set_sensitive(True) | |
else: | |
self._btn_connect.set_sensitive(True) | |
self._btn_disconnect.set_sensitive(False) | |
def _connect(self, event=None): | |
self._umount() | |
self._fork_and_run("%s --interactive --nostorage --balloons --googledns connect %s >/dev/null" % (SCRIPT_NAME, _connection_string())) | |
self._btn_connect.set_sensitive(False) | |
self._btn_disconnect.set_sensitive(True) | |
def _disconnect(self, event=None): | |
self._fork_and_run("%s --interactive --balloons disconnect %s >/dev/null" % (SCRIPT_NAME, _connection_string())) | |
self._btn_connect.set_sensitive(True) | |
self._btn_disconnect.set_sensitive(False) | |
def _umount(self): | |
if os.path.exists(USB_MODEM_MOUNT_POINT): | |
with os.popen("mount | grep '%s'" % USB_MODEM_MOUNT_POINT) as process: | |
device_id = process.readline() | |
os.system('eject -m %s >/dev/null' % (device_id.split(' ')[0])) | |
self._wait_for_usb() | |
def _wait_for_usb(self): | |
tries = 0 | |
while tries < 10: | |
tries = tries + 1 | |
try: | |
_device_bus_id() | |
break | |
except RuntimeError: | |
time.sleep(1) | |
pass | |
def _fork_and_run(self, command): | |
pid = os.fork() | |
if pid > 0: | |
# Parent process, return and keep running. | |
return | |
os.setsid() | |
pid = os.fork() | |
if pid > 0: | |
# Exit from second parent. | |
sys.exit(0) | |
os.system(command) | |
os._exit(os.EX_OK) | |
def _device_bus_id(): | |
with os.popen("lsusb | grep -i '%s'" % USB_MODEM_MANUFACTURER) as process: | |
bus_id = process.readline() | |
if not len(bus_id): | |
raise RuntimeError("Модемът на Глобул не може да бъде засечен. Моля, рестартирайте системата и опитайте отново.") | |
groups = re.search(' ID ([0-9a-f:]+) ', bus_id) | |
if groups is None: | |
raise RuntimeError("Модемът на Глобул не бе разпознат правилно. Моля, извадете и поставете устройството и опитайте отново.") | |
return groups.group(1) | |
def _connection_string(): | |
return ' '.join((""" | |
TRANSLATE="%s.messages.bg_BG.UTF-8" | |
MODEM="OTHER" | |
OTHER="USBMODEM" | |
USBMODEM="%s" | |
USBINTERFACE="%d" | |
SIM_PIN="%s" | |
APN="%s" | |
APN_USER="%s" | |
APN_PASS="%s" | |
""" % (SCRIPT_PATH, _device_bus_id(), USB_MODEM_INTERFACE, USB_MODEM_PIN, USB_MODEM_APN, USB_MODEM_APN_USER, USB_MODEM_APN_PASSWORD)).strip().splitlines()) | |
def _is_connected(): | |
result = os.system("%s --console status %s >/dev/null" % (SCRIPT_NAME, _connection_string())) | |
return (True if (result == 0) else False) | |
if __name__ == '__main__': | |
app = ConnectionWindow() | |
app.connect('delete-event', Gtk.main_quit) | |
app.show_all() | |
Gtk.main() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Desktop Entry] | |
Version=1.0 | |
Encoding=UTF-8 | |
Type=Application | |
Terminal=false | |
Name=Глобул | |
Name[en_US]=Globul | |
Name[bg_BG]=Глобул | |
Exec=/home/USER/Плот/.Глобул | |
Comment=Управлява връзката към Глобул 3G. | |
Comment[us_US]=Manages Globul 3G internet connection. | |
Comment[bg_BG]=Управлява връзката към Глобул 3G. | |
Icon=/home/USER/.local/share/icons/globul.png | |
GenericName= |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment