From 95317d5c7bd7973a9bdd4c38b01ce20592c532bb Mon Sep 17 00:00:00 2001 From: Stas Shtin Date: Wed, 7 Apr 2010 17:37:56 +0400 Subject: [PATCH] Set focus to first form field when Add button is clicked --- src/.gitignore | 3 +++ src/ipypbx/state.py | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 src/.gitignore create mode 100644 src/ipypbx/state.py diff --git a/src/.gitignore b/src/.gitignore new file mode 100644 index 0000000..eef29c1 --- /dev/null +++ b/src/.gitignore @@ -0,0 +1,3 @@ +*~ +*.pyc + diff --git a/src/ipypbx/state.py b/src/ipypbx/state.py new file mode 100644 index 0000000..4c0915f --- /dev/null +++ b/src/ipypbx/state.py @@ -0,0 +1,40 @@ +# Copyright (c) Stas Shtin, 2010 + +# This file is part of IPyPBX. + +# IPyPBX 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. + +# IPyPBX 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 IPyPBX. If not, see . + +import os +from axiom.store import Store +from ipypbx import models + + +# Working directory path. +PREFIX = os.path.expanduser('~/.ipypbx') + +# Create it if necessary. +if not os.path.exists(PREFIX): + os.path.mkdir(PREFIX, mode='0700') + +# Initialize sqlite DB file. +store = Store(os.path.join(PREFIX, 'ipypbx.db')) + +# Program state data. +connections = list(store.query(models.Connection)) +sipProfiles = [] +domains = [] +gateways = [] +endpoints = [] +extensions = [] + -- 1.7.9.5