コード例 #1
0
ファイル: voronoi2svg.py プロジェクト: AakashDabas/inkscape
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

"""
# standard library
import sys
import os
# local library
import inkex
import simplestyle
import simplepath
import simpletransform
import voronoi

inkex.localize()

class Point:
  def __init__(self,x,y):
    self.x = x
    self.y = y

class Voronoi2svg(inkex.Effect):
  def __init__(self):
    inkex.Effect.__init__(self)

    #{{{ Additional options

    self.OptionParser.add_option(
      "--tab",
      action="store",
コード例 #2
0
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., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
'''
# standard library
from subprocess import Popen, PIPE
from shutil import copy2
# local library
import inkex

inkex.localize()  # Initialize gettext
if not inkex.sys.platform.startswith('win'):
    exit(_("sorry, this will run only on Windows, exiting..."))


class MyEffect(inkex.Effect):
    def __init__(self):
        inkex.Effect.__init__(self)

    def effect(self):
        file = self.args[-1]
        tempfile = inkex.os.path.splitext(file)[0] + "-prepare.svg"
        # tempfile is needed here only because we want to force the extension to be .svg
        # so that we can open and close it silently
        copy2(file, tempfile)
        p = Popen(
コード例 #3
0
(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., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
'''
# local library
from webslicer_effect import *
import inkex

inkex.localize()


class WebSlicer_CreateGroup(WebSlicer_Effect):
    def __init__(self):
        WebSlicer_Effect.__init__(self)
        self.OptionParser.add_option("--html-id",
                                     action="store",
                                     type="string",
                                     dest="html_id",
                                     help="")
        self.OptionParser.add_option("--html-class",
                                     action="store",
                                     type="string",
                                     dest="html_class",
                                     help="")
コード例 #4
0
ファイル: launch_webbrowser.py プロジェクト: rewolff/inkscape
 def run(self):
     inkex.localize()
     webbrowser.open(_(self.options.url))