search for: __main__

Displaying 20 results from an estimated 116 matches for "__main__".

2012 Oct 12
2
NSS support in trunk (was: NSS branch pull request)
.... - Emilien and I will work on completing the QA regression test script for NUT<http://bazaar.launchpad.net/~ubuntu-bugcontrol/qa-regression-testing/master/view/head:/scripts/test-nut.py>for NSS. for the time being, all the (few) current tests pass on the new trunk: > test_CVE_2012_2944 (__main__.BasicTest) > Test CVE-2012-2944 ... ok > test_daemons_pid (__main__.BasicTest) > Test daemons using PID files ... ok > test_daemons_service (__main__.BasicTest) > Test daemons using "service status" ... ok > test_upsc_device_list (__main__.BasicTest) > Test NUT client...
2001 Apr 07
2
silent extern error (PR#898)
...#endif #ifdef __cplusplus extern "C" { #endif these two should be reversed. Its never a problem because builds aren't done against C++ compilers, but its still an error (just a low priority one). also, you could change that to #ifdef __cplusplus extern "C" { #endif #ifdef __MAIN__ #define extern #elif _MSC_VER #define extern __dllspec(dllimport) #endif with the corresponding change to the #undef region. This would allow people to develop for R using MSVC++ more easily. -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-devel mailing list -- R...
2019 Jan 03
10
Runnable R packages
...efact: .jar file Declarations file: Manifest file Entry point: declared as 'Main-Class' Executed as: java -jar <jarfile> Or Python: Artefact: Python package, typically as .tar.gz source distribution file Declarations file: setup.py (which specifies dependencies) Entry point: special __main__() function Executed as: python -m <package> R has already much of this machinery: Artefact: R package Declarations file: DESCRIPTION Entry point: ? Executed as: ? I feel that R could benefit from letting the developer specify, possibly in DESCRIPTION, how to "run" the package. Th...
2012 Oct 19
3
[PATCH] pygrub: Add option to list grub entries
...el: %s" % img.kernel[1] + print " args: %s" % img.args + print " initrd: %s" % img.initrd[1] + + if interactive and not list_entries: curses.wrapper(run_main) else: sel = g.cf.default @@ -702,7 +712,7 @@ if __name__ == "__main__": sel = None def usage(): - print >> sys.stderr, "Usage: %s [-q|--quiet] [-i|--interactive] [-n|--not-really] [--output=] [--kernel=] [--ramdisk=] [--args=] [--entry=] [--output-directory=] [--output-format=sxp|simple|simple0] <image>" %(sys.argv[0]...
1999 Oct 12
1
Looking for R_Home ...
This is my first question to this list and possibly a bit dumb, but anyway: Can anybody tell me, where, e.g. in the "unix" reference release a DEFINITION of char * R_Home can be found? Via Defn.h the "extern" DECLARATION is everywhere, but when I derived a somewhat other main() program my linker complained about the missing definition. Thomas Hoffmann.
1999 Oct 25
1
gc_inhibit_torture definition twice?
I have a problem to understand the way gc_inhibit_torture is defined. In include/Defn.h it is declared as extern, using the __MAIN__ trick this leads to a definition in main/main.c. But in main/memory.c you define (and initialize) gc_inhibit_torture again: int gc_inhibit_torture = 1; /* gets set to zero after initialisations */ Then, in e.g. unix/system.c immediately at the beginning of main() you initialize gc_inhibit_t...
2019 Jan 31
2
Runnable R packages
...< b.rowlingson at lancaster.ac.uk> wrote: > > > On Thu, Jan 31, 2019 at 3:14 PM David Lindelof <lindelof at ieee.org> wrote: > >> >> In summary, I'm convinced R would benefit from something similar to Java's >> `Main-Class` header or Python's `__main__()` function. A new R CMD command >> would take a package, install its dependencies, and run its "main" >> function. > > > > I just created and built a very boilerplate R package called "runme". I > can install its dependencies and run its "main&qu...
2011 Dec 29
2
[LLVMdev] DW_AT_location not getting generated for local variables
...a !"foo", metadata !"foo", metadata !"\01_main", metadata !7, i32 1, metadata !8, i1 false, i1 true, i32 0, i32 0, i32 0, i32 0, i1 false, i32 ()* @"\01_main", null, null, metadata !11} ; [ DW_TAG_subprogram ] !6 = metadata !{i32 720953, null, metadata !"__main__", metadata !7, i32 1} ; [ DW_TAG_namespace ] !7 = metadata !{i32 720937, metadata !"foo.clay", metadata !"", null} ; [ DW_TAG_file_type ] !8 = metadata !{i32 720917, i32 0, metadata !"", i32 0, i32 0, i64 0, i64 0, i32 0, i32 0, i32 0, metadata !9, i32 0, i32 0} ;...
2015 Jun 30
2
how is the sha fingerprint generated?
You really don't need openssl for that. And the fingerprints are simple. Here is a python script that do the same as ssh-keygen -fl /path/to/key : #!/usr/bin/env python3 import binascii import hashlib import sys if __name__ == "__main__": key = binascii.a2b_base64(sys.argv[1]) if sys.argv[2] == "md5": m = hashlib.new("md5") m.update(key) print(m.hexdigest()) elif sys.argv[2] == "sha256": m = hashlib.new("sha256") m.update(key)...
2007 Jan 05
10
[PATCH 1/7] Fix pygrub path on Solaris
Fix for pygrub path on Solaris. Signed-off-by: John Levon <john.levon@sun.com> diff --git a/tools/python/xen/xend/XendDomainInfo.py b/tools/python/xen/xend/XendDomainInfo.py --- a/tools/python/xen/xend/XendDomainInfo.py +++ b/tools/python/xen/xend/XendDomainInfo.py @@ -37,7 +37,7 @@ from xen.util.blkif import blkdev_uname_ from xen.util.blkif import blkdev_uname_to_file from xen.util
2019 Sep 11
0
[PATCH nbdkit] python: Drop support for Python 2.
...N); -#endif if (script && callback_defined ("dump_plugin", &fn)) { PyErr_Clear (); @@ -337,11 +312,7 @@ py_config (const char *key, const char *value) /* Note that because closeit flag == 1, fp is now closed. */ /* The script should define a module called __main__. */ -#ifdef HAVE_PYSTRING_FROMSTRING - modname = PyString_FromString ("__main__"); -#else modname = PyUnicode_FromString ("__main__"); -#endif module = PyImport_Import (modname); Py_DECREF (modname); if (!module) { -- 2.23.0
2012 Jan 02
0
[LLVMdev] DW_AT_location not getting generated for local variables
...metadata > !"foo", metadata !"\01_main", metadata !7, i32 1, metadata !8, i1 false, i1 > true, i32 0, i32 0, i32 0, i32 0, i1 false, i32 ()* @"\01_main", null, null, > metadata !11} ; [ DW_TAG_subprogram ] > !6 = metadata !{i32 720953, null, metadata !"__main__", metadata !7, i32 1} > ; [ DW_TAG_namespace ] > !7 = metadata !{i32 720937, metadata !"foo.clay", metadata !"", null} ; [ > DW_TAG_file_type ] > !8 = metadata !{i32 720917, i32 0, metadata !"", i32 0, i32 0, i64 0, i64 0, > i32 0, i32 0, i32 0, met...
2011 Oct 20
2
[PATCH] pygrub: do not overload RuntimeError for "no menu.lst found"
...9;t find bootloader config file in the image provided." + raise NotFoundError, "couldn''t find bootloader config file in the image provided." f = fs.open_file(self.cf.filename) buf = f.read() del f @@ -763,9 +766,9 @@ if __name__ == "__main__": break fs = None - except: + except (IOError, NotFoundError): # IOErrors raised by fsimage.open - # RuntimeErrors raised by run_grub if no menu.lst present + # NotFoundError raised by run_grub if no menu.lst pres...
2016 Feb 12
2
[PATCH] python: tests: use more targeted assert*() functions/checks
...f.version['release'], cl)) + self.assertIsInstance (self.version['release'], cl) def test_extra (self): - self.assertTrue (isinstance (self.version['extra'], str)) + self.assertIsInstance (self.version['extra'], str) if __name__ == '__main__': unittest.main () diff --git a/python/t/420-log-messages.py b/python/t/420-log-messages.py index 002098e..6b7c06c 100644 --- a/python/t/420-log-messages.py +++ b/python/t/420-log-messages.py @@ -51,7 +51,7 @@ class Test420LogMessages (unittest.TestCase): g.close () - s...
2019 Jan 31
0
Runnable R packages
On Thu, Jan 31, 2019 at 3:14 PM David Lindelof <lindelof at ieee.org> wrote: > > In summary, I'm convinced R would benefit from something similar to Java's > `Main-Class` header or Python's `__main__()` function. A new R CMD command > would take a package, install its dependencies, and run its "main" > function. I just created and built a very boilerplate R package called "runme". I can install its dependencies and run its "main" function with: $ R CMD I...
2019 Feb 01
0
Runnable R packages
...; wrote: >> >> >> >> On Thu, Jan 31, 2019 at 3:14 PM David Lindelof <lindelof at ieee.org> wrote: >>> >>> >>> In summary, I'm convinced R would benefit from something similar to Java's >>> `Main-Class` header or Python's `__main__()` function. A new R CMD command >>> would take a package, install its dependencies, and run its "main" >>> function. >> >> >> >> I just created and built a very boilerplate R package called "runme". I can install its dependencies and ru...
2019 Feb 01
0
Runnable R packages
...> > > > > > > On Thu, Jan 31, 2019 at 3:14 PM David Lindelof <lindelof at ieee.org> > wrote: > > > >> > >> In summary, I'm convinced R would benefit from something similar to > Java's > >> `Main-Class` header or Python's `__main__()` function. A new R CMD > command > >> would take a package, install its dependencies, and run its "main" > >> function. > > > > > > > > I just created and built a very boilerplate R package called "runme". I > > can install it...
2009 Nov 10
1
Is it possible to detect whether running as Rscript?
...Rscript my.func <- function(...) { #do something... } if ( #is.running.Rscript# ) { do.call(my.func, commandArgs(trailingOnly=TRUE)) } If it helps, I'm thinking of something similar to the Python idiom of writing #!/usr/bin/env python #class, function definitions if (__name__=='__main__'): #code to be executed when running this file directly The intent is to use R's debugging facilities to help solve a problem that occurs when a script is invoked (from a makefile) with particular arguments. So if the makefile invokes "my.script datafile" then I can track...
2012 May 09
0
[LLVMdev] RE : RE : RE : svn trunk comilation error
> De : 陳韋任 [chenwj at iis.sinica.edu.tw] > Date d'envoi : mardi 8 mai 2012 11:37 > À : Rinaldini Julien > Cc: LLVM Developers Mailing List > Objet : Re: [LLVMdev] RE : svn trunk comilation error > > Hi Rinaldini, > > You probably need to illustrate what your enviroment is, what revision you > checkout and how you build LLVM. I have no problem build LLVM svn here.
2012 Aug 26
1
question about using openAuth with Python
...HNAME, libvirt.VIR_CRED_PASSPHRASE], authcb, None] vm_conn = libvirt.openAuth(self.uri, auth, 0); print self.uri if vm_conn == None: print 'Failed to open connection to %s' % self.uri for name in vm_conn.listDefinedDomains(): print name vm = vm_conn.lookupByName(name) if __name__ == '__main__': conn = connection('qemu+ssh://root at 192.168.1.203/system') conn.open() Thanks fan -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20120826/5fd7e7da/attachment.htm>