search for: argparse

Displaying 19 results from an estimated 19 matches for "argparse".

Did you mean: argbase
2014 Jun 26
4
[LLVMdev] Python version requirement for LLVM
http://llvm.org/docs/GettingStarted.html currently mentions Python 2.5 as a minimum required version. I'd like to use argparse <https://docs.python.org/dev/library/argparse.html> in a script and be able to test this script. This requires Python 2.7. This version has been around since 2010, and afaiu, is available on all modern platforms. Is there any reason not to change minimum required version of Python to 2.7? --...
2015 Aug 20
1
Fwd: ABRT Daemon/sosreport disaster
...ibexec/abrt-action-generate-machine-id hostname: XXX.XXXXXXXXXXX.co.uk kernel: 2.6.32-573.3.1.el6.i686 last_occurrence: 1439890409 time: Tue 18 Aug 2015 10:33:44 BST uid: 0 backtrace: :abrt-action-generate-machine-id:24:<module>:ImportError: No module named argparse : :Traceback (most recent call last): : File "/usr/libexec/abrt-action-generate-machine-id", line 24, in <module> : from argparse import ArgumentParser :ImportError: No module named argparse : :Local variables in innermost frame: :__builtins__: <module '__builtin__' (...
2022 Nov 04
3
[libnbd PATCH v2 0/3] Improve nbdsh -u handling
v1 was here: https://listman.redhat.com/archives/libguestfs/2022-October/030216.html Since then, I've incorporated changes based on Rich's feedback: swap order of patches 2 and 3 less change in patch 1 (including no unsafe eval(%s) for --uri) in patch 2, include -c in list of snippets to store, and use dict of lambdas to map back to the desired action Eric Blake (3): nbdsh:
2019 Sep 12
2
[libnbd PATCH] nbdsh: Start adding unit tests
...to add a unit test covering our recent fix for handling globals from consecutive -c, but let's start with a simple test that --help output is sane. Sanity includes a mention of the man page for more details (similar to nbdkit --help, although I couldn't figure out how to make python's argparse output that sentence last). --- python/nbdsh.py | 3 ++- sh/Makefile.am | 9 ++++++--- sh/test-help.sh | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 40 insertions(+), 4 deletions(-) create mode 100755 sh/test-help.sh diff --git a/python/nbdsh.py b/python/nbdsh.py index 553e632..117c...
2015 Oct 09
3
Python version for scripts in LLVM?
...e_set +#print(node_set) #open the output file Index: bisect =================================================================== --- bisect (revision 249819) +++ bisect (working copy) @@ -1,5 +1,6 @@ #!/usr/bin/env python +from __future__ import print_function import os import sys import argparse @@ -25,7 +26,7 @@ count = start + (end - start)/2 print("Visiting Count: %d with (Start, End) = (%d,%d)" % (count, start, end)) cmd = [x % {'count':count} for x in args.command] - print cmd + print(cmd) result = subprocess.call(cmd) if result == 0:...
2020 Sep 01
2
VAAPI on GeForce GT 620M
...right render node, > as seen here: > > https://github.com/intel/libva-utils/blob/master/common/va_display.c#L80 > > Note that I've never tried this, just did a few google searches to > find this stuff. > > Brilliant googling. get_drm_device_name() does seem to do a crude argparse of "--device" So I ran $ DRI_PRIME=1 LIBVA_DRIVER_NAME=nouveau vainfo --device /dev/dri/renderD128 *vainfo: unrecognized option '--device'*Show information from VA-API driver Usage: vainfo --help --help print this message Usage: vainfo [options] Display options:...
2018 Jul 09
1
slow mailbox refreshes
Hello, I am using dovecot 2.3.2 on my private email server in conjunction with: centos 7.5 apache 2.4.6 mariadb 10.2.16 roundcube mail 1.3.6 php 5.6.36 postfix 2.10.1 I have one mailbox with nearly 30k messages in it dispersed across several folders. it's often very slow in refreshing the message list, especially in the one largest 25k+ message folder. is this simply to be expected
2012 Aug 13
0
[LLVMdev] [RFC] New command line parsing/generating framework for clang and lld.
...ment on this because of my aborted attempts and broken promises at improving the driver, but you did add me on cc... :) I like the general idea. But why is this idea so removed from the current (rather heavyweight) Clang argument parsing library that it needs a full rewrite? I get that moving the argparse stuff out of the driver is a good idea so other tools can use it, but does it need to be reengineered so heavily? For example, 4/5 of your "scope" points can be handled by the current library architecture with perhaps a few implementation additions (typo correction, for example). It'...
2014 Jun 26
4
[LLVMdev] Python version requirement for LLVM
...trike me as silly. But I gave up on this fight some time ago. Eli > > On Jun 25, 2014, at 17:11, Alexander Kornienko <alexfh at google.com> wrote: > > http://llvm.org/docs/GettingStarted.html currently mentions Python 2.5 as > a minimum required version. I'd like to use argparse > <https://docs.python.org/dev/library/argparse.html> in a script and be > able to test this script. This requires Python 2.7. This version has been > around since 2010, and afaiu, is available on all modern platforms. Is > there any reason not to change minimum required version o...
2012 Aug 11
3
[LLVMdev] [RFC] New command line parsing/generating framework for clang and lld.
On Aug 11, 2012, at 12:03 AM, Michael Spencer <bigcheesegs at gmail.com> wrote: > On Fri, Aug 10, 2012 at 6:28 PM, Chris Lattner <clattner at apple.com> wrote: >> >> On Aug 9, 2012, at 1:26 PM, Michael Spencer <bigcheesegs at gmail.com> wrote: >> >>>> Attached is a patch that adds tools/llvm-cltest. This currently contains code >>>>
2020 Sep 01
0
VAAPI on GeForce GT 620M
...ere: >> >> https://github.com/intel/libva-utils/blob/master/common/va_display.c#L80 >> >> Note that I've never tried this, just did a few google searches to >> find this stuff. >> >> > Brilliant googling. get_drm_device_name() does seem to do a crude argparse > of "--device" > > So I ran > > $ DRI_PRIME=1 LIBVA_DRIVER_NAME=nouveau vainfo --device /dev/dri/renderD128 > > *vainfo: unrecognized option '--device'*Show information from VA-API > driver > Usage: vainfo --help > --help print this message &...
2019 Sep 12
2
[libnbd PATCH] nbdsh: Add -b option to simplify h.block_status
...;--command> 'COMMAND ...' diff --git a/python/nbdsh.py b/python/nbdsh.py index 319b0f0..00bc6bc 100644 --- a/python/nbdsh.py +++ b/python/nbdsh.py @@ -27,6 +27,8 @@ def shell(): epilog = '''Please read the nbdsh(1) manual page for full usage.''' parser = argparse.ArgumentParser (prog='nbdsh', description=description, epilog=epilog) + parser.add_argument ('-b', '--base-allocation', action='store_true', + help='request the "base:allocation" meta con...
2020 Sep 18
1
[libnbd PATCH] nbdsh: Hide nbd.Error from abrt-python3-handler
...nc. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -16,6 +16,9 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +import traceback + + # The NBD shell. def shell(): import argparse @@ -95,8 +97,12 @@ help(nbd) # Display documentation else: # https://stackoverflow.com/a/11754346 d = dict(locals(), **globals()) - for c in args.command: - if c != '-': - exec(c, d, d) - else: -...
2019 Sep 12
1
[libnbd PATCH v2] nbdsh: Prefer --uri over --connect
...', metavar='URI', + parser.add_argument ('-u', '--uri', help="connect to NBD URI") + # For back-compat, provide --connect as an undocumented synonym to --uri + parser.add_argument ('--connect', dest='uri', help=argparse.SUPPRESS) parser.add_argument ('-c', '--command', action='append', help="run a command") parser.add_argument ('-V', '--version', action='version', @@ -56,8 +58,8 @@ help (nbd) # Di...
2020 Sep 22
3
[libnbd PATCH v2] nbdsh: Catch nbd.Error from -c arguments
...diff --git a/python/nbdsh.py b/python/nbdsh.py index 61d38e8..9ed2938 100644 --- a/python/nbdsh.py +++ b/python/nbdsh.py @@ -16,6 +16,10 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +import os +import traceback + + # The NBD shell. def shell(): import argparse @@ -100,8 +104,16 @@ help(nbd) # Display documentation else: # https://stackoverflow.com/a/11754346 d = dict(locals(), **globals()) - for c in args.command: - if c != '-': - exec(c, d, d) + try: +...
2020 Sep 01
2
VAAPI on GeForce GT 620M
> > It does indicate a config problem, but why do you want to use the > nvidia GPU for video accel? I'd rely on intel to provide acceleration > as this also reduces power consumption of the entire system. Also I > think vaapi on the secondary GPU is pretty much untested. Well you've got a point there. It's just that the dang nvidia is pretty much sitting there on its
2019 Jun 03
3
[PATCH libnbd] api: nbd_get_version, nbd_supports_uri and nbd_get_package_name.
...-3607,8 +3650,8 @@ class NBD (object): (* For nbdsh. *) pr "\ -package_name = libnbdmod.get_package_name () -__version__ = libnbdmod.get_package_version () +package_name = NBD().get_package_name() +__version__ = NBD().get_version() if __name__ == \"__main__\": import argparse diff --git a/lib/handle.c b/lib/handle.c index a42b8dc..cc311ba 100644 --- a/lib/handle.c +++ b/lib/handle.c @@ -214,3 +214,25 @@ nbd_add_close_callback (struct nbd_handle *h, nbd_close_callback cb, void *data) pthread_mutex_unlock (&h->lock); return ret; } + +const char * +nbd_unlock...
2013 Nov 01
9
package conflict resolution method:
Hello, list: I have two puppet modules that are unrelated to each other, but both have (unrelated) Python scripts that parse YAML. As such, both have a block like the following in their manifests for the PyYAML script dependency: package { ''PyYAML'': ensure => installed, } If I try and include both modules on the same server this causes an obvious
2013 Dec 04
3
BIND segway -> python -> first-class ports
On 12/4/13, 9:05 AM, Mark Felder said: ----------------- > There was no alternative; we couldn't keep BIND in base. BIND 9 will > certainly have a EoL before the EoL of FreeBSD 10.x, and we can't use > BIND 10 because it requires importing Python to base. I'm coming more and more to the conclusion that we should have a minimal Python in "base". More and more people