This repository has been archived on 2023-03-25. You can view files and clone it, but cannot push or open issues or pull requests.
mightyscape-1.1-deprecated/extensions/fablabchemnitz/table_support/table_add_columns.py
2021-07-23 02:36:56 +02:00

41 lines
1.3 KiB
Python
Executable File

#!/usr/bin/env python3
"""
table.py
Table support for Inkscape
Copyright (C) 2011 Cosmin Popescu, cosminadrianpopescu@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 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.
"""
import sys
import os
import table
sys.path.append(os.path.dirname(sys.argv[0]))
class Table(table.TableEngine):
def __init__(self):
table.TableEngine.__init__(self, True, True)
opts = [('-n', '--number', 'int', 'number', '1',
'The number of rows'),
('-w', '--where', 'string', 'where', 'after',
'Where to add'),
]
for o in opts:
self.OptionParser.add_option(o[0], o[1], action="store", type=o[2],
dest=o[3], default=o[4], help=o[5])
def doinkex(self):
self.addColumns(self.options.number, self.options.where)
if __name__ == '__main__': #pragma: no cover
Table().run()