# Copyright (C) 2003 Konstantin Korikov
# 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
importer_class = "TestImporter"
import ConfigParser
import re
import os.path
import importer
import chestnut_dialer.account_set
class TestImporter(chestnut_dialer.account_set.AccountSet):
"Test Importer"
constructor_args = (
{
"name": "file_name",
"type": "filename",
"display": "Source File",
"default": os.path.expanduser("~/test.txt"),
"description": "Enter file name"},
{
"name": "s",
"type": "string",
"display": "Enter something",
"default": "Hello",
"description": "String argument test"},
{
"name": "opt",
"type": "option",
"display": "Select something",
"options": (("One", 1), ("Two", 2), ("Three", 3)),
"default": 2,
"description": "Option argument test"},
{
"name": "bl",
"type": "boolean",
"display": "It worked?",
"default": 1},
{
"name": "i",
"type": "integer",
"display": "Enter number",
"default": 8}
)
program = "test"
def __init__(self, file_name, s, opt, bl, i):
raise importer.ConstructImporterException(
"s='%s' opt=%d bl=%d i=%d" % (s, opt, bl, i))
def ls_accounts(self):
accounts = []
return accounts
def get_account(self, account_id):
return None
|