search for: __name__

Displaying 20 results from an estimated 87 matches for "__name__".

2017 Mar 01
3
fail2ban Asterisk 13.13.1
...et banned. maxretry = 3 [asterisk-iptables] enable = true port = 5060,5061 filter = asterisk action = iptables-allports[name=ASTERISK, protocol=all] sendmail[name=ASTERISK, dest=motty at email.com, sender=fail2ban at asterisk-ip.com] #action = %(banaction)s[name=%(__name__)s-tcp, port="%(port)s", protocol="tcp", chain="%(chain)s", actname=%(banaction)s-tcp] %(banaction)s[name=%(__name__)s-udp, port="%(port)s", protocol="udp", chain="%(chain)s", actname=%(banaction)s-udp] %(mta)s-whois...
2012 Oct 19
3
[PATCH] pygrub: Add option to list grub entries
...print " kernel: %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>&q...
2017 Mar 02
3
fail2ban Asterisk 13.13.1
...er = asterisk action = iptables-allports[name=ASTERISK, protocol=all] sendmail[name=ASTERISK, dest=motty at email.com <mailto:dest=motty at email.com> , sender=fail2ban at asterisk-ip.com <mailto:sender=fail2ban at asterisk-ip.com> ] #action = %(banaction)s[name=%(__name__)s-tcp, port="%(port)s", protocol="tcp", chain="%(chain)s", actname=%(banaction)s-tcp] %(banaction)s[name=%(__name__)s-udp, port="%(port)s", protocol="udp", chain="%(chain)s", actname=%(banaction)s-udp] %(mta)s-whois...
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.up...
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
2016 May 29
3
LNT General Failure
Folks, Its seems that the latest master restart has introduced a failure in *many* test-suite bots: File "/home/buildslave/buildslave/clang-cmake-aarch64-full/test/lnt/lnt/server/ui/decorators.py", line 6, in <module> frontend = flask.Module(__name__) AttributeError: 'module' object has no attribute 'Module' http://lab.llvm.org:8011/builders/clang-cmake-aarch64-quick/builds/7433 http://lab.llvm.org:8011/builders/clang-cmake-aarch64-full/builds/2208 http://lab.llvm.org:8011/builders/clang-native-arm-lnt/builds/18012 http://la...
2011 Oct 20
2
[PATCH] pygrub: do not overload RuntimeError for "no menu.lst found"
...uot;couldn''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 i...
2016 Feb 12
2
[PATCH] python: tests: use more targeted assert*() functions/checks
...(isinstance (self.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.clos...
2009 Nov 10
1
Is it possible to detect whether running as Rscript?
...#!/usr/bin/env 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...
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
...virt.VIR_CRED_AUTHNAME, 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>
2012 Jul 19
2
[PATCH] pygrub: add syslog support to pygrub
...39;') + file_format = (''[%(asctime)s %(process)d] %(levelname)s '' + ''(%(module)s:%(lineno)d) %(message)s'') + handler.setFormatter(logging.Formatter(file_format)) + logger.addHandler(handler) + logger.setLevel(logging.DEBUG) + if __name__ == "__main__": + init_log() 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|simple...
2018 Feb 01
2
AuthDatabase CheckPassword broken?
I had been using the CheckPassword authentication interface with dovecot 2.2.15, https://wiki2.dovecot.org/AuthDatabase/CheckPassword, and it was working. After upgrading to 2.2.33.2 CheckPassword no longer works. The referenced wiki page says, Checkpassword Interface Read <username> NUL <password> NUL from fd 3. I've checked the information read from fd 3 with 2.2.33.2
2016 May 30
0
LNT General Failure
...golin at linaro.org>> wrote: Folks, Its seems that the latest master restart has introduced a failure in *many* test-suite bots: File "/home/buildslave/buildslave/clang-cmake-aarch64-full/test/lnt/lnt/server/ui/decorators.py", line 6, in <module> frontend = flask.Module(__name__) AttributeError: 'module' object has no attribute 'Module' http://lab.llvm.org:8011/builders/clang-cmake-aarch64-quick/builds/7433 http://lab.llvm.org:8011/builders/clang-cmake-aarch64-full/builds/2208 http://lab.llvm.org:8011/builders/clang-native-arm-lnt/builds/18012 http://la...
2012 Sep 11
2
R equivalent of python module structure and functionality?
...n/2007/idiomatic/handout.html#module-structure > """module docstring""" > > # imports > # constants > # exception classes > # interface functions > # classes > # internal functions & classes > > def main(...): > ... > > if __name__ == '__main__': > status = main() > sys.exit(status) ) so that the file/module is both 1. callable from the OS commandline via, e.g., $ /path/to/cmdline.py 2. importable without mere import causing execution of the script's functionality, e.g., >>> sys.path...
2016 Feb 22
3
[PATCH 1/3] python: tests: refactor to use unittest's discovery
...y of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -import unittest - -class Test010Load (unittest.TestCase): - def test_import (self): - import guestfs - -if __name__ == '__main__': - unittest.main () diff --git a/python/t/070-optargs.py b/python/t/070-optargs.py deleted file mode 100644 index c3e9ddd..0000000 --- a/python/t/070-optargs.py +++ /dev/null @@ -1,39 +0,0 @@ -# libguestfs Python bindings -# Copyright (C) 2010 Red Hat Inc. -# -# This progra...
2012 May 08
2
[LLVMdev] 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.
2018 Feb 01
2
AuthDatabase CheckPassword broken?
...= s.read().split("\0") > ??? if data[0] != "testuser" or data[1] != "pass": > ????? return False > ??? os.environ["USER"] = data[0] > ??? os.environ["EXTRA"] = "userdb_uid=vmail userdb_gid=vmail" > ? return True > > if __name__ == "__main__": > ? if not checkPassword(): > ??? sys.exit(1) > ? os.execv(sys.argv[1], sys.argv[1:]) > > And it seems to work. > > Aki Thanks for the script. I'm testing this on a production system, so I'll have to wait until after business hours to test. Mea...
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
2019 Aug 25
10
Conventions: Use of globals and main functions
...ngineering principle of avoiding a mutating global state. Although this is just a rule of thumb, in R scripts, the frequent use of global variables is much more pronounced than in other languages. On the other hand, in Python, it is common to use a main function (through the `def main():` and? `if __name__ == "__main__":` idioms). This is mentioned both in the documentation as well as in the writing of Python's main creator. Although this is more beneficial in Python than in R because Python code is structured into modules, which serve as both scripts and packages, whereas R separates t...