100+ results for 'python config loop'
Not the results you expected?
kernelmanager.py (https://gitlab.com/pooja043/Globus_Docker_3) Python · 128 lines
8 #-----------------------------------------------------------------------------
9 # Copyright (C) 2013 The IPython Development Team
10 #
11 # Distributed under the terms of the BSD License. The full license is in
21 from tornado import web
23 from IPython.kernel.multikernelmanager import MultiKernelManager
24 from IPython.utils.traitlets import (
26 )
28 from IPython.html.utils import to_os_path
29 from IPython.utils.py3compat import getcwd
39 def _kernel_manager_class_default(self):
40 return "IPython.kernel.ioloop.IOLoopKernelManager"
42 kernel_argv = List(Unicode)
pywnshow.py (https://github.com/balajeerc/lexiconator.git) Python · 174 lines
1 #! /usr/bin/env python
3 from Tkinter import *
19 def setPOSAny(self):
20 self.pos = None;
21 self.posMenu.config(text='Any')
22 def setPOSNoun(self):
23 self.pos = 'n';
24 self.posMenu.config(text='Noun')
25 def setPOSVerb(self):
26 self.pos = 'v';
27 self.posMenu.config(text='Verb')
28 def setPOSAdj(self):
29 self.pos = 'a';
importOldDatabase.py (https://github.com/shamelmerchant/RMG-database.git) Python · 224 lines
1 #!/usr/bin/env python
2 # encoding: utf-8
32 try:
33 p=subprocess.Popen('git config --get user.name'.split(),
34 stdout=subprocess.PIPE)
35 name = p.stdout.read()
43 try:
44 p=subprocess.Popen('git config --get user.email'.split(),
45 stdout=subprocess.PIPE)
46 email = p.stdout.read()
97 except KeyError:
98 entry.history.append(event_new)
99 continue # next in for loop
100 entry.history.extend(old_entry.history)
101 if compare(old_entry, entry, library.saveEntry):
django_utils.py (https://github.com/dploi/dploi-fabric.git) Python · 128 lines
14 # TODO: Remove this and change dependants to use utils.config
15 config = ConfigParser.RawConfigParser()
16 config_file = os.path.join(env.path, "config.ini")
25 tool = config.get("checkout", "tool")
26 except (ConfigParser.NoSectionError, ConfigParser.NoOptionError):
27 tool = "buildout" # default to buildout
30 django_base = config.get("django", "base")
31 except (ConfigParser.NoSectionError, ConfigParser.NoOptionError):
32 pass
33 if django_base == ".":
71 append = config.sites["main"].get("django").get("append_settings", False)
72 if append:
73 site_config = config.sites["main"]
74 settings_file_path = django_settings_file()
75 print "Appending auto generated settings to", settings_file_path
redemo.py (https://gitlab.com/abhi1tb/build) Python · 171 lines
1 #!/usr/bin/env python3
3 """Basic regular expression demonstration facility (Perl style syntax)."""
51 self.stringdisplay = Text(self.master, width=60, height=4)
52 self.stringdisplay.pack(fill=BOTH, expand=1)
53 self.stringdisplay.tag_configure("hit", background="yellow")
55 self.grouplabel = Label(self.master, text="Groups:", anchor=W)
104 self.getflags())
105 bg = self.promptdisplay['background']
106 self.statusdisplay.config(text="", background=bg)
107 except re.error as msg:
108 self.compiled = None
109 self.statusdisplay.config(
110 text="re.error: %s" % str(msg),
111 background="red")
larset2-hw1.py (https://github.com/Ahumm/Zawumbo-General.git) Python · 273 lines
11 ## ------------------------------------------------------------ ##
12 ## ##
13 ## Tested with Python 2.7.3 ##
14 ## Previous versions ought to work ##
15 ## Will not work with Python 3.X+ ##
18 ## ##
19 ## Usage: ##
20 ## Manual puzzle entry : python larset2-hw1.py ##
21 ## Read puzzle from file : python larset2-hw1.py <filename> ##
61 self.last_board = new_last_board
63 # Find the 2-4 moves possible with the current board configuration
64 def get_possible_moves(self):
65 possible_states = []
234 # Request user input of starting state
235 def loop_input():
236 while True:
237 # Get and parse user input, handling exceptions
nodes.py (https://github.com/OakwoodAI/Automagica.git) Python · 436 lines
4 import string
6 from automagica.config import ACTIVITIES
289 super().__init__(**kwargs)
290 self.iterable = iterable
291 self.loop_variable = loop_variable
292 self.loop_node = loop_node
311 "type": self.__class__.__name__,
312 "iterable": self.iterable,
313 "loop_variable": self.loop_variable,
314 "repeat_n_times": self.repeat_n_times,
315 "next_node": self.next_node,
316 "loop_node": self.loop_node,
317 "label": self.label,
318 }
startconfig.py (https://github.com/schoeke/navigationtask.git) Python · 153 lines
1 #!/usr/bin/python
3 # File: project.py
9 exitstatus = 0
11 class ExperimentConfig(wx.Frame):
12 """
13 """
102 swaporder = 'True'
104 xmldoc = minidom.parse("startconfig.xml")
106 subjectTags = xmldoc.getElementsByTagName("name")
150 app = wx.App()
151 win = ExperimentConfig(None, -1, 'Experiment Configuration')
152 app.MainLoop()
coordinator_kamal_approach.py (https://gitlab.com/jsanch/udom) Python · 245 lines
1 #!/usr/bin/env python
2 # -*- encoding: utf-8 -*-
3 """
4 This node uses a pipeline of components to demonstrate deformation sensing based
5 on force and position sensing.
6 The component serves as a configurator/coordinator, i.e. it sets the required
7 parameters for all the components and starts/stops them accordingly.
38 **Parameter(s):**
40 * `loop_rate`: Node cycle rate (in Hz).
42 """
68 # Node cycle rate (in Hz).
69 self.loop_rate = rospy.Rate(rospy.get_param('~loop_rate', 10))
71 # Publishers
coordinator.py (https://gitlab.com/jsanch/udom) Python · 298 lines
1 #!/usr/bin/env python
2 # -*- encoding: utf-8 -*-
3 """
4 This node uses a pipeline of components to demonstrate deformation sensing.
5 The component serves as a configurator/coordinator, i.e. it sets the required
6 parameters for all the components and starts/stops them accordingly.
35 **Parameter(s):**
36 * `loop_rate`: Node cycle rate (in Hz).
37 * `mesh_filename`: Filename of the volumetric mesh in a .veg format. **Note:** This file
38 should be located in the config directory of the `deformation_sensing` package.
73 # Node cycle rate (in Hz).
74 self.loop_rate = rospy.Rate(rospy.get_param('~loop_rate', 10))
76 # Publishers
tvdb_ui.py (https://github.com/hobbes1069/mythtv.git) Python · 124 lines
1 #!/usr/bin/env python
2 #encoding:utf-8
3 #author:dbr/Ben
11 A UI is a callback. A class, it's __init__ function takes two arguments:
13 - config, which is the Tvdb config dict, setup in tvdb_api.py
14 - log, which is Tvdb's logger instance (which uses the logging module). You can
15 call log.info() log.warning() etc
54 def __init__(self, config, log):
55 self.config = config
56 self.log = log
85 return allSeries[0]
87 if self.config['select_first'] is True:
88 print "Automatically returning first search result"
89 return allSeries[0]
test.py (https://github.com/esmanhotto/emesene.git) Python · 142 lines
workflow_management_service.py (https://github.com/dstuebe/coi-services.git) Python · 252 lines
1 #!/usr/bin/env python
179 # Create the transform data process
180 log.debug("create data_process and start it")
181 data_process_id = self.clients.data_process_management.create_data_process(data_process_definition._id, [data_process_input_dp_id], {'output':transform_dp_id}, configuration=wf_step.configuration)
182 self.clients.data_process_management.activate_data_process(data_process_id)
185 self.clients.resource_registry.create_association(workflow_id, PRED.hasDataProcess, data_process_id )
187 #last one out of the for loop is the output product id
188 output_data_product_id = transform_dp_id
system.py (https://github.com/hivesolutions/colony_plugins.git) Python · 339 lines
1 #!/usr/bin/python
2 # -*- coding: utf-8 -*-
84 # retrieves the connection parameters
85 context_name = connection_parameters.get("context_name", "default")
86 base_path = connection_parameters.get("base_path", "%configuration:" + self.plugin.id + "%")
88 # creates the (full) base path by appending the context name and
89 # resolves it (for configuration directories) using the plugin manager
90 base_path = os.path.join(base_path, context_name)
91 base_path = plugin_manager.resolve_file_path(base_path, True, True)
174 # in case no source chunk could be read
175 if not source_chunk:
176 # breaks the loop (no more
177 # data to be copied)
178 break
__init__.py (https://github.com/raminel/geraldo.git) Python · 151 lines
35 if name == '_target':
36 # Assign directly to self.__dict__, because otherwise we'd call
37 # __setattr__(), which would be an infinite loop.
38 self.__dict__['_target'] = value
39 else:
61 def configure(self, default_settings=global_settings, **options):
62 """
63 Called to manually configure the settings. The 'default_settings'
64 parameter sets where to retrieve any unspecified values from (its
65 argument must support attribute access (__getattr__)).
77 """
78 return bool(self._target)
79 configured = property(configured)
81 class Settings(object):
StageInMgr.py (https://github.com/PerilousApricot/WMCore.git) Python · 291 lines
1 #!/usr/bin/env python
2 """
3 _StageInMgr_
11 import os
13 from WMCore.Storage.SiteLocalConfig import loadSiteLocalConfig
15 #do we want seperate exceptions - for the moment no
23 _StageOutSuccess_
25 Exception used to escape stage out loop when stage out is successful
26 """
27 pass
60 if self.override == False:
61 self.siteCfg = loadSiteLocalConfig()
63 if self.override:
socks5.py (https://gitlab.com/jslee1/bitcoin) Python · 161 lines
1 #!/usr/bin/env python3
2 # Copyright (c) 2015-2016 The Bitcoin Core developers
3 # Distributed under the MIT software license, see the accompanying
33 ### Implementation classes
34 class Socks5Configuration(object):
35 '''Proxy configuration'''
154 def stop(self):
155 self.running = False
156 # connect to self to end run loop
157 s = socket.socket(self.conf.af)
158 s.connect(self.conf.addr)
DAToolRectangle.py (https://gitlab.com/liuxin429go/H2D2-tools) Python · 118 lines
app.py (https://github.com/comger/kpages.git) Python · 113 lines
1 #!/usr/bin/env python
2 # -*- coding:utf-8 -*-
3 """
83 server.bind(self._port, address=self._ip)
84 server.start(0)
85 #tornado.ioloop.IOLoop.instance().start()
86 tornado.ioloop.IOLoop.current().start()
94 define("port", default=None, help="run on the given port", type=int)
95 define("config", default='setting.py', help="set config for server")
96 define("ip", help="bind accept ip for server")
97 define("debug", default=None, help="Debug Mode")
103 tornado.options.parse_command_line()
104 opts = options
105 refresh_config(opts.config)
107 __conf__.PORT = opts.port or __conf__.PORT
menuDemo.py (https://bitbucket.org/haploc/pythonscripts.git) Python · 110 lines
38 toolbar = Frame(self, cursor='hand2', relief=SUNKEN, bd=2)
39 toolbar.pack(side=BOTTOM, fill=X)
40 photos = 'ora-lp4e-big.jpg', 'PythonPoweredAnim.gif', 'python_conf_ora.gif'
41 self.toolPhotoObjs = []
42 for file in photos:
56 toolbar = Frame(self, cursor='hand2', relief=SUNKEN, bd=2)
57 toolbar.pack(side=BOTTOM, fill=X)
58 photos = 'ora-lp4e.gif', 'pythonPowered.gif', 'python_conf_ora.gif'
59 self.toolPhotoObjs = []
60 for file in photos:
92 def imageMenu(self):
93 photoFiles = ('ora-lp4e.gif', 'pythonPowered.gif', 'python_conf_ora.gif')
94 pulldown = Menu(self.menubar)
95 self.photoObjs = []
logwatcher.py (https://github.com/matthagy/ipython.git) Python · 114 lines
26 from zmq.eventloop import ioloop, zmqstream
28 from IPython.config.configurable import LoggingConfigurable
29 from IPython.utils.traitlets import Int, Unicode, Instance, List
41 """
43 # configurables
44 topics = List([''], config=True,
54 return zmq.Context.instance()
56 loop = Instance(zmq.eventloop.ioloop.IOLoop)
57 def _loop_default(self):
58 return ioloop.IOLoop.instance()
60 def __init__(self, **kwargs):
rescan_header.py (https://bitbucket.org/kbw/boost_svn.git) Python · 265 lines
1 #!/usr/bin/python
3 # Copyright 2012 Steven Watanabe
7 import BoostBuild
9 t = BoostBuild.Tester(use_test_config=False)
11 # Test a header loop that depends on (but does not contain) a generated header.
81 t.rm(".")
83 # Test a loop in generated headers.
84 t.write("test.cpp", '#include "header1.h"\n')
131 t.rm(".")
133 # Test that all the dependencies of a loop are updated before any of the
134 # dependents.
135 t.write("test1.cpp", '#include "header1.h"\n')
macro-index.xml (https://jedit.svn.sourceforge.net/svnroot/jedit) XML · 412 lines
116 <para>
117 As explained in the notes accompanying the source code, the macro
118 uses a global variable which can be set to configure the macro to work
119 with either Java or C++ code. When set for use with C++ code,
120 the macro will also write (in commented text) definitions of
130 </para></abstract>
131 <para>
132 The macro includes configuration variables for using
133 different doclets for generating javadocs and for generating
134 javadocs of the package of which the current buffer is a part.
210 abbreviations or all abbreviations in a text buffer for printing as a
211 reference. Notes in the source code listing point out some display options
212 that are configured by modifying global variables.
213 </para>
214 </listitem>
__init__.py (https://github.com/andrewkuzmych/litclub.git) Python · 144 lines
1 """
2 Settings and configuration for Django.
4 Values will be read from the module specified by the DJANGO_SETTINGS_MODULE environment
16 """
17 A lazy proxy for either global Django settings or a custom settings object.
18 The user can manually configure settings prior to using them. Otherwise,
19 Django uses the settings module pointed to by DJANGO_SETTINGS_MODULE.
20 """
35 if name == '_target':
36 # Assign directly to self.__dict__, because otherwise we'd call
37 # __setattr__(), which would be an infinite loop.
38 self.__dict__['_target'] = value
39 else:
46 Load the settings module pointed to by the environment variable. This
47 is used the first time we need any settings at all, if the user has not
48 previously configured the settings manually.
49 """
50 try:
edit.py (https://gitlab.com/sixsamuraisoldier/DIGITS) Python · 166 lines
19 min_visibility = config_option.Visibility.HIDDEN
21 levels = [('INSTANCE', config_file.InstanceConfigFile())]
22 # filter out the files which don't exist
23 levels = [l for l in levels if l[1].can_read()]
73 """
74 suggestions = []
75 instanceConfig = config_file.InstanceConfigFile()
76 if instanceConfig.can_write():
114 instanceConfig = None
116 configFile = config_file.ConfigFile(filename)
118 min_visibility = config_option.Visibility.DEFAULT
151 configFile.save()
152 print 'New config saved at %s' % configFile.filename()
153 print
154 print configFile
maintainer.py (https://github.com/SLANG-foundation/SLANG.git) Python · 138 lines
__init__.py (https://bitbucket.org/nagyv/openerp.git) Python · 104 lines
82 openerp.netsvc.Server.quitAll()
83 openerp.wsgi.core.stop_server()
84 config = openerp.tools.config
85 _logger.info("Initiating shutdown")
86 _logger.info("Hit CTRL-C again or send a second signal to force the shutdown.")
89 # Manually join() all threads before calling sys.exit() to allow a second signal
90 # to trigger _force_quit() in case some non-daemon threads won't exit cleanly.
91 # threading.Thread.join() should not mask signals (at least in python 2.5).
92 for thread in threading.enumerate():
93 if thread != threading.currentThread() and not thread.isDaemon():
94 while thread.isAlive():
95 # Need a busyloop here as thread.join() masks signals
96 # and would prevent the forced shutdown.
97 thread.join(0.05)
ResultConverter.html
(http://hadesmem.googlecode.com/svn/trunk/)
HTML · 0 lines
✨ Summary
This HTML code outputs a documentation page for Boost.Python’s ResultConverter concept. It provides an introduction, explains the requirements and semantics of ResultConverters, and describes the ResultConverterGenerator concept. The page includes tables summarizing expressions and their types, as well as copyright information and permission to copy the software.
This HTML code outputs a documentation page for Boost.Python’s ResultConverter concept. It provides an introduction, explains the requirements and semantics of ResultConverters, and describes the ResultConverterGenerator concept. The page includes tables summarizing expressions and their types, as well as copyright information and permission to copy the software.
8 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
9 <link rel="stylesheet" type="text/css" href="../../../../boost.css">
10 <title>Boost.Python - ResultConverter Concept</title>
11 </head>
12 <body link="#0000ff" vlink="#800080">
18 </td>
19 <td valign="top">
20 <h1 align="center"><a href="../index.html">Boost.Python</a></h1>
21 <h2 align="center">ResultConverter Concept</h2>
22 </td>
39 <p>A ResultConverter for a type <code>T</code> is a type whose
40 instances can be used to convert C++ return values of type
41 <code>T</code> <code>to_python</code>. A ResultConverterGenerator is
42 an MPL unary metafunction class which, given the return type of a C++
43 function, returns a ResultConverter for that type. ResultConverters in
test_wxagg.py (https://github.com/tris-sondon/matplotlib.git) Python · 176 lines
1 #!/usr/bin/env pythonw
2 # Name: test_wxagg.py
3 # Purpose: exercises the agg to wx.Image and wx.Bitmap conversion functions
47 ####################
48 # Test Configuration
49 ####################
81 #
83 def time_loop(function, args):
84 i = 0
85 start = time.time()
120 print('ur.y =', BBOX.ur().y().get())
122 # test the pure python implementation
123 if TEST_PY:
124 i_py = _py_convert_agg_to_wx_image( agg, None)
onelepton_dataRA4_sync_settings.py (https://github.com/brynmathias/AnalysisV2.git) Python · 137 lines
1 # this files overloads most of ../../framework/python/icf/config.py, if interested in a specific setting not found below please look the included file
2 ## Calo and PF jet exchange is NOT just a matter of changing the Jet collection. CALO and PF treat muons in jets differntly, you have to look at the x-cleaning parameters. Also the residual corrections (if applied) do have to be changed !!!
6 from copy import deepcopy
7 from icf.core import PSet,Analysis
8 from icf.config import defaultConfig
9 import icf.utils as utils
11 conf=defaultConfig.copy()
12 conf.Common.Jets.PtCut = 40.0
13 conf.Common.Jets.EtaCut = 2.4
42 conf.Common.Photons.IDReq=2
43 conf.Common.ApplyXCleaning=False
44 # If you use calo jets be aware that muons in jets ARE not added to the jet. For PFjets they are already in the jets, to steer the xcleaning, do default_cc = deepcopy(defaultConfig.XCleaning) and overload stuff
46 conf.Ntuple.Weight="User"
prey-trigger.py (https://github.com/freyes/prey.git) Python · 134 lines
16 from PyObjCTools import AppHelper
18 from SystemConfiguration import \
19 SCDynamicStoreCreate, \
20 SCDynamicStoreCreateRunLoopSource, \
49 def interface_connected(interface):
50 return subprocess.call(["ipconfig", "getifaddr", interface]) == 0
52 def log(message):
111 CFRunLoopAddSource(
112 # NSRunLoop.currentRunLoop().getCFRunLoop(),
113 CFRunLoopGetCurrent(),
123 CFRunLoopAddTimer(
124 NSRunLoop.currentRunLoop().getCFRunLoop(),
125 CFRunLoopTimerCreate(None, CFAbsoluteTimeGetCurrent(), 2.0, 0, 0, timer_callback, None),
avatar-test.py (https://github.com/heca/rextest2.git) Python · 167 lines
1 #!/usr/local/bin/python
3 ##
16 from multiprocessing import Process
17 from optparse import OptionParser
18 import config
20 #variables
24 testName = "avatar-test"
26 #folder config
27 scriptDir = os.path.abspath(os.getcwd())
28 rexbinDir = config.rexbinDir
107 print "os not supported"
109 #while-loop to check if viewer is running
110 while running == True:
xbb_search.py (https://github.com/GunioRobot/biopython.git) Python · 171 lines
1 #!/usr/bin/env python
2 # Created: Sun Dec 3 13:38:52 2000
3 # Last changed: Time-stamp: <01/09/04 09:51:21 thomas>
104 self.colorb = Button(f, text = 'Color', command = self.change_color, foreground = self.current_color)
105 self.colorb.pack(side = LEFT)
106 self.config_color(self.current_color)
111 def config_color(self, color = None):
112 if not self.highlight: return
113 if not color:
118 self.current_color = color
119 self.current_tag = 'searched_%s' % self.current_color
120 self.master.tag_config(self.current_tag, background=self.current_color)
121 self.master.tag_config(self.current_tag+'R', background=self.current_color, underline = 1)
test_commands_perfdata.py (https://github.com/sduchesneau/shinken.git) Python · 100 lines
1 #!/usr/bin/env python2.6
2 #Copyright (C) 2009-2010 :
3 # Gabes Jean, naparuba@gmail.com
27 from shinken_test import *
29 class TestConfig(ShinkenTest):
31 def setUp(self):
53 print svc.__class__.perfdata_command.__class__.my_type
54 self.assert_(svc.__class__.perfdata_command.__class__.my_type == 'CommandCall')
55 self.scheduler_loop(1, [[svc, 0, 'OK | bibi=99%']])
56 print "Actions", self.sched.actions
57 self.assert_(self.count_actions() == 1)
61 cmd = "[%lu] DISABLE_PERFORMANCE_DATA" % now
62 self.sched.run_external_command(cmd)
63 self.scheduler_loop(1, [[svc, 0, 'OK | bibi=99%']])
64 print "Actions", self.sched.actions
65 self.assert_(self.count_actions() == 0)
libraryOptions.py (https://bitbucket.org/karpeev/petsc.git) Python · 110 lines
5 import os
7 class Configure(config.base.Configure):
8 def __init__(self, framework):
9 config.base.Configure.__init__(self, framework)
27 def setupDependencies(self, framework):
28 config.base.Configure.setupDependencies(self, framework)
29 self.debugging = framework.require('PETSc.options.debugging', self)
30 self.compilers = framework.require('config.compilers', self)
52 if self.debugging.debugging:
53 self.addDefine('USE_DEBUG',1)
54 elif not config.setCompilers.Configure.isIBM(self.framework.getCompiler()):
55 # IBM XLC version 12.1 (BG/Q and POWER) miscompiles PetscMalloc3()
56 # by reordering "*(void**)&ptr = x" as though ptr was not modified
xbb_blast.py (https://github.com/GunioRobot/biopython.git) Python · 161 lines
1 #!/usr/bin/env python
2 # Created: Thu Jul 13 14:07:25 2000
3 # Last changed: Time-stamp: <00/12/03 13:27:24 thomas>
81 color = 'green'
83 self.dbs.component('entry').configure(bg = color)
84 self.blasts.component('entry').configure(bg = color)
103 def oldRun(self):
104 self.notepad = NotePad()
105 self.notepad.menubar.configure(bg='red')
106 self.notepad.bind('<Destroy>', self.Exit)
122 try:
123 self.notepad.menubar.configure(bg='green')
124 except:
125 pass
client.py (https://gitlab.com/pooja043/Globus_Docker) Python · 206 lines
4 #-----------------------------------------------------------------------------
5 # Copyright (C) 2013 The IPython Development Team
6 #
7 # Distributed under the terms of the BSD License. The full license is in
19 # Local imports
20 from IPython.config.configurable import LoggingConfigurable
21 from IPython.utils.traitlets import (
36 #-----------------------------------------------------------------------------
38 class KernelClient(LoggingConfigurable, ConnectionFileMixin):
39 """Communicates with a single kernel on any host via zmq channels.
127 """Stops all the running channels for this kernel.
129 This stops their event loops and joins their threads.
130 """
131 if self.shell_channel.is_alive():
toc.py (https://github.com/lgarron/Quicksilver.git) Python · 154 lines
34 header = etree.SubElement(div, "span")
35 header.attrib["class"] = "toctitle"
36 header.text = self.config["title"]
38 level = 0
88 # Do not override pre-existing ids
89 if not "id" in c.attrib:
90 id = unique(self.config["slugify"](text, '-'), used_ids)
91 c.attrib["id"] = id
92 else:
143 def extendMarkdown(self, md, md_globals):
144 tocext = TocTreeprocessor(md)
145 tocext.config = self.getConfigs()
146 # Headerid ext is set to '>inline'. With this set to '<prettify',
147 # it should always come after headerid ext (and honor ids assinged
153 def makeExtension(configs={}):
154 return TocExtension(configs=configs)
test_wxagg.py (https://github.com/friedrichromstedt/matplotlib-grayscale.git) Python · 174 lines
1 #!/usr/bin/env pythonw
2 # Name: test_wxagg.py
3 # Purpose: exercises the agg to wx.Image and wx.Bitmap conversion functions
45 ####################
46 # Test Configuration
47 ####################
79 #
81 def time_loop(function, args):
82 i = 0
83 start = time.time()
118 print 'ur.y =', BBOX.ur().y().get()
120 # test the pure python implementation
121 if TEST_PY:
122 i_py = _py_convert_agg_to_wx_image( agg, None)
PsycoGevent.py (https://github.com/cms-dev/cms.git) Python · 104 lines
extract.py (https://github.com/clearkimura/Customizer.git) Python · 91 lines
1 #!/usr/bin/python2.7
3 import os, tempfile
5 import lib.misc as misc
6 import lib.config as config
7 import lib.message as message
8 import actions.common as common
23 if not os.path.isfile(config.ISO):
24 raise(message.exception('ISO does not exist', config.ISO))
25 elif not u'{}'.format(config.ISO).endswith('.iso'):
43 pass
44 misc.system_command((misc.whereis('mount'), '-t', 'iso9660', '-o', \
45 'ro,loop', config.ISO, mount_dir))
46 except:
47 message.sub_info('Removing', mount_dir)
test_reconfig02.py (https://github.com/paralect/mongo.git) Python · 119 lines
35 init_config = 'log=(archive=false,enabled,file_max=100K,prealloc=false,zero_fill=false)'
36 uri = "table:reconfig02"
37 entries = 1000
39 def setUpConnectionOpen(self, dir):
40 self.conn_config = self.init_config
41 return wttest.WiredTigerTestCase.setUpConnectionOpen(self, dir)
43 # Logging: reconfigure the things we can reconfigure.
44 def test_reconfig02_simple(self):
51 self.conn.reconfigure("log=(zero_fill=true)")
53 # Logging: reconfigure the things we can't reconfigure.
54 def test_reconfig02_disable(self):
coredjango.py (https://github.com/chrischeyne/Cassandra-Monitor.git) Python · 111 lines
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
3 #
31 # django settings must be called before importing models
32 from django.conf import settings
33 settings.configure(DATABASE_ENGINE='sqlite3', DATABASE_NAME='mytornado/db/dev.db')
34 from django import forms
35 from django.db import models
37 # FIXME: reference localized python source
38 import tornado.httpserver
39 import tornado.ioloop
ObjectBrowser.py (https://gitlab.com/orvi2014/rcs-db-ext) Python · 151 lines
29 def GetIconName(self):
30 if not self.IsExpandable():
31 return "python"
32 def IsEditable(self):
33 return self.setfunction is not None
139 from Tkinter import Tk
140 root = Tk()
141 root.configure(bd=0, bg="yellow")
142 root.focus_set()
143 sc = ScrolledCanvas(root, bg="white", highlightthickness=0, takefocus=1)
146 node = TreeNode(sc.canvas, None, item)
147 node.update()
148 root.mainloop()
150 if __name__ == '__main__':
dirac-configuration-shell.py (https://github.com/jpbaud/DIRAC.git) Python · 228 lines
1 #!/usr/bin/env python
3 """
4 Script that emulates the behaviour of a shell to edit the CS config.
5 """
6 import sys
12 from DIRAC.ConfigurationSystem.private.Modificator import Modificator
13 from DIRAC.ConfigurationSystem.Client.ConfigurationData import gConfigurationData
14 from DIRAC.Core.DISET.RPCClient import RPCClient
43 Connect to the CS
44 Usage: connect <URL> (Connect to the CS at the specified URL)
45 connect (Connect to the default CS URL of your config)
46 """
47 if line == "":
functions.py (https://gitlab.com/gregtyka/ka-lite) Python · 110 lines
66 'http://example.com?foo=stuff&biz=baz'
68 modified from http://stackoverflow.com/questions/4293460/how-to-add-custom-parameters-to-an-url-query-string-with-python
69 """
70 scheme, netloc, path, query_string, fragment = urlsplit(url)
84 def get_ip_addresses(include_loopback=True):
85 """Get a list of all the IP addresses for adapters on the local system.
87 You can specify to either include the loopback device (127.0.0.1) or not.
88 """
96 # on Windows, run ipconfig and parse the output
97 ipconfig = os.popen("ipconfig /all").read()
98 ips = [match[1] for match in re.findall("IP(v4)? Address[\.\: ]+([\d\.]+)", ipconfig)]
initConfig.py (https://github.com/pylight/P-2-Config-Tool.git) Python · 144 lines
47 def setOvpnFolder():
48 path = questionDialog("You choose openvpn as connection type. PP Config Tool will use the openvpn configuration files from the PP member downloads. Please get that package (https://www.perfect-privacy.com/members/All.ovpn.ubuntu.zip), extract it and input the path of that folder below:", os.path.expanduser("~/Downloads/All.ovpn.ubuntu"))
49 if not os.path.exists(path):
50 errorDialog("Error: the path " + path + " doesn't exist. Please make sure you entered the right values, check the tool configuration (" + defaultFile + ") and rerun this tool!")
54 # validate the config file
55 def checkConfig(config, path):
56 config.read(path)
99 with open(path, 'w') as configfile:
100 config.write(configfile)
101 else:
102 print("Configuration read without errors.")
107 # try to read tool configuration
108 mainconfig = configparser.RawConfigParser()
109 confpath = os.path.expanduser(defaultFile)
user.py (https://github.com/manuelnaranjo/remotecontrolserver.git) Python · 131 lines
9 from twisted.conch.ssh.forwarding import openConnectForwardingClient
10 from twisted.internet import reactor
11 from twisted.internet.task import LoopingCall
12 from twisted.conch.ssh.transport import DISCONNECT_RESERVED
13 from time import time
16 from checker import PublicKeyCredentialsChecker
17 from conf import config
18 import database
20 from twisted.python import log
22 import os
debian_ip_test.py (https://gitlab.com/ricardo.hernandez/salt) Python · 280 lines
4 '''
6 # Import Python libs
7 from __future__ import absolute_import
160 mock_ret = {'lo': {'enabled': True, 'data':
161 {'inet': {'addrfam': 'inet', 'proto': 'loopback'}}}}
162 with patch.object(debian_ip, '_parse_interfaces',
163 MagicMock(return_value=mock_ret)):
164 self.assertListEqual(debian_ip.get_interface('lo'),
165 [u'auto lo\n', u'iface lo inet loopback\n',
166 u'\n'])
identity.py (https://gitlab.com/gregtyka/server) Python · 131 lines
run_DetailedNetworkSim.py (https://gitlab.com/pranith/sst-elements) Python · 112 lines
1 #!/usr/bin/env python
2 '''
3 Date : 08/04/2015
4 Created by : Fulya Kaplan
5 Description : This main python script runs scheduler and ember simulations successively until completion.
6 '''
36 # Run scheduler for the first time and create the first snapshot
37 init_cmd = "sst ./%s" %(options.schedPythonFile)
38 run(init_cmd)
99 parser = OptionParser(usage="usage: %prog [options]")
100 parser.add_option("--emberOut", action='store', dest="emberOutFile", help="Name of the ember output file.")
101 parser.add_option("--schedPy", action='store', dest="schedPythonFile", help="Name of the python file that holds the scheduler parameters.")
102 (options, args) = parser.parse_args()
catalog (https://jedit.svn.sourceforge.net/svnroot/jedit) Unknown · 392 lines
iploggerapp.py (https://github.com/matthagy/ipython.git) Python · 103 lines
29 from IPython.utils.traitlets import Bool, Dict, Unicode
31 from IPython.parallel.apps.baseapp import (
32 BaseParallelApplication,
33 base_aliases,
42 #: The default config file name for this application
43 default_config_file_name = u'iplogger_config.py'
45 _description = """Start an IPython logger for parallel computing.
65 name = u'iplogger'
66 description = _description
67 config_file_name = Unicode(default_config_file_name)
69 classes = [LogWatcher, ProfileDir]
77 def init_watcher(self):
78 try:
79 self.watcher = LogWatcher(config=self.config, log=self.log)
80 except:
81 self.log.error("Couldn't start the LogWatcher", exc_info=True)
memleak_gui.py (https://bitbucket.org/jmcmorris/escape.git) Python · 109 lines
51 import matplotlib.cbook as cbook
53 print('# columns are: iteration, OS memory (k), number of python objects')
54 print('#')
55 for i in range(indEnd+1):
63 if options.verbose:
64 if i % 10 == 0:
65 #print ("iter: %4d OS memory: %8d Python objects: %8d" %
66 print ("%4d %8d %8d" %
67 (i, val, len(gc.get_objects())))
90 (PyQt4.pyqtconfig.Configuration().pyqt_version_str,
91 PyQt4.pyqtconfig.Configuration().qt_version))
92 elif backend.startswith("qt"):
93 import pyqtconfig
95 (pyqtconfig.Configuration().pyqt_version_str,
96 pyqtconfig.Configuration().qt_version))
97 elif backend.startswith("wx"):
98 import wx
run_function.py (https://gitlab.com/tlevine/parakeet) Python · 135 lines
2 from .. import config, type_inference
3 from ..analysis import contains_loops
16 fn = ast_conversion.translate_function_value(fn)
18 nonlocals = list(fn.python_nonlocals())
19 arg_values = ActualArgs(nonlocals + list(args), kwargs)
69 if backend is None:
70 backend = config.backend
72 if backend == 'c':
84 elif backend == 'llvm':
85 from ..llvm_backend.llvm_context import global_context
86 from ..llvm_backend import generic_value_to_python
87 from ..llvm_backend import ctypes_to_generic_value, compile_fn
88 lowered_fn = pipeline.lowering.apply(fn)
toc.py (https://github.com/smorstabilini/ilmioquartiere.git) Python · 140 lines
29 header = etree.SubElement(div, "span")
30 header.attrib["class"] = "toctitle"
31 header.text = self.config["title"][0]
33 level = 0
80 # Do not override pre-existing ids
81 if not "id" in c.attrib:
82 id = self.config["slugify"][0](c.text)
83 if id in used_ids:
84 ctr = 1
134 def extendMarkdown(self, md, md_globals):
135 tocext = TocTreeprocessor(md)
136 tocext.config = self.config
137 md.treeprocessors.add("toc", tocext, "_begin")
139 def makeExtension(configs={}):
140 return TocExtension(configs=configs)
WorkQueueManager.py (https://github.com/dmwm/WMCore.git) Python · 80 lines
15 from WMComponent.WorkQueueManager.WorkQueueManagerWorkPoller import WorkQueueManagerWorkPoller
16 from WMCore.Agent.Harness import Harness
17 from WMCore.WorkQueue.WorkQueueUtils import queueFromConfig, queueConfigFromConfigObject
28 Harness.__init__(self, config)
29 self.config = queueConfigFromConfigObject(config)
31 def preInitialization(self):
43 myThread.workerThreadManager.addWorker(
44 WorkQueueManagerReqMgrPoller(
45 queueFromConfig(self.config),
46 getattr(self.config.WorkQueueManager,
74 # Clean finished work & apply end policies
75 myThread.workerThreadManager.addWorker(
76 WorkQueueManagerCleaner(queueFromConfig(self.config),
77 self.config),
Binned_AlphaT_HT_325.py (https://github.com/brynmathias/AnalysisV2.git) Python · 134 lines
1 #!/usr/bin/env python
3 import setupSUSY
7 from time import strftime
8 from time import strftime
9 from Binned_Sample_Config import *
11 mu_id = PSet(
12 doJetLoop = False,
13 MuID = "Tight",
14 MinPt = 10.,
25 #======== Filters ===========
26 from wpol.muon_config import muon_id # ,conf
27 from ra1objectid.vbtfMuonId_cff import *
28 from ra1objectid.vbtfElectronId_cff import *
test_nnet.py (https://github.com/yosinski/Theano.git) Python · 159 lines
4 import theano
5 from theano.gof.python25 import any
6 import theano.tensor as T
7 import theano.tests.unittest_tools as utt
22 This is basic test for GpuCrossentropySoftmaxArgmax1HotWithBias
24 We check that we loop when their is too much threads
26 """
47 dot_result = T.fmatrix('dot_result')
49 # Seed numpy.random with config.unittests.rseed
50 utt.seed_rng()
dodo.py (https://gitlab.com/xbsd/topicalguide) Python · 147 lines
8 from doit.tools import create_folder
10 DOIT_CONFIG = {'default_tasks': ['checker', 'ut']}
12 CODE_FILES = glob.glob("doit/*.py")
72 ############# python3
74 # distribute => setup.py test together with use_2to3 doesnt work hence this
98 target_path = DOC_BUILD_PATH + 'api/'
99 return {'actions':[(create_folder, [target_path]),
100 ("epydoc --config %sepydoc.config " % DOC_ROOT +
101 "-o %(targets)s")],
102 'file_dep': CODE_FILES,
CyclicSymbolicBoundedLTLEvaluation.py (https://github.com/dparalen/cycle-evaluation.git) Python · 151 lines
38 class Or(le.Or):
39 def __call__(self, Expressions, position = 0, length = 0, loop = 0):
40 ltl_expressions, other_expressions = _split_expressions(Expressions)
41 return NOE(ee.Or(), Expressions = map(lambda x: x(position,
60 # in loop
61 return Expression(loop + ((position - loop + 1)%(length - loop)),
62 length, loop)
65 class Globally(le.Globally):
66 def __call__(self, Expression, position = 0, length = 0, loop = 0):
67 if _ltl_expression(Expression):
68 return NOE(ee.And(), Expressions = \
81 [ Expression(j, length, loop) for j in xrange(
82 min(position, loop), length)]
83 )
84 return NOE(ee.Or(), Expressions = \
test_smtp.py (https://github.com/yarikoptic/fail2ban.git) Python · 132 lines
1 # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: t -*-
2 # vi: set ft=python sts=4 ts=4 sw=4 noet :
48 """Call before every test case."""
49 self.jail = DummyJail()
50 pythonModule = os.path.join(CONFIG_DIR, "action.d", "smtp.py")
51 pythonModuleName = os.path.basename(pythonModule.rstrip(".py"))
52 if sys.version_info >= (3, 3):
53 customActionModule = importlib.machinery.SourceFileLoader(
54 pythonModuleName, pythonModule).load_module()
55 else:
56 customActionModule = imp.load_source(
57 pythonModuleName, pythonModule)
59 self.smtpd = TestSMTPServer(("localhost", 0), None)
javascript.py (https://github.com/jgehring/Laudio.git) Python · 94 lines
1 #!/usr/bin/env python
2 #-*- coding:utf-8 -*-
3 """
44 """check settings values"""
45 try:
46 config = Settings.objects.get(pk=1)
47 if request.user.is_authenticated():
48 if request.user.get_profile().showLib and self.view == "library":
49 files.append("func/autoload.js")
50 else:
51 if config.showLib and self.view == "library":
52 files.append("func/autoload.js")
53 except Settings.DoesNotExist, AttributeError:
77 content = ""
78 # loop over files and build the content
79 for f in files:
80 # get the javascript from the file
sort.py (https://github.com/dkujawski/utilities.git) Python · 86 lines
1 # By Jimmy Ruska
2 # Sorts Desktop and Downloads folder by extension.
3 # Made for easy modification. Tested: Windows/Ubuntu Python 2.7, 3.2.
4 # Beware, it will also move folders and program Shortcuts.
6 import ConfigParser
7 import os
8 import re
13 """ By Jimmy Ruska
14 Sorts Desktop and Downloads folder by extension.
15 Made for easy modification. Tested: Windows/Ubuntu Python 2.7, 3.2.
16 Beware, it will also move folders and program Shortcuts.
22 """ read the config file
23 """
24 config = ConfigParser.ConfigParser()
25 config.read(cfg_path)
batch_sampler.py (https://github.com/facebookresearch/pytext.git) Python · 276 lines
15 @classmethod
16 def from_config(cls, config: Component.Config):
17 return cls()
87 @classmethod
88 def from_config(cls, config: Config):
89 return cls(config.iter_to_set_epoch)
179 @classmethod
180 def from_config(cls, config: Config):
181 return cls(config.unnormalized_iterator_probs)
222 @classmethod
223 def from_config(cls, config: Config):
224 assert (
225 len(config.unnormalized_iterator_probs) > 0
session.py (https://github.com/Grahack/geophar.git) Python · 172 lines
19 no_ipython = """\
20 Couldn't locate IPython. Having IPython installed is greatly recommended.
21 See http://ipython.scipy.org for more details. If you use Debian/Ubuntu,
77 return app.shell
78 else:
79 from IPython.Shell import make_IPython
80 return make_IPython(argv)
114 def init_session(ipython=None, pretty_print=True, order=None,
115 use_unicode=None, quiet=False, argv=[]):
116 """Initialize an embedded IPython or Python session. """
117 import sys
154 # and False means don't add the line to IPython's history.
155 ip.runsource = lambda src, symbol='exec': ip.run_cell(src, False)
156 mainloop = ip.mainloop
157 else:
158 mainloop = ip.interact
teacherInterface.py (https://bitbucket.org/icbmike/se206finalproject.git) Python · 170 lines
1 #!/usr/bin/env python
2 from Tkinter import Tk, Frame, Label, SUNKEN, W, LEFT, Entry, Message, Button
3 from Views import ListView, CreateView, StudentView
12 viewcreate.pack()
13 viewstudents.pack_forget()
14 lNavViewLists.configure(bg="white", fg="black")
15 lNavCreateLists.configure(bg="#DDDDDD", fg="#8800AA")
16 lNavStudentRecords.configure(bg="white", fg="black")
17 viewcreate.update_category()
18 elif frameNumber == 2:
20 viewlists.pack()
21 viewstudents.pack_forget()
22 lNavCreateLists.configure(bg="white", fg="black")
23 lNavViewLists.configure(bg="#DDDDDD", fg="#8800AA")
sizet.i (https://swig.svn.sourceforge.net/svnroot/swig) Unknown · 53 lines
runme.py
(https://swig.svn.sourceforge.net/svnroot/swig)
Python · 35 lines
✨ Summary
The code attempts to call C functions printf
, fprintf
, and printv
from a Python script, which is not possible in pure Python. The output will likely be garbled due to incorrect formatting and interpretation of the input strings. The program’s intention seems to be demonstrating the limitations of calling C functions from Python.
The code attempts to call C functions printf
, fprintf
, and printv
from a Python script, which is not possible in pure Python. The output will likely be garbled due to incorrect formatting and interpretation of the input strings. The program’s intention seems to be demonstrating the limitations of calling C functions from Python.
__init__.py (https://gitlab.com/132nd-etcher/glances) Python · 193 lines
120 # Init the standalone mode
121 standalone = GlancesStandalone(config=core.get_config(),
122 args=core.get_args())
134 # Init the client
135 client = GlancesClientBrowser(config=core.get_config(),
136 args=core.get_args())
167 server = GlancesServer(cached_time=core.cached_time,
168 config=core.get_config(),
169 args=args)
170 print('Glances server is running on {0}:{1}'.format(args.bind_address, args.port))
glances_config.py (https://gitlab.com/xbsd/glances) Python · 164 lines
24 import sys
25 try:
26 from configparser import RawConfigParser
27 from configparser import NoOptionError
65 """Load a config file from the list of paths, if it exists."""
66 for config_file in self.get_config_paths():
67 if os.path.isfile(config_file) and os.path.getsize(config_file) > 0:
73 logger.info("Read configuration file '{0}'".format(config_file))
74 except UnicodeDecodeError as e:
75 logger.error("Cannot decode configuration file '{0}': {1}".format(config_file, e))
76 sys.exit(1)
77 # Save the loaded configuration file path (issue #374)
78 self._loaded_config_file = config_file
79 break
__main__.py (https://github.com/jkoshy/osm-api-server.git) Python · 119 lines
34 # Where to find configuration information.
35 default_config_directory = "config"
36 default_config_file = "osm-api-server.cfg"
39 type=str, metavar="BACKEND",
40 help="datastore backend to use")
41 tornado.options.define("config", default=default_config_file,
42 type=str, metavar="FILE",
43 help="configuration file to use")
67 import configparser # Python 3.0
68 except ImportError:
69 import ConfigParser as configparser
71 # Read configuration information.
108 # Start the server.
109 try:
110 tornado.ioloop.IOLoop.instance().start()
111 except KeyboardInterrupt:
112 if options.verbose:
LampRebin.py (https://github.com/mantidproject/documents.git) Python · 111 lines
1 from mantid import config
2 from mantid.kernel import *
3 from mantid.api import *
32 dif = 0 # variable to get closest x value
33 found = False # variable to know when to break
34 start = ind # variable to start where last loop left off
35 for i in range(start, end_i): #iterate through original xvalues
36 temp = math.fabs((datax[i] - value)) # get difference
37 if (dif == 0) | (temp<dif): # only select the lowest difference
38 dif = temp
39 ind = i # at the end of the loop, should contain the index of the closest x value in the original x data
40 if (round(temp) == 0) & (found == False): #once you've got the right integer value, you've "found" the value
41 found = True
72 return output
74 class LampRebin(PythonAlgorithm):
76 def PyInit(self):
svnpoller.py (https://gitlab.com/murder187ss/buildbot) Python · 99 lines
1 #!/usr/bin/python
2 """
3 svn.py
20 # USA
22 import ConfigParser
23 import commands
24 import os.path
27 # change these settings to match your project
28 svnurl = "https://pse.cheme.cmu.edu/svn/ascend/code/trunk"
29 statefilename = "~/changemonitor/config.ini"
30 buildmaster = "buildbot.example.org:9989" # connects to a PBChangeSource
60 fname = statefilename
61 fname = os.path.expanduser(fname)
62 ini = ConfigParser.SafeConfigParser()
64 try:
statsite.py (https://github.com/deactivated/statsite.git) Python · 153 lines
32 # Define and parse the command line options
33 parser = OptionParser()
34 parser.add_option("-c", "--config", action="append", dest="config_files",
35 default=[], help="path to a configuration file")
49 if len(self.options.config_files) > 0:
50 self._parse_settings_from_file(self.options.config_files)
52 self._parse_settings_from_options()
76 # Apparently `thread.join` blocks the main thread and makes it
77 # _uninterruptable_, so we need to do this loop so that the main thread
78 # can respond to signal handlers.
79 while thread.isAlive():
91 Parses settings from a configuration file.
92 """
93 config = ConfigParser.RawConfigParser()
94 if config.read(paths) != paths:
changelist.py (https://gitlab.com/Tu-dou520/FlymeOS5-tools) Python · 185 lines
21 import xml.dom.minidom
23 from config import Config
24 from formatters.log import Log
177 for arg in sys.argv:
178 if arg in ("--make", "-m"):
179 ChangeList(Config.AOSP_ROOT, Config.BOSP_ROOT, Config.PATCHALL_XML).make()
180 sys.exit(0)
181 elif arg in ("--show", "-s"):
182 ChangeList(Config.AOSP_ROOT, Config.BOSP_ROOT, Config.PATCHALL_XML).show()
183 sys.exit(0)
app.py (https://github.com/cezarsa/thumbor.git) Python · 95 lines
1 #!/usr/bin/python
2 # -*- coding: utf-8 -*-
14 import tornado.web
15 import tornado.ioloop
16 from tornado.options import parse_config_file, options
18 from thumbor.config import conf
19 from thumbor.handlers.unsafe import MainHandler
20 from thumbor.handlers.healthcheck import HealthcheckHandler
30 conf_file = ThumborServiceApp.get_conf_file(conf_file)
32 logger.info('Config file: %s' % conf_file)
33 parse_config_file(conf_file)
typesystem.py (https://github.com/HonzaKral/bulbs.git) Python · 169 lines
5 #
7 import config
8 from property import Property, convert_to_rexster, convert_to_python
10 TYPE_VAR = config.TYPE_VAR
12 # NOTE: Here the word "Property" in ClassProperty refers to a Python property (lowercase)
23 cls._properties = {}
25 # loop through the class namespace looking for Property instances
26 for key, value in namespace.items():
27 #print key,value
56 try:
57 if value:
58 python_type = self._properties[key].datatype.python_type
59 # TODO: this is a HACK until we clean up 'None' values in DB
60 if value == 'None':
configparserinc.py (https://github.com/Lovestick/fail2ban.git) Python · 111 lines
1 # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: t -*-
2 # vi: set ft=python sts=4 ts=4 sw=4 noet :
4 # This file is part of Fail2Ban.
30 import logging, os
31 from ConfigParser import SafeConfigParser
33 # Gets the instance of the logger.
34 logSys = logging.getLogger("fail2ban.client.config")
36 class SafeConfigParserWithIncludes(SafeConfigParser):
37 """
38 Class adds functionality to SafeConfigParser to handle included
39 other configuration files (or may be urls, whatever in the future)
41 File should have section [includes] and only 2 options implemented
mediaplayer.py (https://github.com/dbrgn/dotfiles.git) Python · 127 lines
1 #!/usr/bin/env python3
2 import argparse
3 import logging
73 sys.stdout.write('\n')
74 sys.stdout.flush()
75 # loop.quit()
76 sys.exit(0)
94 # Initialize logging
95 logging.basicConfig(stream=sys.stderr, level=logging.DEBUG,
96 format='%(name)s %(levelname)s %(message)s')
105 manager = Playerctl.PlayerManager()
106 loop = GLib.MainLoop()
108 manager.connect('name-appeared', lambda *args: on_player_appeared(*args, arguments.player))
filterreader.py (https://github.com/fail2ban/fail2ban.git) Python · 100 lines
1 # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: t -*-
2 # vi: set ft=python sts=4 ts=4 sw=4 noet :
28 import shlex
30 from .configreader import DefinitionInitConfigReader
31 from ..helpers import getLogger
37 class FilterReader(DefinitionInitConfigReader):
39 _configOpts = {
49 def setFile(self, fileName):
50 self.__file = fileName
51 DefinitionInitConfigReader.setFile(self, os.path.join("filter.d", fileName))
53 def getFile(self):
asp_tool.py (https://bitbucket.org/duventj/nrfasp.git) Python · 137 lines
1 #!/usr/bin/env python3
2 # @author Mehdi MAAREF
97 print(self.device.send_mirf_raw_multi_cmd(cmd_buffer))
98 self.do_mirf_read_all()
99 def do_mirf_config(self, args=''):
100 print(self.device.set_rx())
101 self.do_mirf_read_all()
124 while(not exit):
125 try:
126 p.cmdloop()
127 except KeyboardInterrupt:
128 print('^C')
test_converge.py (https://gitlab.com/syjulian/poc-heat-mversion) Python · 42 lines
1 #!/usr/bin/env python
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License"); you may
19 from heat.tests.convergence.framework import scenario
20 from heat.tests.convergence.framework import testutils
21 from oslo_config import cfg
39 self.procs.clear()
40 runner = scenario.Scenario(self.name, self.path)
41 runner(self.procs.event_loop,
42 **testutils.scenario_globals(self.procs, self))
host_test_plugins.py (https://github.com/adamgreen/gcc4mbed.git) Python · 119 lines
42 ###########################################################################
43 def setup(self, *args, **kwargs):
44 """ Configure plugin, this function should be called before plugin execute() method is used.
45 """
46 return False
49 """ Executes capability by name.
50 Each capability e.g. may directly just call some command line
51 program or execute building pythonic function
52 """
53 return False
78 return True
80 def check_mount_point_ready(self, destination_disk, init_delay=0.2, loop_delay=0.25):
81 """ Checks if destination_disk is ready and can be accessed by e.g. copy commands
82 @init_delay - Initial delay time before first access check
health_check_service.py (https://github.com/theosp/google_appengine.git) Python · 169 lines
1 #!/usr/bin/env python
2 #
3 # Copyright 2007 Google Inc.
81 """
83 def __init__(self, instance, config, send_request, restart):
84 """Initializes a HealthChecker object.
91 """
92 self._instance = instance
93 self._config = config
94 self._send_request = send_request
95 self._restart = restart
99 logging.info('Health checks starting for instance %s.',
100 self._instance.instance_id)
101 loop = threading.Thread(target=self._loop)
102 loop.daemon = True
test_tcp.py (https://gitlab.com/x1046882802/flexiroutervpp) Python · 115 lines
1 #!/usr/bin/env python3
3 import unittest
21 super(TestTCP, self).setUp()
22 self.vapi.session_enable_disable(is_enable=1)
23 self.create_loopback_interfaces(2)
25 table_id = 0
30 if table_id != 0:
31 tbl = VppIpTable(self, table_id)
32 tbl.add_vpp_config()
34 i.set_table_ip4(table_id)
35 i.config_ip4()
36 table_id += 1
memleak_gui.py (https://gitlab.com/sagarjhaa/matplotlib) Python · 103 lines
1 #!/usr/bin/env python
3 '''
11 The default number of loops typically will not yield a stable
12 estimate--for that you may need many hundreds of loops and some patience.
14 You may need to edit cbook.report_memory to support your platform
50 import matplotlib.cbook as cbook
52 print('# columns are: iteration, OS memory (k), number of python objects')
53 print('#')
54 for i in range(indEnd + 1):
87 import PyQt4.pyqtconfig
88 print("# PyQt4 version: %s, Qt version %x" % \
89 (PyQt4.pyqtconfig.Configuration().pyqt_version_str,
90 PyQt4.pyqtconfig.Configuration().qt_version))
socks5.py (https://github.com/energicryptocurrency/energi.git) Python · 164 lines
1 #!/usr/bin/env python3
2 # Copyright (c) 2015-2018 The Energi Core developers
3 # Distributed under the MIT software license, see the accompanying
36 ### Implementation classes
37 class Socks5Configuration(object):
38 '''Proxy configuration'''
157 def stop(self):
158 self.running = False
159 # connect to self to end run loop
160 s = socket.socket(self.conf.af)
161 s.connect(self.conf.addr)
launchnotebook.py (https://gitlab.com/yeah568/notebook) Python · 151 lines
18 from mock import patch #py2
20 from tornado.ioloop import IOLoop
22 import jupyter_core.paths
76 'PYTHONPATH': os.pathsep.join(sys.path),
77 'IPYTHONDIR': pjoin(cls.home_dir.name, '.ipython'),
78 'JUPYTER_DATA_DIR' : data_dir.name
79 })
97 notebook_dir=cls.notebook_dir.name,
98 base_url=cls.url_prefix,
99 config=cls.config,
100 )
101 # don't register signal handler during tests
108 app.log.propagate = True
109 app.log.handlers = []
110 loop = IOLoop.current()
111 loop.add_callback(started.set)
dustFrameImage.py (https://bitbucket.org/marcmorenob/smartmesharduinocam.git) Python · 115 lines
1 #!/usr/bin/python
3 import sys
80 self.guiLock.acquire()
81 print "Stop automatic capturing ..."
82 self.startStopButton.configure(text='Start Auto')
83 self.guiLock.release()
84 else:
86 print "Start automatic capturing ..."
87 self.isAutomatic = True
88 self.startStopButton.configure(text='Stop Auto')
89 self.guiLock.release()
102 self.frame = dustFrameImage(self.window,self.guiLock,self._startPressedCb,row=0,column=0)
103 self.frame.show()
104 self.window.mainloop()
106 def _startPressedCb(self):
demo.py (https://github.com/madkote/fastapi-plugins.git) Python · 335 lines
275 config = MoreSettings()
276 await memcached_plugin.init_app(app=app, config=config)
277 await memcached_plugin.init()
291 print(os.linesep * 3)
292 print('=' * 50)
293 loop = asyncio.get_event_loop()
294 loop.run_until_complete(test_memcached())
313 print(os.linesep * 3)
314 print('=' * 50)
315 loop = asyncio.get_event_loop()
316 loop.run_until_complete(test_demo())
319 print(os.linesep * 3)
320 print('=' * 50)
321 loop = asyncio.get_event_loop()
322 loop.run_until_complete(test_demo_custom_log())
redemo.py (https://gitlab.com/envieidoc/Clover) Python · 171 lines
49 self.stringdisplay = Text(self.master, width=60, height=4)
50 self.stringdisplay.pack(fill=BOTH, expand=1)
51 self.stringdisplay.tag_configure("hit", background="yellow")
53 self.grouplabel = Label(self.master, text="Groups:", anchor=W)
104 self.getflags())
105 bg = self.promptdisplay['background']
106 self.statusdisplay.config(text="", background=bg)
107 except re.error, msg:
108 self.compiled = None
109 self.statusdisplay.config(
110 text="re.error: %s" % str(msg),
111 background="red")
test_language.py (https://gitlab.com/gupta.d.gaurav/part-ii-individual-project-dev) Python · 424 lines
10 from app.test import motivating_applications
12 logging.basicConfig(level=logging.DEBUG,format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
14 class TestDoctests(unittest.TestCase):
28 pass
30 def test_create_inner_loop_scenes(self):
31 """
32 Tests creating scenes to describe inner loop from the example.
75 )
77 def test_translate_inner_loop_scenes(self):
78 """
79 Tests translating scenes describing inner loop from the example.
CurrentSong.py (https://github.com/RoDaniel/featurehouse.git) Python · 150 lines
2 import gettext
3 class CurrentSong(object):
4 customConfig = {}
5 def __init__( self ):
6 self.playing = ''
63 def getCoverPath( self ):
64 return None
65 def updateConfig( self ):
66 pass
67 def cmd_Show( self , *args):
91 import dbus.glib
92 elif dbus_version >= (0,80,0):
93 from dbus.mainloop.glib import DBusGMainLoop
94 DBusGMainLoop(set_as_default=True)
95 dbus.SessionBus()
96 else:
97 self.log('error', 'python-dbus is too old!')
98 raise
99 except Exception, e:
configtool.py (https://github.com/excid3/chromium.git) Python · 122 lines
1 #!/usr/bin/env python
2 # Copyright (c) 2001, Stanford University
3 # All rights reserved.
8 # Brian Paul
10 """This is the top-level application module for the graphical config tool."""
13 import os, sys
14 from wxPython.wx import *
15 import graph, crutils
59 Under MS Windows, the standard DOS console window doesn't scroll and
60 closes as soon as the application exits, making it hard to find and
61 view Python exceptions. This utility class allows you to handle Python
62 exceptions in a more friendly manner.
63 """
verbose.py (https://gitlab.com/skororu/pysnippets) Python · 267 lines
1 #!/usr/bin/env python3
2 """
3 test of a suitable method to replace the rather serial main control loop
16 * 2 processes, running function 'collect'
17 to simulate collecting completed blocks from nodes
18 1 control loop that checks if the blocks have all been received
20 in essence the design carries out the renders and performs
221 parfun.append(mp.Process(target=collect, args=(blocks_q, collect_q, retire_q, run_q)))
223 # give the user basic configuration information
224 print(num_blocks, 'blocks to be rendered on', num_nodes, 'nodes, using', \
225 num_nodes, 'render processes and', num_collectors, 'collector processes')
log.py (https://github.com/miracle2k/celery.git) Python · 176 lines
36 logger = get_default_logger(loglevel=loglevel)
37 if logger.handlers:
38 # Logger already configured
39 return logger
40 if logfile:
106 """Make the logger handlers dump internal errors to
107 ``sys.__stderr__`` instead of ``sys.stderr`` to circumvent
108 infinite loops."""
110 def wrap_handler(handler):
119 sys.__stderr__)
120 except IOError:
121 pass # see python issue 5971
122 finally:
123 del(exc_info)
generate_parm_table.py (https://bitbucket.org/knarf/samba.git) Python · 222 lines
1 #!/usr/bin/env python
2 ######################################################################
3 ##
98 lines = string.split( testparm_output, "\n" )
100 ## loop through list -- parameters in testparm output have ##
101 ## whitespace at the beginning of the line ##
122 try:
123 fconfig = open( sys.argv[1], "r" )
124 except IOError:
125 print "%s does not exist!" % sys.argv[1]
126 sys.exit (1)
128 ## Loop through loadparm.c -- all parameters are either ##
129 ## P_LOCAL or P_GLOBAL ##
monitor.py (https://github.com/ximenesuk/openmicroscopy.git) Python · 74 lines
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
12 import unittest, logging, threading, time
13 logging.basicConfig(level=logging.INFO)
15 import omero
32 def testBadFileId(self):
33 # Could cause infinite loop
34 self.assertRaises(omero.ApiUsageException, MockMonitor().fsEventHappened, '',[monitors.EventInfo()])
guimain.py (https://github.com/numerodix/galleryforge.git) Python · 113 lines
1 #!/usr/bin/python
3 """
15 import wx, glade_guimain
16 import launch
17 from config import config
51 def initForms(self):
52 settings = config.read()
53 self.image_size_x.SetValue(int(settings['image_size_x']))
54 self.image_size_y.SetValue(int(settings['image_size_y']))
90 "rebuild_thumbnails": self.rebuild_thumbnails.GetValue(),
91 }
92 config.store(settings)
run.py (https://github.com/Caustic/netfpga.git) Python · 159 lines
app.py (https://github.com/yarikoptic/ipython01x.git) Python · 156 lines
18 import time
20 from IPython.frontend.terminal.ipapp import TerminalIPythonApp, frontend_flags as term_flags
22 from IPython.utils.traitlets import (
41 ipython console # start the ZMQ-based console
42 ipython console --existing # connect to an existing ipython session
43 """
80 class ZMQTerminalIPythonApp(TerminalIPythonApp, IPythonConsoleApp):
81 name = "ipython-console"
117 self.shell = ZMQTerminalInteractiveShell.instance(config=self.config,
118 display_banner=False, profile_dir=self.profile_dir,
119 ipython_dir=self.ipython_dir, kernel_manager=self.kernel_manager)
121 def init_gui_pylab(self):
toc.py (https://github.com/Wilfred/Python-Markdown.git) Python · 157 lines
102 link.attrib["href"] = '#' + id
104 if int(self.config["anchorlink"]):
105 anchor = etree.Element("a")
106 anchor.text = c.text
125 class TocExtension(markdown.Extension):
126 def __init__(self, configs):
127 self.config = { "marker" : ["[TOC]",
146 def extendMarkdown(self, md, md_globals):
147 tocext = TocTreeprocessor(md)
148 tocext.config = self.getConfigs()
149 # Headerid ext is set to '>inline'. With this set to '<prettify',
150 # it should always come after headerid ext (and honor ids assinged
156 def makeExtension(configs={}):
157 return TocExtension(configs=configs)
monitor.py (https://github.com/cneves/openmicroscopy.git) Python · 73 lines
admin.py (https://github.com/aherbert/openmicroscopy.git) Python · 170 lines
1 #!/usr/bin/env python
3 """
57 grid_dir = self.cli.dir / "etc" / "grid"
58 self.cli.register("a", AdminControl, "TEST")
59 self.cli.register("config", PrefsControl, "TEST")
61 def tearDown(self):
73 self.invoke("")
74 except NonZeroReturnCode:
75 # Command-loop not implemented
76 pass
116 self.assert_( "omero" in l, str(l) )
118 def testProperMethodsUseConfigXml(self):
119 self.fail("NYI")
settings.py (https://github.com/lann/mopidy.git) Python · 273 lines
6 Do *not* change settings directly in :mod:`mopidy.settings`. Instead, add a
7 file called ``~/.config/mopidy/settings.py`` and redefine settings there.
8 """
23 #: The log format used for informational logging.
24 #:
25 #: See http://docs.python.org/library/logging.html#formatter-objects for
26 #: details on the format.
27 CONSOLE_LOG_FORMAT = u'%(levelname)-8s %(message)s'
37 #: The log format used for debug logging.
38 #:
39 #: See http://docs.python.org/library/logging.html#formatter-objects for
40 #: details on the format.
41 DEBUG_LOG_FORMAT = u'%(levelname)-8s %(asctime)s' + \
mesh_measurer_node.py (https://gitlab.com/jsanch/udom) Python · 234 lines
52 import udom_modeling_msgs.msg
53 import udom_geometric_transformation.mesh_measurer_utils as utils
54 from udom_geometric_transformation.cfg import MeshDisparityConfig as MeshDisparity
83 # Node cycle rate (in Hz).
84 self.loop_rate = rospy.Rate(rospy.get_param('~loop_rate', 100))
85 # Publishers
86 self.event_out = rospy.Publisher("~event_out", std_msgs.msg.String, queue_size=10)
97 dynamic_reconfig_srv = Server(MeshDisparity, self.dynamic_reconfig_cb)
99 def dynamic_reconfig_cb(self, config, level):
100 """
101 Reconfigures the weights for the disparity measure.
airdrop_leak.py (https://github.com/hexway/apple_bleee.git) Python · 134 lines
1 #!/usr/bin/env python3
2 # Author: Dmitry Chastuhin
3 # Twitter: https://twitter.com/_chipik
10 # Don't forget to install https://github.com/seemoo-lab/owl before using this script
11 # 1. Install owl
12 # 2. iwconfig wlan0 mode monitor
13 # 3. ip link set wlan0 up
14 # 4. owl -i wlan0 -N
97 thread2.start()
99 # OMG i'm a programmer loop here
100 while 1:
101 time.sleep(5)
textdialog.py (https://github.com/excid3/chromium.git) Python · 113 lines
10 """The TextDialog class defines a dialog window for displaying bulk text."""
12 from wxPython.wx import *
13 from wxPython.html import *
85 global app
86 self.Destroy()
87 app.ExitMainLoop()
96 dialog = TextDialog(parent=frame, id=-1, title="Help!")
97 #dialog.LoadPage("reassembly.html")
98 dialog.LoadPage("../../doc/configtool.html")
99 dialog.Centre()
100 #dialog.ShowModal()
105 global app
106 app = __TestApp()
107 app.MainLoop()
108 return
08_vtpm-mig_pcrs.py (https://gitlab.com/wkyu/gxen) Python · 119 lines
1 #!/usr/bin/python
3 # Copyright (C) International Business Machines Corp., 2006
19 config = {"vtpm":"instance=1,backend=0"}
20 domain = XmTestDomain(extraConfig=config)
21 domName = domain.getName()
22 consoleHistory = ""
72 old_domid = domid(domName)
74 loop = 0
75 while loop < 3:
92 if (old_domid == new_domid):
93 FAIL("xm migrate failed, domain id is still %s (loop=%d)" %
94 (old_domid,loop))
tt060.py (https://github.com/jasoncbautista/Focus-Motivator.git) Python · 131 lines
52 Note that, although they aren't specified on the "bind" operation, self.button1Click()
53 will be passed two arguments. The first, of course, will be "self", which is always the first
54 argument to all class methods in Python. The second will be an event object. This technique of binding
55 and event (that is, using the bind() method) always implicitly passes an event object as
56 an argument.
58 In Python/Tkinter, when an event occurs, it takes the form of an event object. An
59 event object is extremely useful, because it carries with it all sorts of useful information
60 and methods. You can examine the event object to find out what kind of event occurred,
109 self.button1 = Button(self.myContainer1)
110 self.button1.configure(text="OK", background= "green")
111 self.button1.pack(side=LEFT)
112 self.button1.bind("<Button-1>", self.button1Click) ### (1)
twitterdemo.py (https://gitlab.com/0072016/Id-Facebook-name-SDK-) Python · 93 lines
1 #!/usr/bin/env python
2 """A simplistic Twitter viewer to demonstrate the use of TwitterMixin.
22 from tornado.auth import TwitterMixin
23 from tornado.escape import json_decode, json_encode
24 from tornado.ioloop import IOLoop
25 from tornado import gen
26 from tornado.options import define, options, parse_command_line, parse_config_file
29 define('port', default=8888, help="port to listen on")
30 define('config_file', default='secrets.cfg',
31 help='filename for additional configuration')
75 def main():
76 parse_command_line(final=False)
77 parse_config_file(options.config_file)
79 app = Application(
listdir.py (https://github.com/toastdriven/pydanny-event-notes.git) Python · 126 lines
1 #!/usr/bin/env python
2 # $Id: listdir.py,v 1.8 2000/05/26 10:19:30 wesc Exp $
3 #
27 self.dirs = Tkinter.Listbox(self.dirfm, height=15, width=50, yscrollcommand=self.dirsb.set)
28 self.dirs.bind('<Double-1>', self.setdirandgo)
29 self.dirsb.config(command=self.dirs.yview)
30 self.dirs.pack(side=Tkinter.LEFT, fill=Tkinter.BOTH)
31 self.dirfm.pack()
62 # set red bg while searching
63 self.dirs.config(selectbackground='red')
65 # grab listbox selection, default to ('.') os.curdir if not there
99 self.last = os.curdir
100 self.cwd.set(self.last)
101 self.dirs.config(selectbackground='LightSkyBlue')
102 self.top.update()
103 if vi:
gyptest-all.py (https://bitbucket.org/ultra_iter/qt-vtl.git) Python · 35 lines
launcher-guide.xml (https://jedit.svn.sourceforge.net/svnroot/jedit) XML · 592 lines
305 functions of jEditLauncher are available to scripting languages in the
306 Windows environment such as VBScript, JScript, Perl (using the
307 Win32::OLE package) and Python (using the win32com.client package).
308 </para>
408 available for download for 32-bit Windows operating systems. The next
409 example is written in Perl and requires the Win32::OLE package. The
410 last is written in Python and requires the win32gui and win32com.client
411 extensions.
412 </para>
462 $launcher->evalScript($script);</programlisting></informalexample>
464 <informalexample><programlisting># Example Python script using jEditLauncher interface
465 import win32gui
466 import win32com.client
lists.js
(http://enginey.googlecode.com/svn/trunk/)
JavaScript · 145 lines
✨ Summary
This JavaScript code defines a set of utility functions for working with lists, including sorting, filtering, and manipulating list elements. It provides methods such as dictsort
to sort dictionaries by key, unordered_list
to generate HTML unordered lists from nested lists, and others like slice
, random
, and length
. These functions can be used in a Dojo application to manipulate data.
This JavaScript code defines a set of utility functions for working with lists, including sorting, filtering, and manipulating list elements. It provides methods such as dictsort
to sort dictionaries by key, unordered_list
to generate HTML unordered lists from nested lists, and others like slice
, random
, and length
. These functions can be used in a Dojo application to manipulate data.
50 },
51 join: function(value, arg){
52 // summary: Joins a list with a string, like Python's ``str.join(list)``
53 // description:
54 // Django throws a compile error, but JS can't do arg checks
72 // summary: Returns a slice of the list.
73 // description:
74 // Uses the same syntax as Python's list slicing; see
75 // http://diveintopython.org/native_data_types/lists.html#odbchelper.list.slice
apacheconf.xml (https://jedit.svn.sourceforge.net/svnroot/jedit) XML · 1008 lines
55 <KEYWORD1>AuthDigestNcCheck</KEYWORD1>
56 <KEYWORD1>AuthDigestShmemSize</KEYWORD1>
57 <KEYWORD1>AuthLDAPCharsetConfig</KEYWORD1>
58 <KEYWORD1>BS2000Account</KEYWORD1>
59 <KEYWORD1>BrowserMatch</KEYWORD1>
296 <KEYWORD1>TimeOut</KEYWORD1>
297 <KEYWORD1>TransferLog</KEYWORD1>
298 <KEYWORD1>TypesConfig</KEYWORD1>
299 <KEYWORD1>UnsetEnv</KEYWORD1>
300 <KEYWORD1>UseCanonicalName</KEYWORD1>
392 <KEYWORD2>AuthLDAPBindDN</KEYWORD2>
393 <KEYWORD2>AuthLDAPBindPassword</KEYWORD2>
394 <KEYWORD2>AuthLDAPCharsetConfig</KEYWORD2>
395 <KEYWORD2>AuthLDAPCompareDNOnServer</KEYWORD2>
396 <KEYWORD2>AuthLDAPDereferenceAliases</KEYWORD2>
compile.el
(git://github.com/emacsmirror/emacs.git)
Emacs Lisp · 2829 lines
✨ Summary
This code starts a compilation process by creating a new buffer and setting its major mode to compilation-mode'. It also sets the default directory to the current directory, as specified in the
default-directory’ variable. The `compilation-environment’ variable is used to set environment variables for the compilation process.
The code then checks if there is already a running compilation process in the current buffer. If so, it prompts the user whether to kill the process or not. If the user chooses to kill the process, the code deletes it using the `delete-process’ function.
After checking for any existing processes, the code creates a new process and sets its query on exit flag to nil. This means that when the process exits, Emacs will prompt the user whether to kill it or not. The code then runs the compilation command in the new process using the `start-process’ function.
Finally, the code displays the output of the compilation process in a separate window using the `display-buffer’ function.
This code starts a compilation process by creating a new buffer and setting its major mode to compilation-mode'. It also sets the default directory to the current directory, as specified in the
default-directory’ variable. The `compilation-environment’ variable is used to set environment variables for the compilation process.
The code then checks if there is already a running compilation process in the current buffer. If so, it prompts the user whether to kill the process or not. If the user chooses to kill the process, the code deletes it using the `delete-process’ function.
After checking for any existing processes, the code creates a new process and sets its query on exit flag to nil. This means that when the process exits, Emacs will prompt the user whether to kill it or not. The code then runs the compilation command in the new process using the `start-process’ function.
Finally, the code displays the output of the compilation process in a separate window using the `display-buffer’ function.
159 \\([0-9]+\\)\\(?:[) \t]\\|:[^0-9\n]\\)" 2 3 nil (1))
161 (python-tracebacks-and-caml
162 "^[ \t]*File \\(\"?\\)\\([^,\" \n\t<>]+\\)\\1, lines? \\([0-9]+\\)-?\\([0-9]+\\)?\\(?:$\\|,\
163 \\(?: characters? \\([0-9]+\\)-?\\([0-9]+\\)?:\\)?\\([ \n]Warning\\(?: [0-9]+\\)?:\\)?\\)"
533 (defvar compilation-mode-font-lock-keywords
534 '(;; configure output lines.
535 ("^[Cc]hecking \\(?:[Ff]or \\|[Ii]f \\|[Ww]hether \\(?:to \\)?\\)?\\(.+\\)\\.\\.\\. *\\(?:(cached) *\\)?\\(\\(yes\\(?: .+\\)?\\)\\|no\\|\\(.*\\)\\)$"
536 (1 font-lock-variable-name-face)
decimal_23.py
(git://github.com/IronLanguages/main.git)
Python · 3047 lines
✨ Summary
This is a Python module that provides a class for working with decimal numbers, as well as some utility functions for converting between different representations of decimals. It includes a number of tests to ensure that the code works correctly and is well-documented.
This is a Python module that provides a class for working with decimal numbers, as well as some utility functions for converting between different representations of decimals. It includes a number of tests to ensure that the code works correctly and is well-documented.
1 # <win32com>
2 # This is a clone of Python 2.4's 'decimal' module. It will only be used when
3 # 'import decimal' fails - so is likely to be used in Python 2.3.
4 # </win32com>
5 # Copyright (c) 2004 Python Software Foundation.
6 # All rights reserved.
8 # Written by Eric Price <eprice at tjhsst.edu>
9 # and Facundo Batista <facundo at taniquetil.com.ar>
10 # and Raymond Hettinger <python at rcn.com>
11 # and Aahz <aahz at pobox.com>
12 # and Tim Peters
389 # current context. Py2.4 offers direct support for thread locals. If that
390 # is not available, use threading.currentThread() which is slower but will
391 # work for older Pythons. If threads are not part of the build, create a
392 # mock threading object with threading.local() returning the module namespace.
python-django-reversion.spec (git://github.com/repoforge/rpms.git) Unknown · 91 lines
5 %if ! (0%{?fedora} > 12 || 0%{?rhel} > 5)
6 %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
7 %endif
21 Source0: http://github.com/downloads/etianen/%{real_name}/%{real_name}-%{version}.tar.gz
22 Patch0: django-reversion-1.5-python2.4.patch
24 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
37 %setup -n %{real_name}-%{version}
39 %if 0%{?_with_python24}
40 %patch0 -p1
41 %{__rm} src/reversion/test*.py
66 %dir %{python_sitelib}/reversion
67 %{!?_with_python24:%{python_sitelib}/*.egg-info}
68 %{python_sitelib}/reversion/*.py*