예제 #1
0
#    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 2 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, write to the Free Software
#    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

from log import logger
logging=logger.getChild('communication.status')
from collections import OrderedDict
import config
import events
import extras
import main
import globalVars
import output
import Skype4Py
import wx

def statusNames():
	statusDict=OrderedDict([
		(Skype4Py.cusOnline, _('Online')),
		(Skype4Py.cusAway, _('Away')),
		(Skype4Py.cusNotAvailable, _('Not Available')),
예제 #2
0
from math import pi, pow, ceil, sqrt
import configparser
import re
import isa
from log import logger

module_logger = logger.getChild('aircraft')


class Aircraft:
    def __init__(self, config):
        self.logger = logger.getChild('Aircraft')
        self.logger.info('creating Aircraft')
        self.config = config
        self._finalizeData()

    @classmethod
    def readConfiguration(cls, xml_file, acft_id):
        logger.info('reading Aircraft configuration')
        config = configparser.ConfigParser(inline_comment_prefixes=(';', '#'))
        config.read(xml_file)

        acft = cls(config[acft_id])
        logger.info('done reading Aircraft configuration')

        return acft

    def findAircraftClass(self):
        S = self.getValue('S')
        MLM = self.getValue('MLM')
        f_deg = self.landingFlaps()[-1]
예제 #3
0
import config
import userdb
from lib import *
from log import logger
from html_mod_python import FinalizeRequest
import os
import time
import traceback
import i18n
from hashlib import md5

import cmk.paths

auth_type = None
auth_logger = logger.getChild("auth")

# Perform the user authentication. This is called by index.py to ensure user
# authentication and initialization of the user related data structures.
#
# Initialize the user session with the mod_python provided request object.
# The user may have configured (basic) authentication by the web server. In
# case a user is provided, we trust that user and assume it as authenticated.
#
# Otherwise we check / ask for the cookie authentication or eventually the
# automation secret authentication.
def authenticate(mod_python_req):
    # Check whether or not already authenticated
    user_id = check_auth(mod_python_req)
    if user_id:
        login(user_id)
예제 #4
0
#    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 2 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, write to the Free Software
#    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

from log import logger
logging = logger.getChild('interface.preferences')
from gui_components.sized import SizedDialog
from i18n_utils import core
from platform_utils.autostart import windows
import categories
import config
import globalVars
import i18n
import interface
import locations
import output
import versionInfo
import wx


def open():
예제 #5
0
#    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 2 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, write to the Free Software
#    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

from log import logger
logging=logger.getChild('communication.files')
import config
import events
import globalVars
import output
import Skype4Py
import time

def OnFileTransfer(file, status):
	globalVars.transferringFile=file
	checkFileTransfer()

def checkFileTransfer(announce=True, inProgress=False):
	f=globalVars.transferringFile
	file, user=f.FileName.decode("mbcs"), f.PartnerDisplayName
	if f.Type==Skype4Py.fileTransferTypeIncoming:
예제 #6
0
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation; either version 2 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, write to the Free Software
#    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

from log import logger

logging = logger.getChild('communication.calls')
import events
import globalVars
import output
import Skype4Py


def OnCall(call, status):
    globalVars.call = call
    checkCall()


def checkCall(announce=True, inProgress=False):
    c = globalVars.call
    if c.Status == Skype4Py.clsRinging and c.Type == Skype4Py.cltIncomingP2P:
        events.registerNewEvent(events.EVT_CALLS,
예제 #7
0
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation; either version 2 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, write to the Free Software
#    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

from log import logger

logging = logger.getChild("communication.calls")
import events
import globalVars
import output
import Skype4Py


def OnCall(call, status):
    globalVars.call = call
    checkCall()


def checkCall(announce=True, inProgress=False):
    c = globalVars.call
    if c.Status == Skype4Py.clsRinging and c.Type == Skype4Py.cltIncomingP2P:
        events.registerNewEvent(events.EVT_CALLS, _("Call from %s") % c.PartnerDisplayName, announce, True, inProgress)
예제 #8
0
#    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 2 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, write to the Free Software
#    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

from log import logger
logging=logger.getChild('interface.contactsManager')
from datetime import datetime
from gui_components.sized import SizedDialog
from threading import Thread
from profileViewer import ProfileViewerDialog
import config
import extras
import globalVars
import output
import os
import Skype4Py
import sys
import versionInfo
import wx
import wx.lib.sized_controls as sc
from wx.lib.mixins.listctrl import CheckListCtrlMixin
예제 #9
0
#    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 2 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, write to the Free Software
#    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

from log import logger
logging=logger.getChild('core.updates')
from transfer_dialogs import DownloadDialog
import config
import globalVars
import interface
import launcher
import locations
import os
import output
import urllib2
import versionInfo
import wx

"""
This is the SkypeTalking updater. It will download the latest version of SkypeTalking from a web site automatically or by request.
"""
예제 #10
0
from log import logger

logging = logger.getChild("core.i18n")
import config
import globalVars
from i18n_utils import core
import locations
import versionInfo


def initialize():
    logging.info("Initializing the i18n subsystem.")
    core.set_active_language(versionInfo.name,
                             locations.catalogFilesLocation(),
                             config.conf['general']['language'])


def getAvailableLanguages():
    return core.available_languages(locations.catalogFilesLocation(),
                                    versionInfo.name)


def getLangDisplayName(lang):
    return lang['language']


def getAvailableLangDisplayNames():
    langs = getAvailableLanguages()
    return [getLangDisplayName(langs[i]) for i in langs]

예제 #11
0
#
#    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, write to the Free Software
#    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

"""
Extra Utilities Module
"""

from log import logger
logging=logger.getChild('core.extras')
from datetime import datetime

def getPrintableUserName(DisplayName, FullName, Handle):
	"""
Returns the Skype user name printed on the same way like it's displayed in Skype Client application.
If the user has a display name, then display name will be printed.
If the user has no display name, then a full name will be printed.
If the user has no either display or full name, then a handle (Skype name) will be printed.
"""
	if len(DisplayName)==0:
		result=FullName
	else:
		result=DisplayName
	if len(result)==0:
		result=Handle
예제 #12
0
from log import logger
logging=logger.getChild('core.output')
from accessible_output import braille, speech
import config

speaker=brailler=None

def speak(text, interrupt=0):
	global speaker
	if not speaker:
		initialize()
	speaker.say(text,interrupt);
	try:
		if config.conf['output']['enableBrailleOutput']==True:
			Braille(text)
	except TypeError: #The configuration isn't setup
		pass

def Silence():
	global speaker
	if not speaker:
		initialize()
	if config.conf['output']['speechOutput']==1:
		speaker.say("",3);
	else:
		speaker.silence()

def Braille(text, *args, **kwargs):
	#Braille the given text to the display.
	global brailler
	if not config.conf['output']['enableBrailleOutput']:
예제 #13
0
from log import logger

logging = logger.getChild('core.hotkey')
from ctypes import windll
from copy import deepcopy
import globalVars
import output
import time
import win32api
import win32con  #for the VK keycodes
import wx


class HotkeySupport(object):
    def __init__(self, parent, interface, keymap):
        self.parent = parent
        self.interface = interface
        self._lastCommandTime = 0
        self._lastCommandCount = 0
        self._lastCommandExecuted = None
        self.keymap = keymap
        self.updateDict(self.keymap, keymap)
        new = self.standardizeAllKeystrokes(self.keymap)
        self.keymap.clear()
        self.keymap.update(new)
        logging.debug("Keyboard: Final loaded keymap: %r" % (self.keymap))
        self.replacementMods = {}
        self.replacementKeys = {
            "pageup": win32con.VK_PRIOR,
            "pagedown": win32con.VK_NEXT
        }
예제 #14
0
#    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 2 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, write to the Free Software
#    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

from log import logger
logging = logger.getChild('communication.files')
import config
import events
import globalVars
import output
import Skype4Py
import time


def OnFileTransfer(file, status):
    globalVars.transferringFile = file
    checkFileTransfer()


def checkFileTransfer(announce=True, inProgress=False):
    f = globalVars.transferringFile
예제 #15
0
#    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 2 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, write to the Free Software
#    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

from log import logger
logging=logger.getChild('communication.messages')
from platform_utils import clipboard
import events
import extras
import globalVars
import config
import output
import re
import Skype4Py
import time
import webbrowser

def OnMessage(message, status):
	if status==Skype4Py.cmsSending:
		output.speak(_("Sending..."))
	elif status==Skype4Py.cmsReceived:
예제 #16
0
import sqlite3
import os
import sys
import progressbar
import collections
from log import logger

module_logger = logger.getChild('DATABASE')
# Useful containers
airport = collections.namedtuple('airport', 'id altitude magvar')
runway = collections.namedtuple('runway', 'id hgd_t length_ft type')

# Progress bar basic design
widgets = [
    ' [',
    progressbar.Timer(), '] ',
    progressbar.Bar(marker='=', left='[', right=']')
]

conn = None


def findFSXpath():
    '''Find FSX path in registry'''
    import winreg

    win_fsx_key = r'SOFTWARE\WOW6432Node\Microsoft\microsoft games\flight simulator\10.0'
    Key = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, win_fsx_key)
    FSXpath = winreg.QueryValueEx(Key, "SetupPath")[0]

    return FSXpath
예제 #17
0
from log import logger
logging=logger.getChild('core.hotkey')
from ctypes import windll
from copy import deepcopy
import globalVars
import output
import time
import win32api
import win32con #for the VK keycodes
import wx

class HotkeySupport(object):

	def __init__(self, parent, interface, keymap):
		self.parent=parent
		self.interface=interface
		self._lastCommandTime=0
		self._lastCommandCount=0
		self._lastCommandExecuted=None
		self.keymap=keymap
		self.updateDict(self.keymap, keymap)
		new=self.standardizeAllKeystrokes(self.keymap)
		self.keymap.clear()
		self.keymap.update(new)
		logging.debug("Keyboard: Final loaded keymap: %r" % (self.keymap))
		self.replacementMods={}
		self.replacementKeys={"pageup":win32con.VK_PRIOR, "pagedown":win32con.VK_NEXT}
		self.keys={}
		self.defaultKeys=[]
		for i in dir(win32con):
			if i.startswith("VK_"):
예제 #18
0
#    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 2 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, write to the Free Software
#    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

from log import logger
logging = logger.getChild('communication.main')
import calls, messages, files, status, sms, users, voicemail
import config
import extras
import globalVars
import interface
import output
import Skype4Py
import time
import updater
import versionInfo
import wx


def OnAttach(status):
    globalVars.attachStatus = status
예제 #19
0
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation; either version 2 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, write to the Free Software
#    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

from log import logger

logging = logger.getChild('communication.misc')
from datetime import datetime
import calls
import files
import messages
import voicemail
import config
import extras
import globalVars
import output
import Skype4Py
import versionInfo
import wx


def SkypeVersionInfo(*args, **kwargs):
예제 #20
0
파일: read.py 프로젝트: DarthVeder/talpa
'''
Read an FSBUILD operative flight plan (ofp) stored in fsbroute.log and extracts departure, arrival and weights for the
flight.

Usage:

import fsbuild

ofp_weight, ofp_route, old_ofp = fsbuild.read(file)
'''

from log import logger

module_logger = logger.getChild('FSBUILD')

ofp_weight = {'PAYLOAD': -1, 'ZFW': -1, 'TOGWT': -1, 'LDGWT': -1}
ofp_fuel = {'TAXI': 0.0}
ofp_route = {}
ofp_new_data = {}


def read(file_in, unit='lb'):
    C_FACTOR = 1.0
    if unit == 'kg':
        C_FACTOR = 1.0 / 0.453592
    old_ofp = []
    module_logger.info('Reading OFP FSBUILD with unit {}'.format(unit))

    with open(file_in, 'r') as f:
        line_value_tom = False
        for line in f:
예제 #21
0
#
#    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, write to the Free Software
#    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

"""
This module contains functions and variables for working with Skype events. It also keeps the event history.
"""

from log import logger
logging=logger.getChild('core.events')
from datetime import datetime
from extras import getPrettyDate
import config
import globalVars
import output
import tones

#event type constants
EVT_STATUSCHANGES=0
EVT_CALLS=1
EVT_MESSAGES=2
EVT_FILES=3
EVT_USERS=4
EVT_VOICEMAIL=5
예제 #22
0
from log import logger

logging = logger.getChild('core.config')
import confspecs
import locations
import versionInfo
from UserDict import UserDict
from configobj import ConfigObj, ParseError
from validate import Validator, VdtValueError
import os

configFile = locations.dataFilesLocation(versionInfo.name + ".ini")
confspec = ConfigObj(confspecs.defaults, list_values=False, encoding="UTF-8")
confspec.newlines = "\r\n"
conf = None


class ConfigurationResetException(Exception):
    pass


class Configuration(UserDict):
    def __init__(self, file=None, spec=None, *args, **kwargs):
        self.file = file
        self.spec = spec
        self.validator = Validator()
        self.setup_config(file=file, spec=spec)
        self.validated = self.config.validate(self.validator, copy=True)
        if self.validated:
            self.write()
        UserDict.__init__(self, self.config)
예제 #23
0
from log import logger
logging = logger.getChild("core.i18n")
import config
import globalVars
from i18n_utils import core
import locations
import versionInfo

def initialize():
	logging.info("Initializing the i18n subsystem.")
	core.set_active_language(versionInfo.name, locations.catalogFilesLocation(), config.conf['general']['language'])

def getAvailableLanguages():
	return core.available_languages(locations.catalogFilesLocation(), versionInfo.name)

def getLangDisplayName(lang):
	return lang['language']

def getAvailableLangDisplayNames():
	langs=getAvailableLanguages()
	return [getLangDisplayName(langs[i]) for i in langs]

def langFromLangDisplayName(language):
	langs=getAvailableLanguages()
	for i in langs:
		if langs[i]['language'] == language:
			return i
예제 #24
0
#    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 2 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, write to the Free Software
#    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

from log import logger
logging=logger.getChild('interface.preferences')
from gui_components.sized import SizedDialog
from i18n_utils import core
from platform_utils.autostart import windows
import categories
import config
import globalVars
import i18n
import interface
import locations
import output
import versionInfo
import wx

def open():
	preferencesDLG=preferencesDialog(parent=globalVars.Frame, title=versionInfo.name+" - "+_("Preferences"))
예제 #25
0
#    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 2 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, write to the Free Software
#    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

from log import logger
logging = logger.getChild('communication.users')
import config
import extras
import events
import globalVars
import output
import Skype4Py


def OnAuthRequest(user):
    if not user.IsAuthorized:
        events.registerNewEvent(
            events.EVT_USERS,
            _("User %s %s requests authorization. Intro text: %s") %
            (user.FullName, user.Handle, user.ReceivedAuthRequest), True)
    elif user.IsAuthorized:
예제 #26
0
#    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 2 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, write to the Free Software
#    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

from log import logger
logging = logger.getChild('core.updates')
from transfer_dialogs import DownloadDialog
import config
import globalVars
import interface
import launcher
import locations
import os
import output
import urllib2
import versionInfo
import wx
"""
This is the SkypeTalking updater. It will download the latest version of SkypeTalking from a web site automatically or by request.
"""
예제 #27
0
 def __init__(self, config):
     self.logger = logger.getChild('Aircraft')
     self.logger.info('creating Aircraft')
     self.config = config
     self._finalizeData()
예제 #28
0
from log import logger

module_logger = logger.getChild('UNIT')

LB2KG = 0.453592
_unit = 'lb'


def set(unit):
    global _unit
    if unit not in ['lb', 'kg']:
        module_logger.error('Unit must be either "kg" or "lb"')
        exit(1)
    else:
        _unit = unit


def check(W):
    if _unit != 'lb':
        W = W * LB2KG

    return W


def get():
    return _unit
예제 #29
0
#    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 2 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, write to the Free Software
#    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

from log import logger
logging = logger.getChild('communication.status')
from collections import OrderedDict
import config
import events
import extras
import main
import globalVars
import output
import Skype4Py
import wx


def statusNames():
    statusDict = OrderedDict([(Skype4Py.cusOnline, _('Online')),
                              (Skype4Py.cusAway, _('Away')),
                              (Skype4Py.cusNotAvailable, _('Not Available')),
예제 #30
0
#    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 2 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, write to the Free Software
#    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

from log import logger
logging=logger.getChild('communication.main')
import calls, messages, files, status, sms, users, voicemail
import config
import extras
import globalVars
import interface
import output
import Skype4Py
import time
import updater
import versionInfo
import wx

def OnAttach(status):
	globalVars.attachStatus=status
	if status == Skype4Py.apiAttachPendingAuthorization:
예제 #31
0
from log import logger

logging = logger.getChild("core.output")
from accessible_output import braille, speech
import config

speaker = brailler = None


def speak(text, interrupt=0):
    global speaker
    if not speaker:
        initialize()
    speaker.say(text, interrupt)
    try:
        if config.conf["output"]["enableBrailleOutput"] == True:
            Braille(text)
    except TypeError:  # The configuration isn't setup
        pass


def Silence():
    global speaker
    if not speaker:
        initialize()
    if config.conf["output"]["speechOutput"] == 1:
        speaker.say("", 3)
    else:
        speaker.silence()

예제 #32
0
#    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 2 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, write to the Free Software
#    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

from log import logger
logging=logger.getChild('core.interface')
from main import mainInterface
import config
import globalVars
import output
import sys
import versionInfo
import wx

def exit():
	exitConfirmed=False
	if not config.conf['general']['confirmExit']:
		exitConfirmed=True
	elif config.conf['general']['confirmExit']:
		confirm=wx.MessageDialog(None, _("Are you sure you want to exit %s? This will also unload Skype if you've configured such behavior.")%versionInfo.name, _("Confirm Exit"), wx.YES|wx.NO|wx.ICON_WARNING)
		globalVars.Frame.DisplayDialog(confirm)
예제 #33
0
"""
Aircraft masses estimation using FAR25 for:
- takeoff distance
- initial climb
- landing
- missed approach

Based on "Progetto di Velivoli Parte I", J. Roskam
"""
import isa.constants
from math import sqrt
from log import logger
from . import Data
import unit

module_logger = logger.getChild('FAR25')


def takeoff(acft, apt, rwy, qnh_hPa, T_degC):
    # sTOFL = 37.5 * (W/S)_TO / (sigma*CLmaxTO*(T/W)_TO) = 37.5 W^2/(S*sigma*CLmaxTO*T)
    to_flap = acft.takeoffFlaps()
    # Airport density ratio
    qnh_Pa = qnh_hPa * 100.0
    T_K = T_degC + 273.15
    sigma = isa.sigma(qnh_Pa, T_K)

    rwy_vs_weight_flap = {}
    for f in to_flap:
        CLmaxTO = acft.CLmax(f)
        S = acft.getValue('S')
        delta = qnh_hPa / 1013.15
예제 #34
0
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation; either version 2 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, write to the Free Software
#    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

from log import logger

logging = logger.getChild("core.interface")
from main import mainInterface
import config
import globalVars
import output
import sys
import versionInfo
import wx


def exit():
    exitConfirmed = False
    if not config.conf["general"]["confirmExit"]:
        exitConfirmed = True
    elif config.conf["general"]["confirmExit"]:
        confirm = wx.MessageDialog(
예제 #35
0
#    (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, write to the Free Software
#    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
"""
Extra Utilities Module
"""

from log import logger
logging = logger.getChild('core.extras')
from datetime import datetime


def getPrintableUserName(DisplayName, FullName, Handle):
    """
Returns the Skype user name printed on the same way like it's displayed in Skype Client application.
If the user has a display name, then display name will be printed.
If the user has no display name, then a full name will be printed.
If the user has no either display or full name, then a handle (Skype name) will be printed.
"""
    if len(DisplayName) == 0:
        result = FullName
    else:
        result = DisplayName
    if len(result) == 0:
예제 #36
0
#    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 2 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, write to the Free Software
#    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

from log import logger
logging=logger.getChild('communication.users')
import config
import extras
import events
import globalVars
import output
import Skype4Py

def OnAuthRequest(user):
	if not user.IsAuthorized:
		events.registerNewEvent(events.EVT_USERS, _("User %s %s requests authorization. Intro text: %s")%(user.FullName, user.Handle, user.ReceivedAuthRequest), True)
	elif user.IsAuthorized:
		events.registerNewEvent(events.EVT_USERS, _("You are now friend with %s %s.")%(user.FullName, user.Handle), True)
	elif user.IsBlocked:
		events.registerNewEvent(events.EVT_USERS, _("User %s %s is blocked.")%(user.FullName, user.Handle), True)
예제 #37
0
#    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 2 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, write to the Free Software
#    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

from log import logger
logging=logger.getChild('communication.misc')
from datetime import datetime
import calls
import files
import messages
import voicemail
import config
import extras
import globalVars
import output
import Skype4Py
import versionInfo
import wx

def SkypeVersionInfo(*args, **kwargs):
	output.speak(_("Skype client version %s")%globalVars.Skype.Version)
예제 #38
0
from log import logger
logging=logger.getChild('core.config')
import confspecs
import locations
import versionInfo
from UserDict import UserDict
from configobj import ConfigObj, ParseError
from validate import Validator, VdtValueError
import os

configFile=locations.dataFilesLocation(versionInfo.name+".ini")
confspec=ConfigObj(confspecs.defaults, list_values=False, encoding="UTF-8")
confspec.newlines="\r\n"
conf=None

class ConfigurationResetException(Exception):
	pass

class Configuration(UserDict):

	def __init__(self, file=None, spec=None, *args, **kwargs):
		self.file=file
		self.spec=spec
		self.validator=Validator()
		self.setup_config(file=file, spec=spec)
		self.validated=self.config.validate(self.validator, copy=True)
		if self.validated:
			self.write()
		UserDict.__init__(self, self.config)

	def setup_config(self, file, spec):