QGIS - Python Error on Startup (Ubuntu 18.04)
Use the -n
option.
$ iptables --help
[...]
--numeric -n numeric output of addresses and ports
It is hard to be certain without more information about the overall project. However, from your example, I would not use a conditional here at all. If you do use a conditional, I would look into PGF's .is if
handler, which will make things much easier.
First some keys:
\tikzset{%
We can afford to use verbose names here because the user interface won't require them at all.
Crazymoomin circle/.pic={\draw [fill=Crazymoomin@fill] (.5,.5) circle (0.5);},
Crazymoomin square/.pic={\draw [fill=Crazymoomin@fill] (0,0) -- (0,1) -- (1,1) -- (1,0) -- cycle;},
Crazymoomin triangle/.pic={\draw [fill=Crazymoomin@fill] (0,0) -- (1,0) -- (0.5, 1) -- cycle;},
So that we can use simple key names in the user interface, we'll put them on a custom path, but we'll make sure that standard TikZ keys work here, too.
/Crazymoomin/.search also={/tikz},
Switch paths.
/Crazymoomin/.cd,
Now we can use simple names without overwriting the defaults.
fill/.code={%
This will hold a custom colour.
\colorlet{Crazymoomin@fill}{#1}%
},
And a shape.
shape/.store in=\Crazymoomin@shape,
To handle the colour/shape combo neatly, let's make colour shape
a choice key.
colour shape/.is choice,
Now for the options, which each switch to our path and set the pic
shape and fill.
colour shape/triangle/.style={/Crazymoomin/.cd, shape=triangle, fill=yellow},
colour shape/circle/.style={/Crazymoomin/.cd, shape=circle, fill=red},
colour shape/square/.style={/Crazymoomin/.cd, shape=square, fill=green},
no colour
can just set the fill to white.
no colour/.style={/Crazymoomin/fill=white},
Make sure we have a default for everything.
fill=gray,
shape=circle,
}
Now the command.
\newcommand{\TestCommand}[1][]{%
\tikzset{%
Switch to our path.
/Crazymoomin/.cd,
Default setting. This sets the filling colour anyway, so no colour
is effectively false by default.
colour shape=circle,
User options.
#1,
}%
And the pic
.
\pic {Crazymoomin \Crazymoomin@shape};
}
Then we can write, for example,
\begin{tikzpicture}
\TestCommand[colour shape=triangle, no colour]
\scoped[xshift=12.5mm]{\TestCommand[colour shape=circle, no colour]}
\scoped[xshift=25mm]{\TestCommand[colour shape=square, no colour]}
\scoped[yshift=12.5mm]{\TestCommand[colour shape=triangle]}
\scoped[xshift=12.5mm, yshift=12.5mm]{\TestCommand[colour shape=circle]}
\scoped[xshift=25mm, yshift=12.5mm]{\TestCommand[colour shape=square]}
\end{tikzpicture}
to produce
Obviously this is awkward because I didn't want to mess around too much with \TextCommand
which doesn't have any positioning information (eek!?).
Complete code:
\documentclass[border=10pt,multi,tikz]{standalone}
\makeatletter
\tikzset{%
Crazymoomin circle/.pic={\draw [fill=Crazymoomin@fill] (.5,.5) circle (0.5);},
Crazymoomin square/.pic={\draw [fill=Crazymoomin@fill] (0,0) -- (0,1) -- (1,1) -- (1,0) -- cycle;},
Crazymoomin triangle/.pic={\draw [fill=Crazymoomin@fill] (0,0) -- (1,0) -- (0.5, 1) -- cycle;},
/Crazymoomin/.search also={/tikz},
/Crazymoomin/.cd,
fill/.code={%
\colorlet{Crazymoomin@fill}{#1}%
},
shape/.store in=\Crazymoomin@shape,
colour shape/.is choice,
colour shape/triangle/.style={/Crazymoomin/.cd, shape=triangle, fill=yellow},
colour shape/circle/.style={/Crazymoomin/.cd, shape=circle, fill=red},
colour shape/square/.style={/Crazymoomin/.cd, shape=square, fill=green},
no colour/.style={/Crazymoomin/fill=white},
fill=gray,
shape=circle,
}
\newcommand{\TestCommand}[1][]{%
\tikzset{%
/Crazymoomin/.cd,
colour shape=circle,
#1,
}%
\pic {Crazymoomin \Crazymoomin@shape};
}
\makeatother
\begin{document}
\begin{tikzpicture}
\TestCommand[colour shape=triangle, no colour]
\scoped[xshift=12.5mm]{\TestCommand[colour shape=circle, no colour]}
\scoped[xshift=25mm]{\TestCommand[colour shape=square, no colour]}
\scoped[yshift=12.5mm]{\TestCommand[colour shape=triangle]}
\scoped[xshift=12.5mm, yshift=12.5mm]{\TestCommand[colour shape=circle]}
\scoped[xshift=25mm, yshift=12.5mm]{\TestCommand[colour shape=square]}
\end{tikzpicture}
\end{document}
You can use osslsigncode
for this. It’s not available in your version of Ubuntu, only in 16.10 and later; but it’s easy to build.
To verify a signature, run it as
osslsigncode verify filetoverify