コード例 #1
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 json

from outspline.coreaux_api import Event

import queries
import databases
import items
import exceptions

check_pending_changes_event = Event()
reset_modified_state_event = Event()
history_event = Event()
history_insert_event = Event()
history_update_previous_event = Event()
history_update_parent_event = Event()
history_update_text_event = Event()
history_delete_event = Event()
history_clean_event = Event()


class DBHistory(object):
    def __init__(self, connection, items, filename):
        self.connection = connection
        self.items = items
        self.filename = filename
コード例 #2
0
# 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 json

from outspline.coreaux_api import Event

import databases
import queries
import exceptions

item_insert_event = Event()
item_update_previous_event = Event()
item_update_parent_event = Event()
item_update_text_event = Event()
item_deleting_event = Event()
item_deleted_event = Event()
item_deleted_2_event = Event()


class Item(object):
    def __init__(self, connection, dbhistory, items, filename, id_):
        self.connection = connection
        self.dbhistory = dbhistory
        self.items = items
        self.filename = filename
        self.id_ = id_
コード例 #3
0
ファイル: notebooks.py プロジェクト: xguse/outspline
#
# You should have received a copy of the GNU General Public License
# along with Outspline.  If not, see <http://www.gnu.org/licenses/>.

import wx
import wx.lib.agw.flatnotebook as flatnotebook
from wx.lib.agw.flatnotebook import FlatNotebook

import outspline.coreaux_api as coreaux_api
from outspline.coreaux_api import Event
import outspline.core_api as core_api

import editor
import databases

last_database_closed_event = Event()


class Notebook(FlatNotebook):
    def __init__(self, parent):
        FlatNotebook.__init__(self, parent, agwStyle=
                                        flatnotebook.FNB_FANCY_TABS |
                                        flatnotebook.FNB_NO_X_BUTTON |
                                        flatnotebook.FNB_NO_NAV_BUTTONS |
                                        flatnotebook.FNB_X_ON_TAB |
                                        flatnotebook.FNB_DROPDOWN_TABS_LIST |
                                        flatnotebook.FNB_NO_TAB_FOCUS)
        self.parent = parent
        self._set_colours(parent)

        self.Bind(flatnotebook.EVT_FLATNOTEBOOK_PAGE_CONTEXT_MENU,
コード例 #4
0
# along with Outspline.  If not, see <http://www.gnu.org/licenses/>.

import threading
import time as time_

from outspline.static.pyaux import timeaux
import outspline.coreaux_api as coreaux_api
from outspline.coreaux_api import log, Event
import outspline.core_api as core_api
import outspline.extensions.organism_api as organism_api

import queries
from exceptions import (BadOccurrenceError, BadExceptRuleError,
                        ConflictingRuleHandlerError, OngoingOldSearchWarning)

get_next_occurrences_event = Event()
search_old_occurrences_event = Event()
search_old_occurrences_end_event = Event()
search_next_occurrences_event = Event()
activate_occurrences_range_event = Event()
activate_old_occurrences_event = Event()
activate_occurrences_event = Event()


class Database(object):
    def __init__(self, filename):
        self.filename = filename

    def get_last_search(self):
        conn = core_api.get_connection(self.filename)
        cur = conn.cursor()
コード例 #5
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 json
import time as time_

from outspline.static.pyaux import timeaux
from outspline.coreaux_api import log, Event
import outspline.core_api as core_api

import queries
from exceptions import (BadOccurrenceError, BadExceptRuleError,
                                                   ConflictingRuleHandlerError)

update_item_rules_conditional_event = Event()
delete_item_rules_event = Event()
history_insert_event = Event()
history_update_event = Event()
get_alarms_event = Event()


class Database(object):
    def __init__(self, filename):
        self.filename = filename

    def post_init(self):
        core_api.register_history_action_handlers(self.filename,
                                'rules_insert', self._handle_history_insert,
                                self._handle_history_delete)
        core_api.register_history_action_handlers(self.filename,
コード例 #6
0
ファイル: links.py プロジェクト: mikpim01/outspline
#
# You should have received a copy of the GNU General Public License
# along with Outspline.  If not, see <http://www.gnu.org/licenses/>.

import json

from outspline.coreaux_api import Event
import outspline.coreaux_api as coreaux_api
import outspline.core_api as core_api
copypaste_api = coreaux_api.import_optional_extension_api('copypaste')
organism_api = coreaux_api.import_optional_extension_api('organism')

import queries
import exceptions

upsert_link_event = Event()
delete_link_event = Event()
break_link_event = Event()
history_insert_event = Event()
history_update_event = Event()
history_delete_event = Event()

cdbs = set()

# This dictionary keeps track of the last target for any link that has existed
# It's *not* a mapping of the *current* links, for that use a proper query to
# the database
last_known_links = {}


def select_links(filename):
コード例 #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
import wx
import wx.dataview as dv

from outspline.coreaux_api import Event, OutsplineError
import outspline.coreaux_api as coreaux_api
import outspline.core_api as core_api

import databases
import editor
import logs

creating_tree_event = Event()
reset_context_menu_event = Event()
popup_context_menu_event = Event()
undo_tree_event = Event()
redo_tree_event = Event()
delete_items_event = Event()

dbs = {}


class Item(object):
    # The DataViewModel needs proper objects; to *not* store simple integers
    # (e.g. the items' id's) or strings as items' objects
    def __init__(self, id_, label, properties):
        self.id_ = id_
        self.label = label
コード例 #8
0
ファイル: __init__.py プロジェクト: xguse/outspline
#
# You should have received a copy of the GNU General Public License
# along with Outspline.  If not, see <http://www.gnu.org/licenses/>.

import sys
import wx
from wx.lib.mixins.listctrl import ListCtrlAutoWidthMixin

from outspline.coreaux_api import Event
import outspline.coreaux_api as coreaux_api
import outspline.core_api as core_api
import outspline.extensions.organism_api as organism_api
import outspline.interfaces.wxgui_api as wxgui_api
wxcopypaste_api = coreaux_api.import_optional_plugin_api('wxcopypaste')

init_rules_list_event = Event()
insert_rule_event = Event()
create_rule_event = Event()
edit_rule_event = Event()
choose_rule_event = Event()
check_editor_event = Event()

base = None


class Main(object):
    def __init__(self):
        self.items = {}
        self.itemicons = {}

        ViewMenu(self)
コード例 #9
0
ファイル: __init__.py プロジェクト: xguse/outspline
# 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/>.

from outspline.coreaux_api import Event
import outspline.core_api as core_api

import queries
from exceptions import UnsafePasteWarning

origin_filename = None
copy_items_event = Event()
item_copy_event = Event()
item_paste_event = Event()
items_pasted_event = Event()
paste_check_event = Event()


def copy_items(filename, cids):
    qmemory = core_api.get_memory_connection()
    cursorm = qmemory.cursor()
    cursorm.execute(queries.copy_delete)
    core_api.give_memory_connection(qmemory)

    copy_items_event.signal()

    global origin_filename
コード例 #10
0
import sqlite3

import outspline.info
import outspline.coreaux_api as coreaux_api
from outspline.coreaux_api import Event, log
import outspline.dbdeps as dbdeps

import exceptions
import items
import queries
import history

protection = None
memory = None

blocked_databases_event = Event()
open_database_dirty_event = Event()
open_database_event = Event()
closing_database_event = Event()
close_database_event = Event()
save_permission_check_event = Event()
save_database_event = Event()
delete_subtree_event = Event()
exit_app_event_1 = Event()
exit_app_event_2 = Event()

dbs = {}


class Protection(object):
    # Avoid that an operation is started while the timer is doing something
コード例 #11
0
ファイル: databases.py プロジェクト: mikpim01/outspline
import os.path
import time
import wx

import outspline.coreaux_api as coreaux_api
from outspline.coreaux_api import Event, OutsplineError
import outspline.core_api as core_api
import outspline.dbdeps as dbdeps

import editor
import msgboxes
import tree
import dbprops

open_database_event = Event()
close_database_event = Event()

dbpropmanager = dbprops.DatabasePropertyManager()
aborted_save_warnings = {}


def create_database(defpath=None, filename=None):
    if not filename:
        if not defpath:
            defpath = os.path.join(
                os.path.expanduser('~'), '.'.join(
                    ('new_database', coreaux_api.get_standard_extension())))

        dlg = msgboxes.create_db_ask()
        dlg.SetPath(defpath)
コード例 #12
0
ファイル: __init__.py プロジェクト: mikpim01/outspline
# 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 wx

import outspline.coreaux_api as coreaux_api
from outspline.coreaux_api import Event
import outspline.core_api as core_api
import outspline.interfaces.wxgui_api as wxgui_api
import outspline.extensions.copypaste_api as copypaste_api

import msgboxes

cut_items_event = Event()
items_pasted_event = Event()

plugin = None


class Main(object):
    def __init__(self):
        self.dbs = {}
        self.mainmenu = MainMenu(self.dbs)

        wxgui_api.bind_to_creating_tree(self._handle_creating_tree)
        wxgui_api.bind_to_close_database(self._handle_close_database)

    def _handle_creating_tree(self, kwargs):
        filename = kwargs['filename']
コード例 #13
0
ファイル: __init__.py プロジェクト: xguse/outspline
# 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/>.

from outspline.coreaux_api import Event
import outspline.coreaux_api as coreaux_api
import outspline.core_api as core_api
copypaste_api = coreaux_api.import_optional_extension_api('copypaste')

import outspline.info.extensions.organism as info

import queries
import items

database_open_event = Event()

extension = None


class Main(object):
    def __init__(self):
        self.rules = items.Rules()
        self.databases = {}

        self._create_copy_table()

        core_api.bind_to_open_database_dirty(self._handle_open_database_dirty)
        core_api.bind_to_open_database(self._handle_open_database)
        core_api.bind_to_close_database(self._handle_close_database)
        core_api.bind_to_insert_item(self._handle_insert_item)
コード例 #14
0
ファイル: editor.py プロジェクト: mikpim01/outspline
# You should have received a copy of the GNU General Public License
# along with Outspline.  If not, see <http://www.gnu.org/licenses/>.

import wx
import wx.lib.agw.foldpanelbar as foldpanelbar
from wx.lib.agw.foldpanelbar import FoldPanelBar

from outspline.coreaux_api import Event
import outspline.coreaux_api as coreaux_api
import outspline.core_api as core_api

import msgboxes
import textarea
import tree

open_editor_event = Event()
apply_editor_event = Event()
check_modified_state_event = Event()
close_editor_event = Event()

config = coreaux_api.get_interface_configuration('wxgui')

tabs = {}


class Editors(object):
    def __init__(self, nb):
        self.icon_index = nb.add_image(
            wx.GetApp().artprovider.get_notebook_icon('@edit'))

コード例 #15
0
ファイル: dbprops.py プロジェクト: xguse/outspline
import os.path
import shutil
import time as time_
import wx
import wx.propgrid as wxpg

import outspline.dbdeps as dbdeps
import outspline.coreaux_api as coreaux_api
from outspline.coreaux_api import Event
import outspline.core_api as core_api

import databases
import msgboxes

load_options_event = Event()


class DatabasePropertyManager(object):
    def __init__(self):
        self.open_panels = {}

        # No need to also bind to "save as" because it closes and opens the
        # database anyway, thus also closing the property tab if open
        core_api.bind_to_save_database(self._handle_save_database)
        core_api.bind_to_history_insert(self._handle_items_number)
        core_api.bind_to_history_remove(self._handle_items_number)
        core_api.bind_to_insert_item(self._handle_items_number)
        core_api.bind_to_deleted_item(self._handle_items_number)
        # No need to bind to pasting items
コード例 #16
0
ファイル: __init__.py プロジェクト: mikpim01/outspline
# 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 os.path
import wx

import outspline.coreaux_api as coreaux_api
from outspline.coreaux_api import Event
import outspline.core_api as core_api
import outspline.interfaces.wxgui_api as wxgui_api

reset_menu_event = Event()
create_menu_event = Event()

trayicon = None


class TrayIcon(wx.TaskBarIcon):
    ID_MINIMIZE = None
    ID_RESTORE = None
    icon = None
    menu = None

    def __init__(self):
        wx.TaskBarIcon.__init__(self)
        self.ID_MINIMIZE = wx.NewId()
        # Let self.restore have a different ID from menumin in the main menu,
コード例 #17
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 threading

from outspline.coreaux_api import Event
import outspline.coreaux_api as coreaux_api
import outspline.core_api as core_api
import outspline.extensions.organism_timer_api as organism_timer_api

import queries

alarm_event = Event()
alarm_off_event = Event()
activate_alarms_range_event = Event()
activate_alarms_range_end_event = Event()


class Database(object):
    def __init__(self, filename, choose_unique_old_alarms):
        self.filename = filename
        self.choose_unique_old_alarms = choose_unique_old_alarms
        self.changes = None
        self.modified_state = False
        self.old_alarms_lock = threading.Lock()
        # A first call to acquire is needed to set the state to unlocked
        self.old_alarms_lock.acquire()
コード例 #18
0
ファイル: rootw.py プロジェクト: mikpim01/outspline
import wx
import wx.lib.newevent

import outspline.coreaux_api as coreaux_api
from outspline.coreaux_api import Event
import outspline.core_api as core_api

import art
import menubar
import notebooks
import databases
import msgboxes
import logs
import sessions

application_loaded_event = Event()
show_main_window_event = Event()
hide_main_window_event = Event()


class GUI(wx.App):
    def __init__(self):
        self.config = coreaux_api.get_interface_configuration('wxgui')

        wx.App.__init__(self, False)

        self.artprovider = art.ArtProvider()

        self.root = MainFrame()
        self.logs_configuration = logs.LogsConfiguration()