python: howto and examples
* Tightening up both the documentation and some of the example code. Tested-by: Ben McGinnes <ben@adversary.org> Signed-off-by: Ben McGinnes <ben@adversary.org>
This commit is contained in:
parent
4308d17281
commit
fbc298dc1b
@ -367,7 +367,7 @@ needed, both by and in order to create, the bindings (including both the
|
|||||||
If specifying a selected number of languages to create bindings for,
|
If specifying a selected number of languages to create bindings for,
|
||||||
try to leave Python last. Currently the majority of the other
|
try to leave Python last. Currently the majority of the other
|
||||||
language bindings are also preceding Python of either version when
|
language bindings are also preceding Python of either version when
|
||||||
listed alphabetically and so that just happens by default currently.
|
listed alphabetically (not counting the Qt bindings).
|
||||||
|
|
||||||
If Python is set to precede one of the other languages then it is
|
If Python is set to precede one of the other languages then it is
|
||||||
possible that the errors described here may interrupt the build
|
possible that the errors described here may interrupt the build
|
||||||
@ -376,6 +376,12 @@ needed, both by and in order to create, the bindings (including both the
|
|||||||
bindings separately with alternative ``configure`` steps for GPGME
|
bindings separately with alternative ``configure`` steps for GPGME
|
||||||
using the ``--enable-languages=$LANGUAGE`` option.
|
using the ``--enable-languages=$LANGUAGE`` option.
|
||||||
|
|
||||||
|
Alternatively ``make`` (or ``gmake``, depending on your platform) may
|
||||||
|
be run with the the ``-k`` option, which tells make to keep going
|
||||||
|
even if errors are encountered. In that case the failure of one
|
||||||
|
language\'s set of bindings to build should not hamper another
|
||||||
|
language\'s bindings to build.
|
||||||
|
|
||||||
.. _snafu-lessons-for-the-lazy:
|
.. _snafu-lessons-for-the-lazy:
|
||||||
|
|
||||||
Reinstalling Responsibly
|
Reinstalling Responsibly
|
||||||
@ -2939,21 +2945,17 @@ information in Python.
|
|||||||
else:
|
else:
|
||||||
gpgconfcmd = "gpgconf --list-options gpg"
|
gpgconfcmd = "gpgconf --list-options gpg"
|
||||||
|
|
||||||
try:
|
process = subprocess.Popen(gpgconfcmd.split(), stdout=subprocess.PIPE)
|
||||||
lines = subprocess.getoutput(gpgconfcmd).splitlines()
|
procom = process.communicate()
|
||||||
except:
|
|
||||||
process = subprocess.Popen(gpgconfcmd.split(), stdout=subprocess.PIPE)
|
|
||||||
procom = process.communicate()
|
|
||||||
if sys.version_info[0] == 2:
|
|
||||||
lines = procom[0].splitlines()
|
|
||||||
else:
|
|
||||||
lines = procom[0].decode().splitlines()
|
|
||||||
|
|
||||||
for i in range(len(lines)):
|
if sys.version_info[0] == 2:
|
||||||
if lines[i].startswith("group") is True:
|
lines = procom[0].splitlines()
|
||||||
line = lines[i]
|
else:
|
||||||
else:
|
lines = procom[0].decode().splitlines()
|
||||||
pass
|
|
||||||
|
for line in lines:
|
||||||
|
if line.startswith("group") is True:
|
||||||
|
break
|
||||||
|
|
||||||
groups = line.split(":")[-1].replace('"', '').split(',')
|
groups = line.split(":")[-1].replace('"', '').split(',')
|
||||||
|
|
||||||
|
@ -397,7 +397,7 @@ both by and in order to create, the bindings (including both the
|
|||||||
If specifying a selected number of languages to create bindings for,
|
If specifying a selected number of languages to create bindings for,
|
||||||
try to leave Python last. Currently the majority of the other
|
try to leave Python last. Currently the majority of the other
|
||||||
language bindings are also preceding Python of either version when
|
language bindings are also preceding Python of either version when
|
||||||
listed alphabetically and so that just happens by default currently.
|
listed alphabetically (not counting the Qt bindings).
|
||||||
|
|
||||||
If Python is set to precede one of the other languages then it is
|
If Python is set to precede one of the other languages then it is
|
||||||
possible that the errors described here may interrupt the build
|
possible that the errors described here may interrupt the build
|
||||||
@ -406,6 +406,12 @@ these cases it may be preferable to configure all preferred language
|
|||||||
bindings separately with alternative =configure= steps for GPGME using
|
bindings separately with alternative =configure= steps for GPGME using
|
||||||
the =--enable-languages=$LANGUAGE= option.
|
the =--enable-languages=$LANGUAGE= option.
|
||||||
|
|
||||||
|
Alternatively =make= (or =gmake=, depending on your platform) may be
|
||||||
|
run with the the =-k= option, which tells make to keep going even if
|
||||||
|
errors are encountered. In that case the failure of one language's
|
||||||
|
set of bindings to build should not hamper another language's bindings
|
||||||
|
to build.
|
||||||
|
|
||||||
|
|
||||||
*** Reinstalling Responsibly
|
*** Reinstalling Responsibly
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
@ -3000,21 +3006,17 @@ if sys.platform == "win32":
|
|||||||
else:
|
else:
|
||||||
gpgconfcmd = "gpgconf --list-options gpg"
|
gpgconfcmd = "gpgconf --list-options gpg"
|
||||||
|
|
||||||
try:
|
process = subprocess.Popen(gpgconfcmd.split(), stdout=subprocess.PIPE)
|
||||||
lines = subprocess.getoutput(gpgconfcmd).splitlines()
|
procom = process.communicate()
|
||||||
except:
|
|
||||||
process = subprocess.Popen(gpgconfcmd.split(), stdout=subprocess.PIPE)
|
|
||||||
procom = process.communicate()
|
|
||||||
if sys.version_info[0] == 2:
|
|
||||||
lines = procom[0].splitlines()
|
|
||||||
else:
|
|
||||||
lines = procom[0].decode().splitlines()
|
|
||||||
|
|
||||||
for i in range(len(lines)):
|
if sys.version_info[0] == 2:
|
||||||
if lines[i].startswith("group") is True:
|
lines = procom[0].splitlines()
|
||||||
line = lines[i]
|
else:
|
||||||
else:
|
lines = procom[0].decode().splitlines()
|
||||||
pass
|
|
||||||
|
for line in lines:
|
||||||
|
if line.startswith("group") is True:
|
||||||
|
break
|
||||||
|
|
||||||
groups = line.split(":")[-1].replace('"', '').split(',')
|
groups = line.split(":")[-1].replace('"', '').split(',')
|
||||||
|
|
||||||
|
@ -566,7 +566,7 @@ IMPORTANT Note
|
|||||||
If specifying a selected number of languages to create bindings for,
|
If specifying a selected number of languages to create bindings for,
|
||||||
try to leave Python last. Currently the majority of the other
|
try to leave Python last. Currently the majority of the other
|
||||||
language bindings are also preceding Python of either version when
|
language bindings are also preceding Python of either version when
|
||||||
listed alphabetically and so that just happens by default currently.
|
listed alphabetically (not counting the Qt bindings).
|
||||||
|
|
||||||
If Python is set to precede one of the other languages then it is
|
If Python is set to precede one of the other languages then it is
|
||||||
possible that the errors described here may interrupt the build
|
possible that the errors described here may interrupt the build
|
||||||
@ -574,6 +574,12 @@ process before generating bindings for those other languages. In
|
|||||||
these cases it may be preferable to configure all preferred language
|
these cases it may be preferable to configure all preferred language
|
||||||
bindings separately with alternative @samp{configure} steps for GPGME using
|
bindings separately with alternative @samp{configure} steps for GPGME using
|
||||||
the @samp{--enable-languages=$LANGUAGE} option.
|
the @samp{--enable-languages=$LANGUAGE} option.
|
||||||
|
|
||||||
|
Alternatively @samp{make} (or @samp{gmake}, depending on your platform) may be
|
||||||
|
run with the the @samp{-k} option, which tells make to keep going even if
|
||||||
|
errors are encountered. In that case the failure of one language's
|
||||||
|
set of bindings to build should not hamper another language's bindings
|
||||||
|
to build.
|
||||||
@end enumerate
|
@end enumerate
|
||||||
|
|
||||||
@node Reinstalling Responsibly
|
@node Reinstalling Responsibly
|
||||||
@ -3139,21 +3145,17 @@ if sys.platform == "win32":
|
|||||||
else:
|
else:
|
||||||
gpgconfcmd = "gpgconf --list-options gpg"
|
gpgconfcmd = "gpgconf --list-options gpg"
|
||||||
|
|
||||||
try:
|
process = subprocess.Popen(gpgconfcmd.split(), stdout=subprocess.PIPE)
|
||||||
lines = subprocess.getoutput(gpgconfcmd).splitlines()
|
procom = process.communicate()
|
||||||
except:
|
|
||||||
process = subprocess.Popen(gpgconfcmd.split(), stdout=subprocess.PIPE)
|
|
||||||
procom = process.communicate()
|
|
||||||
if sys.version_info[0] == 2:
|
|
||||||
lines = procom[0].splitlines()
|
|
||||||
else:
|
|
||||||
lines = procom[0].decode().splitlines()
|
|
||||||
|
|
||||||
for i in range(len(lines)):
|
if sys.version_info[0] == 2:
|
||||||
if lines[i].startswith("group") is True:
|
lines = procom[0].splitlines()
|
||||||
line = lines[i]
|
else:
|
||||||
else:
|
lines = procom[0].decode().splitlines()
|
||||||
pass
|
|
||||||
|
for line in lines:
|
||||||
|
if line.startswith("group") is True:
|
||||||
|
break
|
||||||
|
|
||||||
groups = line.split(":")[-1].replace('"', '').split(',')
|
groups = line.split(":")[-1].replace('"', '').split(',')
|
||||||
|
|
||||||
|
@ -37,21 +37,17 @@ if sys.platform == "win32":
|
|||||||
else:
|
else:
|
||||||
gpgconfcmd = "gpgconf --list-options gpg"
|
gpgconfcmd = "gpgconf --list-options gpg"
|
||||||
|
|
||||||
try:
|
process = subprocess.Popen(gpgconfcmd.split(), stdout=subprocess.PIPE)
|
||||||
lines = subprocess.getoutput(gpgconfcmd).splitlines()
|
procom = process.communicate()
|
||||||
except:
|
|
||||||
process = subprocess.Popen(gpgconfcmd.split(), stdout=subprocess.PIPE)
|
|
||||||
procom = process.communicate()
|
|
||||||
if sys.version_info[0] == 2:
|
|
||||||
lines = procom[0].splitlines()
|
|
||||||
else:
|
|
||||||
lines = procom[0].decode().splitlines()
|
|
||||||
|
|
||||||
for i in range(len(lines)):
|
if sys.version_info[0] == 2:
|
||||||
if lines[i].startswith("group") is True:
|
lines = procom[0].splitlines()
|
||||||
line = lines[i]
|
else:
|
||||||
else:
|
lines = procom[0].decode().splitlines()
|
||||||
pass
|
|
||||||
|
for line in lines:
|
||||||
|
if line.startswith("group") is True:
|
||||||
|
break
|
||||||
|
|
||||||
groups = line.split(":")[-1].replace('"', '').split(',')
|
groups = line.split(":")[-1].replace('"', '').split(',')
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user