Пример #1
0
#
# You should have received a copy of the GNU General Public License
# along with Outspline.  If not, see <http://www.gnu.org/licenses/>.

import os as _os
import random
import wx
import wx.lib.inspection

import outspline.coreaux_api as coreaux_api
import outspline.core_api as core_api
import outspline.extensions.development_api as development_api
import outspline.interfaces.wxgui_api as wxgui_api
organism_api = coreaux_api.import_optional_extension_api('organism')
links_api = coreaux_api.import_optional_extension_api('links')
wxscheduler_basicrules_api = coreaux_api.import_optional_plugin_api(
                                                    'wxscheduler_basicrules')
wxlinks_api = coreaux_api.import_optional_plugin_api('wxlinks')

import simulator
import tests


class MenuDev(wx.Menu):
    populate = None
    simulator = None
    ID_PRINT = None
    printtb = None
    all_ = None
    databases = None
    memory = None
Пример #2
0
# 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 Outspline.  If not, see <http://www.gnu.org/licenses/>.

import random
import os

import outspline.core_api as core_api
import outspline.coreaux_api as coreaux_api
from outspline.coreaux_api import log
import outspline.interfaces.wxgui_api as wxgui_api
organism_api = coreaux_api.import_optional_extension_api('organism')
links_api = coreaux_api.import_optional_extension_api('links')
wxcopypaste_api = coreaux_api.import_optional_plugin_api('wxcopypaste')
wxscheduler_api = coreaux_api.import_optional_plugin_api('wxscheduler')
wxscheduler_basicrules_api = coreaux_api.import_optional_plugin_api(
    'wxscheduler_basicrules')
wxalarms_api = coreaux_api.import_optional_plugin_api('wxalarms')
wxlinks_api = coreaux_api.import_optional_plugin_api('wxlinks')


def _select_database():
    dbn = core_api.get_databases_count()
    dbid = wxgui_api.get_selected_database_tab_index()
    if dbid > -1:
        choices = [dbid] * 3 + range(dbn)
        wxgui_api.select_database_tab_index(random.choice(choices))
        return True
    else:
Пример #3
0
#
# You should have received a copy of the GNU General Public License
# along with Outspline.  If not, see <http://www.gnu.org/licenses/>.

import os as _os
import random
import wx
import wx.lib.inspection

import outspline.coreaux_api as coreaux_api
import outspline.core_api as core_api
import outspline.extensions.development_api as development_api
import outspline.interfaces.wxgui_api as wxgui_api
organism_api = coreaux_api.import_optional_extension_api('organism')
links_api = coreaux_api.import_optional_extension_api('links')
wxscheduler_basicrules_api = coreaux_api.import_optional_plugin_api(
    'wxscheduler_basicrules')
wxlinks_api = coreaux_api.import_optional_plugin_api('wxlinks')

import simulator
import tests


class MenuDev(wx.Menu):
    populate = None
    simulator = None
    ID_PRINT = None
    printtb = None
    all_ = None
    databases = None
    memory = None
Пример #4
0
# (at your option) any later version.
#
# Outspline 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 Outspline.  If not, see <http://www.gnu.org/licenses/>.

import outspline.core_api as core_api
import outspline.coreaux_api as coreaux_api
import outspline.interfaces.wxgui_api as wxgui_api
organism_alarms_api = coreaux_api.import_optional_extension_api(
                                                              'organism_alarms')
wxcopypaste_api = coreaux_api.import_optional_plugin_api('wxcopypaste')
wxalarms_api = coreaux_api.import_optional_plugin_api('wxalarms')

import msgboxes


def check_all_active_alarms_have_a_corresponding_item(kwargs):
    leftovers = set()
    for alarm in wxalarms_api.get_active_alarms():
        if alarm['filename'] not in \
                         organism_alarms_api.get_supported_open_databases() or \
                   alarm['id'] not in core_api.get_items_ids(alarm['filename']):
            leftovers.add((alarm['filename'], str(alarm['id'])))
    if leftovers:
        msgboxes.warn_generic('The following active alarms don\'t have a '
                              'corresponding item any more:\n{}'.format(
Пример #5
0
# (at your option) any later version.
#
# Outspline 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 Outspline.  If not, see <http://www.gnu.org/licenses/>.

import outspline.core_api as core_api
import outspline.coreaux_api as coreaux_api
import outspline.interfaces.wxgui_api as wxgui_api
organism_alarms_api = coreaux_api.import_optional_extension_api(
    'organism_alarms')
wxcopypaste_api = coreaux_api.import_optional_plugin_api('wxcopypaste')
wxalarms_api = coreaux_api.import_optional_plugin_api('wxalarms')

import msgboxes


def check_all_active_alarms_have_a_corresponding_item(kwargs):
    leftovers = set()
    for alarm in wxalarms_api.get_active_alarms():
        if alarm['filename'] not in \
                         organism_alarms_api.get_supported_open_databases() or \
                   alarm['id'] not in core_api.get_items_ids(alarm['filename']):
            leftovers.add((alarm['filename'], str(alarm['id'])))
    if leftovers:
        msgboxes.warn_generic('The following active alarms don\'t have a '
                              'corresponding item any more:\n{}'.format(
Пример #6
0
            Notify = None
            GLib = None

try:
    import wx
except ImportError:
    wx = None

from outspline.static.pyaux.timeaux import TimeSpanFormatters

from outspline.coreaux_api import log
import outspline.core_api as core_api
import outspline.coreaux_api as coreaux_api
import outspline.extensions.organism_alarms_api as organism_alarms_api
wxgui_api = coreaux_api.import_optional_interface_api('wxgui')
wxtrayicon_api = coreaux_api.import_optional_plugin_api('wxtrayicon')


class Notifications():
    def __init__(self, wxtrayicon_id=None):
        Notify.init("Outspline")

        # It should be safe if the icon is not found in the system
        self.ICON = "outspline-alarm"
        self.wxtrayicon_id = wxtrayicon_id

        organism_alarms_api.bind_to_alarm(self._handle_alarm)

    def _handle_alarm(self, kwargs):
        now = int(time.time()) // 60 * 60
Пример #7
0
# You should have received a copy of the GNU General Public License
# along with Outspline.  If not, see <http://www.gnu.org/licenses/>.

import os as _os
import time as _time
import wx

from outspline.static.wxclasses.misc import NarrowSpinCtrl

from outspline.coreaux_api import log
import outspline.coreaux_api as coreaux_api
import outspline.core_api as core_api
import outspline.extensions.organism_alarms_api as organism_alarms_api
import outspline.interfaces.wxgui_api as wxgui_api

wxtrayicon_api = coreaux_api.import_optional_plugin_api("wxtrayicon")

alarmswindow = None


class AlarmsWindow(object):
    def __init__(self, parent):
        wxgui_api.install_icon_bundle(
            "wxalarms",
            "&alarmswin",
            (
                ("alarmswin16.png",),
                ("alarmswin24.png",),
                ("alarmswin32.png",),
                ("alarmswin48.png",),
                ("alarmswin64.png",),
Пример #8
0
# 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 Outspline.  If not, see <http://www.gnu.org/licenses/>.

import random
import os

import outspline.core_api as core_api
import outspline.coreaux_api as coreaux_api
from outspline.coreaux_api import log
import outspline.interfaces.wxgui_api as wxgui_api
organism_api = coreaux_api.import_optional_extension_api('organism')
links_api = coreaux_api.import_optional_extension_api('links')
wxcopypaste_api = coreaux_api.import_optional_plugin_api('wxcopypaste')
wxscheduler_api = coreaux_api.import_optional_plugin_api('wxscheduler')
wxscheduler_basicrules_api = coreaux_api.import_optional_plugin_api(
                                                    'wxscheduler_basicrules')
wxalarms_api = coreaux_api.import_optional_plugin_api('wxalarms')
wxlinks_api = coreaux_api.import_optional_plugin_api('wxlinks')


def _select_database():
    dbn = core_api.get_databases_count()
    dbid = wxgui_api.get_selected_database_tab_index()
    if dbid > -1:
        choices = [dbid] * 3 + range(dbn)
        wxgui_api.select_database_tab_index(random.choice(choices))
        return True
    else: