def __init__(self):
        Effect.__init__(self)

        # Two ways to get debug info:
        # OR just use inkex.debug(string) instead...
        try:
            self.tty = open("/dev/tty", 'w')
        except:
            self.tty = open(os.devnull, 'w')  # '/dev/null' for POSIX, 'nul' for Windows.
            # print >>self.tty, "gears-dev " + __version__

        self.OptionParser.add_option("--input_filename")
        self.OptionParser.add_option("--overwrite", default=False, **boolParams)
        self.OptionParser.add_option("--change_fill", default=False, **boolParams)
        self.OptionParser.add_option("--change_lines", default=False, **boolParams)
        self.OptionParser.add_option("--change_opacity", default=False, **boolParams)

        self.OptionParser.add_option("--color_space", default="rgb")
        self.OptionParser.add_option("--grayscale", default=False, **boolParams)
        self.OptionParser.add_option("--tones", default=False, **boolParams)
        self.OptionParser.add_option("--randomness", type="int", default=15, help=u"Procentní vyjádření jak moc může barva ustřelit do jakéhokoli směru (0 => plynulé přechody; 100 => kompletně random)")
        self.OptionParser.add_option("--colors", type="str", help=u"list barev (formát rrggbb (hexa)) jejichž variace mají být použité")

        self.OptionParser.add_option("--lines_width", type="float", default=0.0)
        self.OptionParser.add_option("--lines_color", default="#ffffff")

        self.OptionParser.add_option("--remove_opacity", default=False, **boolParams)
        self.OptionParser.add_option("--opacity_start", type="float", default=1.0)
        self.OptionParser.add_option("--opacity_end", type="float", default=0.0)
        self.OptionParser.add_option("--opacity_formula", default="1/x")

        self.OptionParser.add_option("--active-tab", help="no use in CLI")
    def __init__(self):
        Effect.__init__(self)

        addFn, typeFloat, typeInt, typeString, typeBool = getAddFnTypes(self)

        addFn( '--tab',  action = 'store', type = typeString, dest = 'tab', \
            default = 'splash', help = 'The active tab when Apply was pressed')

        addFn( '--action', action = 'store', type = typeString, dest = 'action', \
            default = 'render', help = 'The active option when Apply was pressed' )

        addFn( '--text', action = 'store', type = typeString, dest = 'text', \
            default = 'Hello World', help = 'The input text to render')

        addFn( '--filePath', action = 'store', type = typeString, dest = 'filePath', \
            default = '', help = 'Complete path of the text file')

        addFn( '--fontName', action = 'store', type = typeString, dest = 'fontName', \
            default = 'Script',  help = 'The custom font to be used for rendering')

        addFn( '--fontName2', action = 'store', type = typeString, dest = 'fontName2', \
            default = 'Script',  help = 'The custom font to be used for rendering 2')

        addFn( '--fontName3', action = 'store', type = typeString, dest = 'fontName3', \
            default = 'Script',  help = 'The custom font to be used for rendering 3')

        addFn( '--fontName4', action = 'store', type = typeString, dest = 'fontName4', \
            default = 'Script',  help = 'The custom font to be used for rendering 4')

        addFn('--fontSize', action = 'store', type = typeFloat, dest = 'fontSize', \
            default = '100', help = 'Size of the font')

        addFn('--charSpacing', action = 'store', type = typeFloat, dest = 'charSpacing', \
            default = '1', help = 'Spacing between characters')

        addFn('--wordSpacing', action = 'store', type = typeFloat, dest = 'wordSpacing', \
            default = '1', help = 'Spacing between words')

        addFn('--lineSpacing', action = 'store', type = typeFloat, dest = 'lineSpacing', \
            default = '1.5', help = 'Spacing between the lines')

        addFn('--flowInBox', action = 'store', type = typeBool, dest = 'flowInBox', \
            default = False, help = 'Fit the text in the selected rectangle objects')

        addFn('--margin', action = 'store', type = typeFloat, dest = 'margin', default = '.1', \
          help = 'Inside margin of text within the box')

        addFn( '--hAlignment', action='store', type = typeString, dest = 'hAlignment', \
            default = 'left',  help='Horizontal text alignment within the box')

        addFn( '--vAlignment', action='store', type = typeString, dest = 'vAlignment', \
            default = 'none',  help='Vertical text alignment within the box')

        addFn( '--expandDir', action='store', type = typeString, dest = 'expandDir', \
            default = 'x', help='Create new rectangles if text doesn\'t fit the selected ones')

        addFn('--expandDist', action = 'store', type = typeFloat, dest = 'expandDist', \
            default = True, help = 'Offset distance between the newly created rectangles')
 def __init__(self):
     Effect.__init__(self)
     self.arg_parser.add_argument("--tab")
     self.arg_parser.add_argument("--endpoints",
                                  dest="endpoints",
                                  action="store",
                                  type=Bool,
                                  default="true")
     self.arg_parser.add_argument("--controlpoints",
                                  dest="controlpoints",
                                  action="store",
                                  type=Bool,
                                  default="false")
예제 #4
0
    def __init__(self):
        Effect.__init__(self)

        addFn, typeFloat, typeInt, typeString, typeBool = getAddFnTypes(self)

        addFn( "--fontName", action = "store", type = typeString, dest = "fontName", \
            default = 'Script', help = "The custom font to edit")

        addFn('--rowCnt', action = 'store', type = typeInt, dest = 'rowCnt', \
            default = '5', help = 'Number of rows (horizontal guides) in the template')

        addFn('--fontSize', action = 'store', type = typeInt, dest = 'fontSize', \
            default = '100', help = 'Size of the source glyphs to be rendered')

        addFn("--tab", action = "store", type = typeString, dest = "tab", \
            default = "sampling", help = "Tab")
  def __init__(self):
    Effect.__init__(self)

    self.arg_parser.add_argument("--tab")
    self.arg_parser.add_argument("--csv_file",        dest="csv_file",      action="store", type=str,  default="")
    self.arg_parser.add_argument("--csv_encoding",    dest="csv_encoding",  action="store", type=str,  default="utf-8")
    self.arg_parser.add_argument("--csv_delimiter",   dest="csv_delimiter", action="store", type=str,  default=";")
    self.arg_parser.add_argument("--csv_columnx",     dest="xidx",          action="store", type=int,  default=0)
    self.arg_parser.add_argument("--csv_columny",     dest="yidxs",         action="store", type=str,  default="1")
    self.arg_parser.add_argument("--csv_ignorefirst", dest="ignorefirst",   action="store", type=int,  default=0)
    self.arg_parser.add_argument("--csv_storedata",   dest="storedata",     action="store", type=Bool, default="false")
    
    self.arg_parser.add_argument("--xaxis_format"   ,  dest="xformat"   , action="store", type=str,   default="")
    self.arg_parser.add_argument("--xaxis_min"      ,  dest="xmin"      , action="store", type=float, default=0)
    self.arg_parser.add_argument("--xaxis_max"      ,  dest="xmax"      , action="store", type=float, default=100)
    self.arg_parser.add_argument("--xaxis_min_autodetect",  dest="xmin_autodetect" , action="store", type=Bool, default="true")
    self.arg_parser.add_argument("--xaxis_max_autodetect",  dest="xmax_autodetect" , action="store", type=Bool, default="true")
    self.arg_parser.add_argument("--xaxis_tick_n"   ,  dest="xtickn"    , action="store", type=int,   default=10)
    self.arg_parser.add_argument("--xaxis_subtick_n",  dest="xsubtickn" , action="store", type=int,   default=0)
    self.arg_parser.add_argument("--xaxis_ticksin"  ,  dest="xticksin"  , action="store", type=Bool, default="true")
    self.arg_parser.add_argument("--xaxis_ticksout" ,  dest="xticksout" , action="store", type=Bool, default="false")
    self.arg_parser.add_argument("--xaxis_grid"     ,  dest="xgrid"     , action="store", type=Bool, default="false")
    
    self.arg_parser.add_argument("--yaxis_format"   ,  dest="yformat"   , action="store", type=str,   default="")
    self.arg_parser.add_argument("--yaxis_min"      ,  dest="ymin"      , action="store", type=float, default=0)
    self.arg_parser.add_argument("--yaxis_max"      ,  dest="ymax"      , action="store", type=float, default=100)
    self.arg_parser.add_argument("--yaxis_min_autodetect",  dest="ymin_autodetect" , action="store", type=Bool, default="true")
    self.arg_parser.add_argument("--yaxis_max_autodetect",  dest="ymax_autodetect" , action="store", type=Bool, default="true")
    self.arg_parser.add_argument("--yaxis_tick_n"   ,  dest="ytickn"    , action="store", type=int,   default=10)
    self.arg_parser.add_argument("--yaxis_subtick_n",  dest="ysubtickn" , action="store", type=int,   default=0)
    self.arg_parser.add_argument("--yaxis_ticksin"  ,  dest="yticksin"  , action="store", type=Bool, default="true")
    self.arg_parser.add_argument("--yaxis_ticksout" ,  dest="yticksout" , action="store", type=Bool, default="false")
    self.arg_parser.add_argument("--yaxis_grid"     ,  dest="ygrid"     , action="store", type=Bool, default="false")

    self.arg_parser.add_argument("--border_create_left"  , dest="border_left"  , action="store", type=Bool, default="true")
    self.arg_parser.add_argument("--border_create_bottom", dest="border_bottom", action="store", type=Bool, default="true")
    self.arg_parser.add_argument("--border_create_right" , dest="border_right" , action="store", type=Bool, default="true")
    self.arg_parser.add_argument("--border_create_top"   , dest="border_top"   , action="store", type=Bool, default="true")
    
    self.arg_parser.add_argument("--label_title", dest="label_title", type=str, action="store", default="")
    self.arg_parser.add_argument("--label_xaxis", dest="label_xaxis", type=str, action="store", default="")
    self.arg_parser.add_argument("--label_yaxis", dest="label_yaxis", type=str, action="store", default="")
    self.arg_parser.add_argument("--font_family", dest="font_family", type=str, action="store", default="sans")
    
    self.arg_parser.add_argument("--stroke_width"     , dest="stroke_width"     , type=float, action="store", default="1")
    self.arg_parser.add_argument("--stroke_width_unit", dest="stroke_width_unit", type=str  , action="store", default="px")
    self.arg_parser.add_argument("--shape_remove_old" , dest="remove", action="store", type=Bool, default="false")
    def __init__(self):
        InkscapeEffect.__init__(self)
        self.parser = argparse.ArgumentParser()

        self.parser.add_argument("--id", action='append', type=str, dest='ids', default=[],
            help='id attribute of object to manipulate')
        self.parser.add_argument('filename',
            help='temporary file on which extension will operate')
        self.parser.add_argument('-f', '--csv_file', type=str, default = '/home',
            help = 'CSV file to read names from')
        self.parser.add_argument('-n', '--csv_field_num', type=int, default = 1,
            help = 'Number of the field number that contains strings we want to vectorize, starts at 1')
        self.parser.add_argument('-l', '--separate_sizes', type=str_to_bool, default = False,
            help = 'Separate names for different sized graments onto different layers')
        self.parser.add_argument('-s', '--size_field_num', type=int, default = 1,
            help = 'Field number containing size for a given name')
        self.filename = sys.argv[-1]
예제 #7
0
 def __init__(self):
     Effect.__init__(self)
     NSS[u'xmoto'] = u'http://xmoto.tuxfamily.org/'
     # in the svgs created by inkscape 0.46, in the cc:Work node,
     # the cc refers to the creativecommons namespace, not the
     # web.resource one put in inkex
     NSS[u'cc'] = u'http://creativecommons.org/ns#'
     # todo::get perfect values for width and height
     SPRITES['PlayerStart'] = {
         'file': '__biker__.png',
         'width': '2.10',
         'height': '2.43',
         'centerX': '1.05',
         'centerY': '0.0'
     }
     # default values to populate windows
     self.svg = SvgDoc()
     # always the same seed to always generate the same random numbers
     # so that generated unittests works
     random.seed(1234567890)
    def __init__(self):
        Effect.__init__(self)

        addFn, typeFloat, typeInt, typeString, typeBool = getAddFnTypes(self)

        addFn('--rowCnt', action = 'store', type = typeInt, dest = 'rowCnt', default = '5', \
          help = 'Number of rows (horizontal guides) in the template')

        addFn("--createGlyphs", action="store", type=typeBool, dest="createGlyphs", \
            default=True, help = 'Render glyphs of the source font family for tracing ')

        addFn('--srcFontFamily', action = 'store', type = typeString, dest = 'srcFontFamily', \
          help = 'Exact name of the source font family')

        addFn('--fontSize', action = 'store', type = typeInt, dest = 'fontSize', default = '100', \
          help = 'Size of the source glyphs to be rendered')

        addFn('--spaceWidth', action = 'store', \
          type = typeInt, dest = 'spaceWidth', default = '50', \
          help = 'Width of the space character (generally 1/3 to 1/2 times the font size')

        addFn('--fontType', action = 'store', type = typeString, dest = 'fontType', \
            default = 'normal', help = 'Font Style')

        addFn('--startGlyph', action = 'store', type = typeString, dest = 'startGlyph', \
            default = '0', help = 'Starting glyph to be rendered')

        addFn('--glyphCnt', action = 'store', type = typeInt, dest = 'glyphCnt', \
            default = '75', help = 'Number of template glyphs')

        addFn("--rvGuides", action = "store", type = typeBool, dest = "rvGuides", \
            default = False, help = 'Render vertical guide at the right of each glyph')

        addFn("--fillOpacity", action = "store", type = typeFloat, dest = "fillOpacity", \
            default = False, help = 'Fill opacity of source glyph')

        addFn("--strokeOpacity", action = "store", type = typeFloat, dest = "strokeOpacity", \
            default = False, help = 'Stroke opacity of source glyph')

        addFn("--tab", action = "store", type = typeString, dest = "tab", \
            default = "sampling", help="Tab")
예제 #9
0
    def __init__(self):
        InkscapeEffect.__init__(self)
        self.parser = argparse.ArgumentParser()

        self.parser.add_argument("--id",
                                 action='append',
                                 type=str,
                                 dest='ids',
                                 default=[],
                                 help='id attribute of object to manipulate')
        self.parser.add_argument(
            'filename', help='temporary file on which extension will operate')
        self.parser.add_argument('-f',
                                 '--csv_file',
                                 type=str,
                                 default='/home',
                                 help='CSV file to read names from')
        self.parser.add_argument(
            '-n',
            '--csv_field_num',
            type=int,
            default=1,
            help=
            'Number of the field number that contains strings we want to vectorize, starts at 1'
        )
        self.parser.add_argument(
            '-l',
            '--separate_sizes',
            type=str_to_bool,
            default=False,
            help=
            'Separate names for different sized graments onto different layers'
        )
        self.parser.add_argument(
            '-s',
            '--size_field_num',
            type=int,
            default=1,
            help='Field number containing size for a given name')
        self.filename = sys.argv[-1]
예제 #10
0
 def __init__(self):
     InkscapeEffect.__init__(self)
     self.filename = sys.argv[-1]
예제 #11
0
 def __init__(self):
     InkscapeEffect.__init__(self)
     self.filename = sys.argv[-1]
예제 #12
0
 def __init__(self):
     Effect.__init__(self)
예제 #13
0
 def __init__(self):
     InkscapeEffect.__init__(self)
     self.arg_parser.add_argument("--gap_x", type=int, default="10")
     self.arg_parser.add_argument("--gap_y", type=int, default="10")