Commit ec28f3e2 authored by Christoph Cullmann's avatar Christoph Cullmann

Merge branch 'master' into frameworks

parents b9646d90 5ffdf678
# This file is part of Pate, Kate' Python scripting plugin.
#
# Copyright (C) 2006 Paul Giannaros <paul@giannaros.org>
# Copyright (C) 2012 Shaheed Haque <srhaque@theiet.org>
# Copyright (C) 2012, 2013 Shaheed Haque <srhaque@theiet.org>
# Copyright (C) 2013 Alex Turbov <i.zaufi@gmail.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) version 3.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# This library 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
# Library General Public License for more details.
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# You should have received a copy of the GNU Library General Public License
# along with this library; see the file COPYING.LIB. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
# Boston, MA 02110-1301, USA.
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# by default only QtCore and QtGui modules are enabled
# other modules must be enabled like this:
......
// This file is part of Pate, Kate' Python scripting plugin.
//
// Copyright (C) 2006 Paul Giannaros <paul@giannaros.org>
// Copyright (C) 2012 Shaheed Haque <srhaque@theiet.org>
// Copyright (C) 2012, 2013 Shaheed Haque <srhaque@theiet.org>
// Copyright (C) 2013 Alex Turbov <i.zaufi@gmail.com>
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) version 3.
// version 2.1 of the License, or (at your option) version 3, or any
// later version accepted by the membership of KDE e.V. (or its
// successor approved by the membership of KDE e.V.), which shall
// act as a proxy defined in Section 6 of version 3 of the license.
//
// This library 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
// Library General Public License for more details.
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library. If not, see <http://www.gnu.org/licenses/>.
//
// You should have received a copy of the GNU Library General Public License
// along with this library; see the file COPYING.LIB. If not, write to
// the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
// Boston, MA 02110-1301, USA.
#include "engine.h"
......
// This file is part of Pate, Kate' Python scripting plugin.
//
// Copyright (C) 2006 Paul Giannaros <paul@giannaros.org>
// Copyright (C) 2012 Shaheed Haque <srhaque@theiet.org>
// Copyright (C) 2012, 2013 Shaheed Haque <srhaque@theiet.org>
// Copyright (C) 2013 Alex Turbov <i.zaufi@gmail.com>
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) version 3.
// version 2.1 of the License, or (at your option) version 3, or any
// later version accepted by the membership of KDE e.V. (or its
// successor approved by the membership of KDE e.V.), which shall
// act as a proxy defined in Section 6 of version 3 of the license.
//
// This library 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
// Library General Public License for more details.
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library. If not, see <http://www.gnu.org/licenses/>.
//
// You should have received a copy of the GNU Library General Public License
// along with this library; see the file COPYING.LIB. If not, write to
// the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
// Boston, MA 02110-1301, USA.
#ifndef __PATE_ENGINE_H__
# define __PATE_ENGINE_H__
......
......@@ -46,7 +46,6 @@ from .decorators import *
@pateEventHandler('_pluginLoaded')
def on_load(plugin):
kDebug('Loading Pate plugin: {}'.format(plugin))
if plugin in init.functions:
# Call registered init functions for the plugin
init.fire(plugin=plugin)
......@@ -56,7 +55,6 @@ def on_load(plugin):
@pateEventHandler('_pluginUnloading')
def on_unload(plugin):
kDebug('Unloding Pate plugin: {}'.format(plugin))
if plugin in unload.functions:
# Deinitialize plugin
unload.fire(plugin=plugin)
......
......@@ -22,6 +22,7 @@
'''Provide shortcuts to access kate internals from plugins'''
import contextlib
import os
import sys
......@@ -93,6 +94,11 @@ def applicationDirectories(*path):
return kdecore.KGlobal.dirs().findDirs('appdata', path)
def findApplicationResource(*path):
path = os.path.join('pate', *path)
return kdecore.KGlobal.dirs().findResource('appdata', path)
def objectIsAlive(obj):
''' Test whether an object is alive; that is, whether the pointer
to the object still exists. '''
......@@ -111,3 +117,15 @@ def kDebug(text):
'''
plugin = sys._getframe(1).f_globals['__name__']
pate.kDebug('{}: {}'.format(plugin, text))
@contextlib.contextmanager
def makeAtomicUndo(document):
''' Context manager to make sure startEditing syncronized w/
endEditing for particular document.
'''
document.startEditing()
try:
yield
finally:
document.endEditing()
......@@ -233,9 +233,18 @@ def action(func):
''' Decorator that adds an action to the menu bar. When the item is fired,
your function is called
'''
plugin = sys._getframe(1).f_globals['__name__']
frame = sys._getframe(1)
plugin = frame.f_globals['__name__']
kDebug('@action: {}/{}'.format(plugin, func.__name__))
ui_file = kdecore.KGlobal.dirs().findResource('appdata', 'pate/{}_ui.rc'.format(plugin))
# Get directory where plugin resides
filename = frame.f_globals['__file__']
dirname = os.path.dirname(filename)
pate_pos = dirname.find('pate')
assert(pate_pos != -1)
dirname = dirname[pate_pos:]
filename = os.path.join(dirname, '{}_ui.rc'.format(plugin))
ui_file = kdecore.KGlobal.dirs().findResource('appdata', filename)
if not ui_file:
ui_file = kdecore.KGlobal.dirs().findResource('appdata', 'pate/{}/{}_ui.rc'.format(plugin, plugin))
if not ui_file:
......@@ -243,7 +252,7 @@ def action(func):
return func
# Found UI resource file
#kDebug('ui_file={}'.format(repr(ui_file)))
kDebug('ui_file={}'.format(repr(ui_file)))
# Get the XML GUI client or create a new one
clnt = None
......
// This file is part of Pate, Kate' Python scripting plugin.
//
// Copyright (C) 2006 Paul Giannaros <paul@giannaros.org>
// Copyright (C) 2012 Shaheed Haque <srhaque@theiet.org>
// Copyright (C) 2012, 2013 Shaheed Haque <srhaque@theiet.org>
// Copyright (C) 2013 Alex Turbov <i.zaufi@gmail.com>
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) version 3.
// version 2.1 of the License, or (at your option) version 3, or any
// later version accepted by the membership of KDE e.V. (or its
// successor approved by the membership of KDE e.V.), which shall
// act as a proxy defined in Section 6 of version 3 of the license.
//
// This library 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
// Library General Public License for more details.
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library. If not, see <http://www.gnu.org/licenses/>.
//
// You should have received a copy of the GNU Library General Public License
// along with this library; see the file COPYING.LIB. If not, write to
// the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
// Boston, MA 02110-1301, USA.
#include "plugin.h"
#include "engine.h"
......
// This file is part of Pate, Kate' Python scripting plugin.
//
// Copyright (C) 2006 Paul Giannaros <paul@giannaros.org>
// Copyright (C) 2012 Shaheed Haque <srhaque@theiet.org>
// Copyright (C) 2012, 2013 Shaheed Haque <srhaque@theiet.org>
// Copyright (C) 2013 Alex Turbov <i.zaufi@gmail.com>
//
// This library is free software; you can redistribute it and/or
......@@ -18,6 +18,7 @@
// along with this library; see the file COPYING.LIB. If not, write to
// the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
// Boston, MA 02110-1301, USA.
//
#ifndef _PATE_PLUGIN_H_
# define _PATE_PLUGIN_H_
......
# Copyright (C) 2012, 2013 Shaheed Haque <srhaque@theiet.org>
#
# Install plugins that work with either Python 2 or 3
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
#
# Install .desktop files for individual plugins
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
install(
FILES
gid/katepate_gid.desktop
katepate_block.desktop
katepate_color_tools.desktop
katepate_commentar.desktop
katepate_format.desktop
katepate_python_autocomplete_jedi.desktop
katepate_try_open_file.desktop
katepate_xml_pretty.desktop
python_console_classic/katepate_python_console_classic.desktop
python_console_ipython/katepate_python_console_ipython.desktop
DESTINATION ${SERVICES_INSTALL_DIR}
)
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
include(CMakeParseArguments)
#
# Install individual Pate plugins.
#
install(
FILES
block.py block_ui.rc
color_tools.py color_tools_ui.rc color_tools_toolview.ui
commentar.py commentar_config.ui commentar_ui.rc
format.py format_ui.rc
python_autocomplete_jedi.py
try_open_file.py try_open_file_ui.rc
xml_pretty.py xml_pretty.ui xml_pretty_ui.rc
DESTINATION ${DATA_INSTALL_DIR}/kate/pate
)
# Simple helper function to install plugin and related files
# having only a name of the plugin...
# (just to reduce syntactic noise when a lot of plugins get installed)
#
# Install various directories w/ plugins
#
install(
DIRECTORY
django_utils
gid
libkatepate
python_console_classic
python_utils
DESTINATION ${DATA_INSTALL_DIR}/kate/pate
FILES_MATCHING PATTERN "*.py" PATTERN "*.ui" PATTERN "*.rc"
)
install(
DIRECTORY python_console_ipython
DESTINATION ${DATA_INSTALL_DIR}/kate/pate
FILES_MATCHING PATTERN "*.py" PATTERN "*.ui" PATTERN "*.css"
)
function(install_pate_plugin name)
set(_options)
set(_one_value_args)
set(_multi_value_args PATTERNS FILE)
cmake_parse_arguments(install_pate_plugin "${_options}" "${_one_value_args}" "${_multi_value_args}" ${ARGN})
if(NOT name)
message(FATAL_ERROR "Plugin filename is not given")
endif()
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${name}.py)
install(FILES katepate_${name}.desktop DESTINATION ${SERVICES_INSTALL_DIR})
foreach(_f ${name}.py ${name}.ui ${name}_ui.rc ${install_pate_plugin_FILE})
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${_f})
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${_f} DESTINATION ${DATA_INSTALL_DIR}/kate/pate)
endif()
endforeach()
elseif(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${name})
install(FILES ${name}/katepate_${name}.desktop DESTINATION ${SERVICES_INSTALL_DIR})
install(
DIRECTORY ${name}
DESTINATION ${DATA_INSTALL_DIR}/kate/pate
FILES_MATCHING
PATTERN "*.py"
PATTERN "*.ui"
PATTERN "*_ui.rc"
PATTERN "__pycache__*" EXCLUDE
)
# TODO Is there any way to form a long PATTERN options string
# and use it in a single install() call?
# NOTE Install specified patterns one-by-one...
foreach(_pattern ${install_pate_plugin_PATTERNS})
install(
DIRECTORY ${name}
DESTINATION ${DATA_INSTALL_DIR}/kate/pate
FILES_MATCHING
PATTERN "${_pattern}"
PATTERN "__pycache__*" EXCLUDE
)
endforeach()
else()
message(FATAL_ERROR "Do not know what to do with ${name}")
endif()
endfunction()
# TODO The following plugins must be ported to new style...
# install_pate_plugin(django_utils)
# install_pate_plugin(gdb)
install_pate_plugin(block)
install_pate_plugin(color_tools FILE color_tools_toolview.ui)
install_pate_plugin(commentar)
install_pate_plugin(format)
install_pate_plugin(gid)
install_pate_plugin(python_autocomplete_jedi)
install_pate_plugin(python_console_classic)
install_pate_plugin(python_console_ipython PATTERNS "*.css")
install_pate_plugin(python_utils)
install_pate_plugin(try_open_file)
install_pate_plugin(xml_pretty)
#
# Install plugins that work only with Python 3 iff we're building against it
#
if(PYTHON_VERSION_MAJOR VERSION_EQUAL 3)
install(
FILES
cmake_utils/katepate_cmake_utils.desktop
katepate_expand.desktop
js_utils/katepate_js_utils.desktop
DESTINATION ${SERVICES_INSTALL_DIR}
)
install(
FILES expand.py expand_ui.rc
DESTINATION ${DATA_INSTALL_DIR}/kate/pate
)
install(
DIRECTORY cmake_utils
DESTINATION ${DATA_INSTALL_DIR}/kate/pate
FILES_MATCHING PATTERN "*.py" PATTERN "*.ui" PATTERN "*.rc"
)
install(
DIRECTORY expand
DESTINATION ${DATA_INSTALL_DIR}/kate/pate
FILES_MATCHING PATTERN "*.py" PATTERN "*.ui" PATTERN "*.rc" PATTERN "*.expand"
)
install(
DIRECTORY js_utils
DESTINATION ${DATA_INSTALL_DIR}/kate/pate
FILES_MATCHING PATTERN "*.py" PATTERN "*.ui" PATTERN "*.json" PATTERN "*.js" PATTERN "*.rc"
)
install_pate_plugin(cmake_utils)
install_pate_plugin(js_utils PATTERNS "*.json" "*.js")
install_pate_plugin(expand PATTERNS "*.expand" "templates/*.tpl")
endif()
#
# Install plugins that work only with Python 2 iff we're building against it
#
if(PYTHON_VERSION_MAJOR VERSION_EQUAL 2)
install(
FILES python_autocomplete/katepate_python_autocomplete.desktop
DESTINATION ${SERVICES_INSTALL_DIR}
)
install(
DIRECTORY python_autocomplete
DESTINATION ${DATA_INSTALL_DIR}/kate/pate
FILES_MATCHING PATTERN "*.py" PATTERN "*.ui" PATTERN "*.rc"
)
install_pate_plugin(python_autocomplete)
endif()
# kate: indent-width 4;
install(
DIRECTORY libkatepate
DESTINATION ${DATA_INSTALL_DIR}/kate/pate
FILES_MATCHING
PATTERN "*.py"
PATTERN "__pycache__*" EXCLUDE
)
......@@ -3,6 +3,7 @@ Type=Service
ServiceTypes=Kate/PythonPlugin
X-KDE-Library=cmake_utils
Name=CMake Utilities
Name[cs]=Nástroje CMake
Name[de]=CMake-Dienstprogramme
Name[es]=Utilidades CMake
Name[fi]=CMake-työkalut
......@@ -24,6 +25,7 @@ Name[uk]=Інструменти CMake
Name[x-test]=xxCMake Utilitiesxx
Name[zh_TW]=CMake 工具
Comment=Code completer, cache and help browser
Comment[cs]=Doplňování kódu, mezipaměť a prohlížeč nápovědy
Comment[de]=Quelltext-Vervollständigung, Zwischenspeicher und Hilfe-Browser
Comment[fi]=Koodintäydennys sekä välimuistin ja ohjeiden selain
Comment[gl]=Varias accións para axudar na edición de código
......
......@@ -739,7 +739,7 @@ class ConfigWidget(QWidget):
super(ConfigWidget, self).__init__(parent)
# Set up the user interface from Designer.
uic.loadUi(os.path.join(os.path.dirname(__file__), 'commentar_config.ui'), self)
uic.loadUi(os.path.join(os.path.dirname(__file__), 'commentar.ui'), self)
self.reset();
......
# -*- coding: utf-8 -*-
# This file is part of Pate, Kate' Python scripting plugin.
#
# Copyright (C) 2006 Paul Giannaros <paul@giannaros.org>
# Copyright (C) 2013 Alex Turbov <i.zaufi@gmail.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) version 3.
#
# This library 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
# Library General Public License for more details.
#
# You should have received a copy of the GNU Library General Public License
# along with this library; see the file COPYING.LIB. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
# Boston, MA 02110-1301, USA.
'''User-defined text expansions.
Each text expansion is a simple function which must return a string.
This string will be inserted into a document by the expandAtCursor action.
For example if you have a function "foo" in then all.expand file
which is defined as:
def foo:
return 'Hello from foo!'
after typing "foo", the action will replace "foo" with "Hello from foo!".
The expansion function may have parameters as well. For example, the
text_x-c++src.expand file contains the "cl" function which creates a class
(or class template). This will expand "cl(test)" into:
/**
* \\brief Class \c test
*/
class test
{
public:
/// Default constructor
explicit test()
{
}
/// Destructor
virtual ~test()
{
}
};
but "cl(test, T1, T2, T3)" will expand to:
/**
* \\brief Class \c test
*/
template <typename T1, typename T2, typename T3>
class test
{
public:
/// Default constructor
explicit test()
{
}
/// Destructor
virtual ~test()
{
}
};
'''
from .udf import *
from libkatepate.autocomplete import AbstractCodeCompletionModel
@kate.action
def getHelpOnExpandAtCursorAction():
getHelpOnExpandAtCursor()
@kate.action
def expandAtCursorAction():
expandAtCursor()
class ExpandsCompletionModel(AbstractCodeCompletionModel):
TITLE_AUTOCOMPLETION = i18nc('@label:listbox', 'Expands Available')
GROUP_POSITION = AbstractCodeCompletionModel.GroupPosition.GLOBAL
def completionInvoked(self, view, word, invocationType):
self.reset()
# NOTE Do not allow automatic popup cuz most of expanders are short
# and it will annoying when typing code...
if invocationType == 0:
return
expansions = getExpansionsFor(view.document().mimeType())
for exp, fn_tuple in expansions.items():
# Try to get a function description (very first line)
d = fn_tuple[0].__doc__
if d is not None:
lines = d.splitlines()
d = lines[0].strip().replace('<br/>', '')
# Get function parameters
fp = inspect.getargspec(fn_tuple[0])
args = fp[0]
params=''
if len(args) != 0:
params = ", ".join(args)
if fp[1] is not None:
if len(params):
params += ', '
params += '['+fp[1]+']'
# Append to result completions list
self.resultList.append(
self.createItemAutoComplete(text=exp, description=d, args='('+params+')')
)
def reset(self):
self.resultList = []
def _reset(*args, **kwargs):
expands_completation_model.reset()
@kate.viewCreated
def createSignalAutocompleteExpands(view=None, *args, **kwargs):
view = view or kate.activeView()
if view:
cci = view.codeCompletionInterface()
cci.registerCompletionModel(expands_completation_model)
expands_completation_model = ExpandsCompletionModel(kate.application)
expands_completation_model.modelReset.connect(_reset)
def jinja(template):
''' Decorator to tell to the expand engine that decorated function
wants to use jinja2 template to render, instead of 'legacy'
(document.insertText()) way...
'''
def _decorator(func):
func.template = template
return func
return _decorator
def postprocess(func):
''' Decorator to tell to the expand engine that decorated function
wants to use TemplateInterface2 to insert text, so user may
tune a rendered template...
'''
func.use_template_iface = True
return func
# -*- coding: utf-8 -*-
#
''' Helpers to handle parameters in user defined expansion functions. '''
#
# This file is part of Pate, Kate' Python scripting plugin.
#
# Copyright (C) 2010-2013 Alex Turbov <i.zaufi@gmail.com>
#
# 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 3 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, see <http://www.gnu.org/licenses/>.
import re
_TEMPLATE_SEQ_PARAMS = re.compile('([^0-9]+)([0-9]+)\.\.([0-9]+)')