index int64 0 50.7k | project_path stringclasses 279
values | completion_path stringlengths 57 199 | signature_postion stringlengths 3 11 | class_position stringlengths 3 11 | function_name stringlengths 1 62 | class_name stringlengths 0 55 | body_position stringlengths 3 11 | body_position_with_comments stringlengths 3 11 | masked_class stringlengths 14 8.32k | masked_class_with_comment stringlengths 14 8.32k | func_body stringlengths 9 6.72k | func_body_with_comment stringlengths 9 6.72k | len_func_body int64 1 643 | len_input int64 10 2.02k | len_output int64 4 1.9k | total int64 20 2.05k | file_code stringlengths 14 442k | file_code_with_comment stringlengths 14 442k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
42,371 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/wx/lib/popupctl.py | 169,170 | 152,251 | SetPopupAlignment | PopupControl | 170,174 | 170,174 | class PopupControl(wx.Control):
def __init__(self,*_args,**_kwargs):
wx.Control.__init__(self, *_args, **_kwargs)
self.textCtrl = wx.TextCtrl(self, wx.ID_ANY, '', pos = (0,0))
self.bCtrl = PopButton(self, wx.ID_ANY, style=wx.BORDER_NONE)
self.pop = None
self.content = None
... | class PopupControl(wx.Control):
def __init__(self,*_args,**_kwargs):
wx.Control.__init__(self, *_args, **_kwargs)
self.textCtrl = wx.TextCtrl(self, wx.ID_ANY, '', pos = (0,0))
self.bCtrl = PopButton(self, wx.ID_ANY, style=wx.BORDER_NONE)
self.pop = None
self.content = None
... | # Whether the pop dialog should align center, light or right
self.align = align
| # Whether the pop dialog should align center, light or right
self.align = align
| 14 | 853 | 27 | 880 | #----------------------------------------------------------------------
# Name: popup
# Purpose: Generic popup control
#
# Author: Gerrit van Dyk
#
# Created: 2002/11/20
# Version: 0.1
# License: wxWindows license
# Tags: phoenix-port
#------------------------------------------... | #----------------------------------------------------------------------
# Name: popup
# Purpose: Generic popup control
#
# Author: Gerrit van Dyk
#
# Created: 2002/11/20
# Version: 0.1
# License: wxWindows license
# Tags: phoenix-port
#------------------------------------------... |
42,372 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/wx/lib/popupctl.py | 121,122 | 104,152 | Display | PopupDialog | 122,152 | 122,152 | class PopupDialog(wx.Dialog):
def __init__(self,parent,content = None):
wx.Dialog.__init__(self,parent,-1,'', style = wx.BORDER_SIMPLE|wx.STAY_ON_TOP)
self.ctrl = parent
self.win = wx.Window(self,-1,pos = (0,0),style = 0)
if content:
self.SetContent(content)
def Se... | class PopupDialog(wx.Dialog):
def __init__(self,parent,content = None):
wx.Dialog.__init__(self,parent,-1,'', style = wx.BORDER_SIMPLE|wx.STAY_ON_TOP)
self.ctrl = parent
self.win = wx.Window(self,-1,pos = (0,0),style = 0)
if content:
self.SetContent(content)
def Se... | pos = self.ctrl.ClientToScreen( (0,0) )
dSize = wx.GetDisplaySize()
selfSize = self.GetSize()
tcSize = self.ctrl.GetSize()
if align == wx.ALIGN_CENTER:
pos.x -= (selfSize.width - tcSize.width) // 2
elif align == wx.ALIGN_RIGHT:
pos.x -= (selfSize.... | pos = self.ctrl.ClientToScreen( (0,0) )
dSize = wx.GetDisplaySize()
selfSize = self.GetSize()
tcSize = self.ctrl.GetSize()
if align == wx.ALIGN_CENTER:
pos.x -= (selfSize.width - tcSize.width) // 2
elif align == wx.ALIGN_RIGHT:
pos.x -= (selfSize.... | 77 | 209 | 294 | 503 | #----------------------------------------------------------------------
# Name: popup
# Purpose: Generic popup control
#
# Author: Gerrit van Dyk
#
# Created: 2002/11/20
# Version: 0.1
# License: wxWindows license
# Tags: phoenix-port
#------------------------------------------... | #----------------------------------------------------------------------
# Name: popup
# Purpose: Generic popup control
#
# Author: Gerrit van Dyk
#
# Created: 2002/11/20
# Version: 0.1
# License: wxWindows license
# Tags: phoenix-port
#------------------------------------------... |
42,373 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/wx/lib/progressindicator.py | 81,82 | 30,136 | Stop | ProgressIndicator | 85,103 | 82,103 | class ProgressIndicator(wx.Panel):
def __init__(self, *args, **kw):
wx.Panel.__init__(self, *args, **kw)
self.label = wx.StaticText(self)
self.gauge = wx.Gauge(self, range=100,
style=wx.GA_HORIZONTAL|wx.GA_SMOOTH)
self._startCount = 0
self.Size... | class ProgressIndicator(wx.Panel):
def __init__(self, *args, **kw):
wx.Panel.__init__(self, *args, **kw)
self.label = wx.StaticText(self)
self.gauge = wx.Gauge(self, range=100,
style=wx.GA_HORIZONTAL|wx.GA_SMOOTH)
self._startCount = 0
self.Size... | # Make sure Stop is called as many times as Start was. Only really
# stop when the count reaches zero.
if self._startCount == 0:
return # should be already stopped...
self._startCount -= 1
if self._startCount:
return # there's still more starts than stops... | """
Stop showing progress
"""
# Make sure Stop is called as many times as Start was. Only really
# stop when the count reaches zero.
if self._startCount == 0:
return # should be already stopped...
self._startCount -= 1
if self._startCount:
... | 53 | 777 | 162 | 939 | #----------------------------------------------------------------------
# Name: wx.lib.progressindicator
# Purpose:
#
# Author: Robin Dunn
#
# Created: 22-Oct-2009
# Copyright: (c) 2009-2020 by Total Control Software
# Licence: wxWindows license
#---------------------------------------------------... | #----------------------------------------------------------------------
# Name: wx.lib.progressindicator
# Purpose:
#
# Author: Robin Dunn
#
# Created: 22-Oct-2009
# Copyright: (c) 2009-2020 by Total Control Software
# Licence: wxWindows license
#---------------------------------------------------... |
42,374 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/wx/lib/pubsub/core/arg1/publishermixin.py | 32,33 | 18,35 | _mix_callListener | PublisherMixin | 34,35 | 33,35 | class PublisherMixin:
def __init__(self):
pass
def publish(self, data=None):
self._publish(data)
############## IMPLEMENTATION ###############
def _mix_prePublish(self, data, topicObj=None, iterState=None):
"""Called just before the __sendMessage, to perform any argument
... | class PublisherMixin:
def __init__(self):
pass
def publish(self, data=None):
self._publish(data)
############## IMPLEMENTATION ###############
def _mix_prePublish(self, data, topicObj=None, iterState=None):
"""Called just before the __sendMessage, to perform any argument
... | listener(self, data)
| """Send the data to given listener."""
listener(self, data)
| 2 | 148 | 9 | 157 | """
Mixin for publishing messages to a topic's listeners. This will be
mixed into topicobj.Topic so that a user can use a Topic object to
send a message to the topic's listeners via a publish() method.
Note that it is important that the PublisherMixin NOT modify any
state data during message sending, because in princi... | """
Mixin for publishing messages to a topic's listeners. This will be
mixed into topicobj.Topic so that a user can use a Topic object to
send a message to the topic's listeners via a publish() method.
Note that it is important that the PublisherMixin NOT modify any
state data during message sending, because in princi... |
42,375 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/wx/lib/pubsub/core/arg1/topicmgrimpl.py | 12,13 | 1,20 | getRootTopicSpec | 15,20 | 13,20 | """
The root topic of all topics is different based on messaging protocol.
:copyright: Copyright since 2006 by Oliver Schoenborn, all rights reserved.
:license: BSD, see LICENSE_BSD_Simple.txt for details.
"""
from .. import policies
def getRootTopicSpec():
FILL_FUNC_BODY | """
The root topic of all topics is different based on messaging protocol.
:copyright: Copyright since 2006 by Oliver Schoenborn, all rights reserved.
:license: BSD, see LICENSE_BSD_Simple.txt for details.
"""
from .. import policies
def getRootTopicSpec():
"""If using "arg1" messaging protocol, then root topi... | argName = policies.msgDataArgName or 'data'
argsDocs = {argName : 'data for message sent'}
reqdArgs = (argName,)
return argsDocs, reqdArgs
| """If using "arg1" messaging protocol, then root topic has one arg;
if policies.msgDataArgName is something, then use it as arg name."""
argName = policies.msgDataArgName or 'data'
argsDocs = {argName : 'data for message sent'}
reqdArgs = (argName,)
return argsDocs, reqdArgs
| 19 | 130 | 57 | 187 | """
The root topic of all topics is different based on messaging protocol.
:copyright: Copyright since 2006 by Oliver Schoenborn, all rights reserved.
:license: BSD, see LICENSE_BSD_Simple.txt for details.
"""
from .. import policies
def getRootTopicSpec():
FILL_FUNC_BODY | """
The root topic of all topics is different based on messaging protocol.
:copyright: Copyright since 2006 by Oliver Schoenborn, all rights reserved.
:license: BSD, see LICENSE_BSD_Simple.txt for details.
"""
from .. import policies
def getRootTopicSpec():
"""If using "arg1" messaging protocol, then root topi... | |
42,377 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/wx/lib/pubsub/core/callables.py | 174,175 | 101,185 | __setupAutoTopic | CallArgsInfo | 177,185 | 175,185 | class CallArgsInfo:
"""
Represent the "signature" or protocol of a listener in the context of
topics.
"""
def __init__(self, func, firstArgIdx): #args, firstArgIdx, defaultVals, acceptsAllKwargs=False):
"""Inputs:
- Args and defaultVals are the complete set of arguments and
... | class CallArgsInfo:
"""
Represent the "signature" or protocol of a listener in the context of
topics.
"""
def __init__(self, func, firstArgIdx): #args, firstArgIdx, defaultVals, acceptsAllKwargs=False):
"""Inputs:
- Args and defaultVals are the complete set of arguments and
... | for indx, defaultVal in enumerate(defaults):
if defaultVal == AUTO_TOPIC:
#del self.defaults[indx]
firstKwargIdx = self.numRequired
self.autoTopicArgName = self.allParams.pop(firstKwargIdx + indx)
break
| """Does the listener want topic of message? Returns < 0 if not,
otherwise return index of topic kwarg within args."""
for indx, defaultVal in enumerate(defaults):
if defaultVal == AUTO_TOPIC:
#del self.defaults[indx]
firstKwargIdx = self.numRequired
... | 20 | 887 | 91 | 978 | """
Low level functions and classes related to callables.
The AUTO_TOPIC
is the "marker" to use in callables to indicate that when a message
is sent to those callables, the topic object for that message should be
added to the data sent via the call arguments. See the docs in
CallArgsInfo regarding its autoTopicArgName... | """
Low level functions and classes related to callables.
The AUTO_TOPIC
is the "marker" to use in callables to indicate that when a message
is sent to those callables, the topic object for that message should be
added to the data sent via the call arguments. See the docs in
CallArgsInfo regarding its autoTopicArgName... |
42,378 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/wx/lib/pubsub/core/imp2.py | 46,47 | 1,64 | load_module | 49,64 | 47,64 | """
The _resolve_name and _import_module were taken from the backport of
importlib.import_module from 3.x to 2.7. Thanks to the Python developers
for making this available as a standalone module. This makes it possible
to have an import module that mimics the "import" statement more
closely.
"""
import sys
from .. im... | """
The _resolve_name and _import_module were taken from the backport of
importlib.import_module from 3.x to 2.7. Thanks to the Python developers
for making this available as a standalone module. This makes it possible
to have an import module that mimics the "import" statement more
closely.
"""
import sys
from .. im... | try:
module = _import_module(moduleName)
except:
import imp
fp, pathname, description = imp.find_module(moduleName, searchPath)
try:
module = imp.load_module(moduleName, fp, pathname, description)
finally:
# Since we may exi... | """Try to import moduleName. If this doesn't work, use the "imp" module
that is part of Python. """
try:
module = _import_module(moduleName)
except:
import imp
fp, pathname, description = imp.find_module(moduleName, searchPath)
try:
module = imp.loa... | 37 | 459 | 131 | 590 | """
The _resolve_name and _import_module were taken from the backport of
importlib.import_module from 3.x to 2.7. Thanks to the Python developers
for making this available as a standalone module. This makes it possible
to have an import module that mimics the "import" statement more
closely.
"""
import sys
from .. im... | """
The _resolve_name and _import_module were taken from the backport of
importlib.import_module from 3.x to 2.7. Thanks to the Python developers
for making this available as a standalone module. This makes it possible
to have an import module that mimics the "import" statement more
closely.
"""
import sys
from .. im... | |
42,379 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/wx/lib/pubsub/core/kwargs/publishermixin.py | 37,38 | 28,44 | filterMsgArgs | IterState | 38,44 | 38,44 | class IterState:
def __init__(self, msgKwargs):
self.filteredArgs = msgKwargs
self.argsChecked = False
def checkMsgArgs(self, spec):
spec.check(self.filteredArgs)
self.argsChecked = True
def filterMsgArgs(self, topicObj):
FILL_FUNC_BODY | class IterState:
def __init__(self, msgKwargs):
self.filteredArgs = msgKwargs
self.argsChecked = False
def checkMsgArgs(self, spec):
spec.check(self.filteredArgs)
self.argsChecked = True
def filterMsgArgs(self, topicObj):
FILL_FUNC_BODY | if self.argsChecked:
self.filteredArgs = topicObj.filterMsgArgs(self.filteredArgs)
else:
self.filteredArgs = topicObj.filterMsgArgs(self.filteredArgs, True)
self.argsChecked = True
| if self.argsChecked:
self.filteredArgs = topicObj.filterMsgArgs(self.filteredArgs)
else:
self.filteredArgs = topicObj.filterMsgArgs(self.filteredArgs, True)
self.argsChecked = True
| 13 | 96 | 73 | 169 | """
:copyright: Copyright since 2006 by Oliver Schoenborn, all rights reserved.
:license: BSD, see LICENSE_BSD_Simple.txt for details.
"""
class PublisherMixin:
"""
Mixin for publishing messages to a topic's listeners. This will be
mixed into topicobj.Topic so that a user can use a Topic object to
sen... | """
:copyright: Copyright since 2006 by Oliver Schoenborn, all rights reserved.
:license: BSD, see LICENSE_BSD_Simple.txt for details.
"""
class PublisherMixin:
"""
Mixin for publishing messages to a topic's listeners. This will be
mixed into topicobj.Topic so that a user can use a Topic object to
sen... |
42,380 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/wx/lib/pubsub/core/kwargs/publishermixin.py | 44,45 | 7,66 | _mix_prePublish | PublisherMixin | 45,59 | 45,59 | class PublisherMixin:
"""
Mixin for publishing messages to a topic's listeners. This will be
mixed into topicobj.Topic so that a user can use a Topic object to
send a message to the topic's listeners via a publish() method.
Note that it is important that the PublisherMixin NOT modify any
state ... | class PublisherMixin:
"""
Mixin for publishing messages to a topic's listeners. This will be
mixed into topicobj.Topic so that a user can use a Topic object to
send a message to the topic's listeners via a publish() method.
Note that it is important that the PublisherMixin NOT modify any
state ... | if iterState is None:
# do a first check that all args are there, costly so only do once
iterState = self.IterState(msgKwargs)
if self.hasMDS():
iterState.checkMsgArgs( self._getListenerSpec() )
else:
assert not self.hasListeners()
... | if iterState is None:
# do a first check that all args are there, costly so only do once
iterState = self.IterState(msgKwargs)
if self.hasMDS():
iterState.checkMsgArgs( self._getListenerSpec() )
else:
assert not self.hasListeners()
... | 40 | 478 | 126 | 604 | """
:copyright: Copyright since 2006 by Oliver Schoenborn, all rights reserved.
:license: BSD, see LICENSE_BSD_Simple.txt for details.
"""
class PublisherMixin:
"""
Mixin for publishing messages to a topic's listeners. This will be
mixed into topicobj.Topic so that a user can use a Topic object to
sen... | """
:copyright: Copyright since 2006 by Oliver Schoenborn, all rights reserved.
:license: BSD, see LICENSE_BSD_Simple.txt for details.
"""
class PublisherMixin:
"""
Mixin for publishing messages to a topic's listeners. This will be
mixed into topicobj.Topic so that a user can use a Topic object to
sen... |
42,381 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/wx/lib/pubsub/core/kwargs/topicmgrimpl.py | 8,9 | 1,14 | getRootTopicSpec | 10,14 | 9,14 | """
:copyright: Copyright since 2006 by Oliver Schoenborn, all rights reserved.
:license: BSD, see LICENSE_BSD_Simple.txt for details.
"""
def getRootTopicSpec():
FILL_FUNC_BODY | """
:copyright: Copyright since 2006 by Oliver Schoenborn, all rights reserved.
:license: BSD, see LICENSE_BSD_Simple.txt for details.
"""
def getRootTopicSpec():
"""If using kwargs protocol, then root topic takes no args."""
FILL_FUNC_BODY | argsDocs = {}
reqdArgs = ()
return argsDocs, reqdArgs
| """If using kwargs protocol, then root topic takes no args."""
argsDocs = {}
reqdArgs = ()
return argsDocs, reqdArgs
| 9 | 86 | 29 | 115 | """
:copyright: Copyright since 2006 by Oliver Schoenborn, all rights reserved.
:license: BSD, see LICENSE_BSD_Simple.txt for details.
"""
def getRootTopicSpec():
FILL_FUNC_BODY | """
:copyright: Copyright since 2006 by Oliver Schoenborn, all rights reserved.
:license: BSD, see LICENSE_BSD_Simple.txt for details.
"""
def getRootTopicSpec():
"""If using kwargs protocol, then root topic takes no args."""
FILL_FUNC_BODY | |
42,382 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/wx/lib/pubsub/core/notificationmgr.py | 149,150 | 134,186 | notifyUnsubscribe | INotificationHandler | 153,155 | 150,155 | class INotificationHandler:
"""
Defines the interface expected by pubsub for pubsub activity
notifications. Any instance that supports the same methods, or
derives from this class, will work as a notification handler
for pubsub events (see pub.addNotificationHandler).
"""
def notifySu... | class INotificationHandler:
"""
Defines the interface expected by pubsub for pubsub activity
notifications. Any instance that supports the same methods, or
derives from this class, will work as a notification handler
for pubsub events (see pub.addNotificationHandler).
"""
def notifySu... | raise NotImplementedError
| """Called when a listener is unsubscribed from given topic.
:param pubListener: the pubsub.core.Listener that wraps unsubscribed listener.
:param topicObj: the pubsub.core.Topic object unsubscribed from."""
raise NotImplementedError
| 2 | 651 | 12 | 663 | """
:copyright: Copyright since 2006 by Oliver Schoenborn, all rights reserved.
:license: BSD, see LICENSE_BSD_Simple.txt for details.
"""
import sys
class NotificationMgr:
"""
Manages notifications for tracing pubsub activity. When pubsub takes a
certain action such as sending a message or creating a top... | """
:copyright: Copyright since 2006 by Oliver Schoenborn, all rights reserved.
:license: BSD, see LICENSE_BSD_Simple.txt for details.
"""
import sys
class NotificationMgr:
"""
Manages notifications for tracing pubsub activity. When pubsub takes a
certain action such as sending a message or creating a top... |
42,383 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/wx/lib/pubsub/core/notificationmgr.py | 127,128 | 7,134 | __registerForAppExit | NotificationMgr | 128,134 | 128,134 | class NotificationMgr:
"""
Manages notifications for tracing pubsub activity. When pubsub takes a
certain action such as sending a message or creating a topic, and
the notification flag for that activity is True, all registered
notification handlers get corresponding method called with information... | class NotificationMgr:
"""
Manages notifications for tracing pubsub activity. When pubsub takes a
certain action such as sending a message or creating a topic, and
the notification flag for that activity is True, all registered
notification handlers get corresponding method called with information... | import atexit
atexit.register(self.clearHandlers)
self.__atExitRegistered = True
| import atexit
atexit.register(self.clearHandlers)
self.__atExitRegistered = True
| 6 | 1,237 | 37 | 1,274 | """
:copyright: Copyright since 2006 by Oliver Schoenborn, all rights reserved.
:license: BSD, see LICENSE_BSD_Simple.txt for details.
"""
import sys
class NotificationMgr:
"""
Manages notifications for tracing pubsub activity. When pubsub takes a
certain action such as sending a message or creating a top... | """
:copyright: Copyright since 2006 by Oliver Schoenborn, all rights reserved.
:license: BSD, see LICENSE_BSD_Simple.txt for details.
"""
import sys
class NotificationMgr:
"""
Manages notifications for tracing pubsub activity. When pubsub takes a
certain action such as sending a message or creating a top... |
42,385 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/wx/lib/pubsub/core/topictreetraverser.py | 113,114 | 106,144 | _accept | ITopicTreeVisitor | 118,120 | 114,120 | class ITopicTreeVisitor:
"""
Derive from ITopicTreeVisitor and override one or more of the
self._*() methods. Give an instance to an instance of
TopicTreeTraverser.
"""
def _accept(self, topicObj):
FILL_FUNC_BODY def _startTraversal(self):
"""Override this to define what to do when ... | class ITopicTreeVisitor:
"""
Derive from ITopicTreeVisitor and override one or more of the
self._*() methods. Give an instance to an instance of
TopicTreeTraverser.
"""
def _accept(self, topicObj):
"""Override this to filter nodes of topic tree. Must return
True (accept node) o... | return True
| """Override this to filter nodes of topic tree. Must return
True (accept node) of False (reject node). Note that rejected
nodes cause traversal to move to next branch (no children
traversed)."""
return True
| 2 | 319 | 7 | 326 | """
:copyright: Copyright since 2006 by Oliver Schoenborn, all rights reserved.
:license: BSD, see LICENSE_BSD_Simple.txt for details.
"""
class TopicTreeTraverser:
"""
Supports taking action on every topic in the topic tree. The traverse() method
traverses a topic tree and calls visitor._onTopic() for ... | """
:copyright: Copyright since 2006 by Oliver Schoenborn, all rights reserved.
:license: BSD, see LICENSE_BSD_Simple.txt for details.
"""
class TopicTreeTraverser:
"""
Supports taking action on every topic in the topic tree. The traverse() method
traverses a topic tree and calls visitor._onTopic() for ... |
42,386 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/wx/lib/pubsub/core/topictreetraverser.py | 80,81 | 8,106 | extendStack | TopicTreeTraverser | 81,89 | 81,89 | class TopicTreeTraverser:
"""
Supports taking action on every topic in the topic tree. The traverse() method
traverses a topic tree and calls visitor._onTopic() for each topic in the tree
that satisfies visitor._accept(). Additionally it calls visitor._startChildren()
whenever it starts traversin... | class TopicTreeTraverser:
"""
Supports taking action on every topic in the topic tree. The traverse() method
traverses a topic tree and calls visitor._onTopic() for each topic in the tree
that satisfies visitor._accept(). Additionally it calls visitor._startChildren()
whenever it starts traversin... | topicTreeStack.insert(0, visitor._endChildren) # marker functor
# put subtopics in list in alphabetical order
subtopicsTmp = subtopics
subtopicsTmp.sort(reverse=True, key=topicObj.__class__.getName)
for sub in subtopicsTmp:
topicTreeStack.inser... | topicTreeStack.insert(0, visitor._endChildren) # marker functor
# put subtopics in list in alphabetical order
subtopicsTmp = subtopics
subtopicsTmp.sort(reverse=True, key=topicObj.__class__.getName)
for sub in subtopicsTmp:
topicTreeStack.inser... | 36 | 889 | 125 | 1,014 | """
:copyright: Copyright since 2006 by Oliver Schoenborn, all rights reserved.
:license: BSD, see LICENSE_BSD_Simple.txt for details.
"""
class TopicTreeTraverser:
"""
Supports taking action on every topic in the topic tree. The traverse() method
traverses a topic tree and calls visitor._onTopic() for ... | """
:copyright: Copyright since 2006 by Oliver Schoenborn, all rights reserved.
:license: BSD, see LICENSE_BSD_Simple.txt for details.
"""
class TopicTreeTraverser:
"""
Supports taking action on every topic in the topic tree. The traverse() method
traverses a topic tree and calls visitor._onTopic() for ... |
42,387 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/wx/lib/pubsub/core/topicutils.py | 50,51 | 1,119 | validateName | 52,77 | 51,77 | """
Various utilities used by topic-related modules.
:copyright: Copyright since 2006 by Oliver Schoenborn, all rights reserved.
:license: BSD, see LICENSE_BSD_Simple.txt for details.
"""
from textwrap import TextWrapper, dedent
from .topicexc import TopicNameError
from .. import py2and3
__all__ = []
UNDERSCOR... | """
Various utilities used by topic-related modules.
:copyright: Copyright since 2006 by Oliver Schoenborn, all rights reserved.
:license: BSD, see LICENSE_BSD_Simple.txt for details.
"""
from textwrap import TextWrapper, dedent
from .topicexc import TopicNameError
from .. import py2and3
__all__ = []
UNDERSCOR... | topicNameTuple = tupleize(topicName)
if not topicNameTuple:
reason = 'name tuple must have at least one item!'
raise TopicNameError(None, reason)
class topic: pass
for subname in topicNameTuple:
if not subname:
reason = 'can\'t contain empty string or None'
... | """Raise TopicNameError if nameTuple not valid as topic name."""
topicNameTuple = tupleize(topicName)
if not topicNameTuple:
reason = 'name tuple must have at least one item!'
raise TopicNameError(None, reason)
class topic: pass
for subname in topicNameTuple:
if not subname:... | 91 | 892 | 298 | 1,190 | """
Various utilities used by topic-related modules.
:copyright: Copyright since 2006 by Oliver Schoenborn, all rights reserved.
:license: BSD, see LICENSE_BSD_Simple.txt for details.
"""
from textwrap import TextWrapper, dedent
from .topicexc import TopicNameError
from .. import py2and3
__all__ = []
UNDERSCOR... | """
Various utilities used by topic-related modules.
:copyright: Copyright since 2006 by Oliver Schoenborn, all rights reserved.
:license: BSD, see LICENSE_BSD_Simple.txt for details.
"""
from textwrap import TextWrapper, dedent
from .topicexc import TopicNameError
from .. import py2and3
__all__ = []
UNDERSCOR... | |
42,388 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/wx/lib/pubsub/core/validatedefnargs.py | 20,21 | 1,30 | verifySubset | 23,30 | 21,30 | """
Some topic definition validation functions.
:copyright: Copyright since 2006 by Oliver Schoenborn, all rights reserved.
:license: BSD, see LICENSE_BSD_Simple.txt for details.
"""
from .topicexc import MessageDataSpecError
def verifyArgsDifferent(allArgs, allParentArgs, topicName):
"""Verify that allArgs do... | """
Some topic definition validation functions.
:copyright: Copyright since 2006 by Oliver Schoenborn, all rights reserved.
:license: BSD, see LICENSE_BSD_Simple.txt for details.
"""
from .topicexc import MessageDataSpecError
def verifyArgsDifferent(allArgs, allParentArgs, topicName):
"""Verify that allArgs do... | notInAll = set(sub).difference(all)
if notInAll:
args = ','.join(all)
msg = 'Params [%s] missing inherited [%%s] for topic "%s"%s' % (args, topicName, extraMsg)
raise MessageDataSpecError(msg, tuple(notInAll) )
| """Verify that sub is a subset of all for topicName. Raise
MessageDataSpecError if fail. """
notInAll = set(sub).difference(all)
if notInAll:
args = ','.join(all)
msg = 'Params [%s] missing inherited [%%s] for topic "%s"%s' % (args, topicName, extraMsg)
raise MessageDataSpecError... | 26 | 229 | 93 | 322 | """
Some topic definition validation functions.
:copyright: Copyright since 2006 by Oliver Schoenborn, all rights reserved.
:license: BSD, see LICENSE_BSD_Simple.txt for details.
"""
from .topicexc import MessageDataSpecError
def verifyArgsDifferent(allArgs, allParentArgs, topicName):
"""Verify that allArgs do... | """
Some topic definition validation functions.
:copyright: Copyright since 2006 by Oliver Schoenborn, all rights reserved.
:license: BSD, see LICENSE_BSD_Simple.txt for details.
"""
from .topicexc import MessageDataSpecError
def verifyArgsDifferent(allArgs, allParentArgs, topicName):
"""Verify that allArgs do... | |
42,389 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/wx/lib/pubsub/core/weakmethod.py | 91,92 | 1,103 | getWeakRef | 96,103 | 92,103 | """
This module provides a basic "weak method" implementation, WeakMethod. It uses
weakref.WeakRef which, used on its own, produces weak methods that are dead on
creation, not very useful. Use the getWeakRef(object) module function to create the
proper type of weak reference (weakref.WeakRef or WeakMethod) for given ob... | """
This module provides a basic "weak method" implementation, WeakMethod. It uses
weakref.WeakRef which, used on its own, produces weak methods that are dead on
creation, not very useful. Use the getWeakRef(object) module function to create the
proper type of weak reference (weakref.WeakRef or WeakMethod) for given ob... | if ismethod(obj):
createRef = WeakMethod
else:
createRef = WeakRef
return createRef(obj, notifyDead)
| """Get a weak reference to obj. If obj is a bound method, a WeakMethod
object, that behaves like a WeakRef, is returned; if it is
anything else a WeakRef is returned. If obj is an unbound method,
a ValueError will be raised."""
if ismethod(obj):
createRef = WeakMethod
else:
creat... | 12 | 997 | 49 | 1,046 | """
This module provides a basic "weak method" implementation, WeakMethod. It uses
weakref.WeakRef which, used on its own, produces weak methods that are dead on
creation, not very useful. Use the getWeakRef(object) module function to create the
proper type of weak reference (weakref.WeakRef or WeakMethod) for given ob... | """
This module provides a basic "weak method" implementation, WeakMethod. It uses
weakref.WeakRef which, used on its own, produces weak methods that are dead on
creation, not very useful. Use the getWeakRef(object) module function to create the
proper type of weak reference (weakref.WeakRef or WeakMethod) for given ob... | |
42,390 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/wx/lib/pubsub/core/weakmethod.py | 40,41 | 19,91 | __onNotifyDeadObj | WeakMethod | 41,48 | 41,48 | class WeakMethod:
"""Represent a weak bound method, i.e. a method which doesn't keep alive the
object that it is bound to. """
def __init__(self, method, notifyDead = None):
"""The method must be bound. notifyDead will be called when
object that method is bound to dies. """
assert i... | class WeakMethod:
"""Represent a weak bound method, i.e. a method which doesn't keep alive the
object that it is bound to. """
def __init__(self, method, notifyDead = None):
"""The method must be bound. notifyDead will be called when
object that method is bound to dies. """
assert i... | if self.notifyDead:
try:
self.notifyDead(self)
except Exception:
import traceback
traceback.print_exc()
| if self.notifyDead:
try:
self.notifyDead(self)
except Exception:
import traceback
traceback.print_exc()
| 9 | 696 | 50 | 746 | """
This module provides a basic "weak method" implementation, WeakMethod. It uses
weakref.WeakRef which, used on its own, produces weak methods that are dead on
creation, not very useful. Use the getWeakRef(object) module function to create the
proper type of weak reference (weakref.WeakRef or WeakMethod) for given ob... | """
This module provides a basic "weak method" implementation, WeakMethod. It uses
weakref.WeakRef which, used on its own, produces weak methods that are dead on
creation, not very useful. Use the getWeakRef(object) module function to create the
proper type of weak reference (weakref.WeakRef or WeakMethod) for given ob... |
42,391 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/wx/lib/pubsub/policies.py | 15,16 | 1,25 | setMsgDataArgName | 16,25 | 16,25 | """
Aggregates policies for pubsub. Mainly, related to messaging protocol.
:copyright: Copyright since 2006 by Oliver Schoenborn, all rights reserved.
:license: BSD, see LICENSE_BSD_Simple.txt for details.
"""
msgProtocolTransStage = None
msgDataProtocol = 'kwargs'
msgDataArgName = None
senderKwargNameAny = ... | """
Aggregates policies for pubsub. Mainly, related to messaging protocol.
:copyright: Copyright since 2006 by Oliver Schoenborn, all rights reserved.
:license: BSD, see LICENSE_BSD_Simple.txt for details.
"""
msgProtocolTransStage = None
msgDataProtocol = 'kwargs'
msgDataArgName = None
senderKwargNameAny = ... | global senderKwargNameAny
global msgDataArgName
global msgProtocolTransStage
senderKwargNameAny = senderArgNameAny
msgDataArgName = listenerArgName
msgProtocolTransStage = stage
#print `policies.msgProtocolTransStage`, `policies.msgDataProtocol`, \
# `policies.senderKwargNameAny`, `... | global senderKwargNameAny
global msgDataArgName
global msgProtocolTransStage
senderKwargNameAny = senderArgNameAny
msgDataArgName = listenerArgName
msgProtocolTransStage = stage
#print `policies.msgProtocolTransStage`, `policies.msgDataProtocol`, \
# `policies.senderKwargNameAny`, `... | 29 | 136 | 138 | 274 | """
Aggregates policies for pubsub. Mainly, related to messaging protocol.
:copyright: Copyright since 2006 by Oliver Schoenborn, all rights reserved.
:license: BSD, see LICENSE_BSD_Simple.txt for details.
"""
msgProtocolTransStage = None
msgDataProtocol = 'kwargs'
msgDataArgName = None
senderKwargNameAny = ... | """
Aggregates policies for pubsub. Mainly, related to messaging protocol.
:copyright: Copyright since 2006 by Oliver Schoenborn, all rights reserved.
:license: BSD, see LICENSE_BSD_Simple.txt for details.
"""
msgProtocolTransStage = None
msgDataProtocol = 'kwargs'
msgDataArgName = None
senderKwargNameAny = ... | |
42,392 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/wx/lib/pubsub/setuparg1.py | 42,43 | 1,48 | enforceArgName | 47,48 | 43,48 | """
Setup pubsub for the *arg1* message protocol. In a default pubsub installation
the default protocol is *kargs*.
This module must be imported before the first ``from pubsub import pub``
statement in the application. Once :mod:pub has been imported, the messaging
protocol must not be changed (i.e., importing it afte... | """
Setup pubsub for the *arg1* message protocol. In a default pubsub installation
the default protocol is *kargs*.
This module must be imported before the first ``from pubsub import pub``
statement in the application. Once :mod:pub has been imported, the messaging
protocol must not be changed (i.e., importing it afte... | policies.setMsgDataArgName(1, commonName)
| """This will configure pubsub to require that all listeners use
the same argument name (*commonName*) as first parameter. This
is a useful first step in migrating an application that has been
using *arg1* protocol to the more powerful *kwargs* protocol. """
policies.setMsgDataArgName(1, commonName)
| 2 | 425 | 16 | 441 | """
Setup pubsub for the *arg1* message protocol. In a default pubsub installation
the default protocol is *kargs*.
This module must be imported before the first ``from pubsub import pub``
statement in the application. Once :mod:pub has been imported, the messaging
protocol must not be changed (i.e., importing it afte... | """
Setup pubsub for the *arg1* message protocol. In a default pubsub installation
the default protocol is *kargs*.
This module must be imported before the first ``from pubsub import pub``
statement in the application. Once :mod:pub has been imported, the messaging
protocol must not be changed (i.e., importing it afte... | |
42,393 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/wx/lib/pubsub/setupkwargs.py | 23,24 | 1,30 | transitionFromArg1 | 29,30 | 24,30 | """
Setup pubsub for the kwargs message protocol. In a default installation
this is the default protocol so this module is only needed if setupkargs
utility functions are used, or in a custom installation where kwargs
is not the default messaging protocol (such as in some versions of
wxPython).
This module must be ... | """
Setup pubsub for the kwargs message protocol. In a default installation
this is the default protocol so this module is only needed if setupkargs
utility functions are used, or in a custom installation where kwargs
is not the default messaging protocol (such as in some versions of
wxPython).
This module must be ... | policies.setMsgDataArgName(2, commonName)
| """Utility function to assist migrating an application from using
the arg1 messaging protocol to using the kwargs protocol. Call this
after having run and debugged your application with ``setuparg1.enforceArgName(commonName)``. See the migration docs
for more details.
"""
policies.setMsgDataA... | 2 | 306 | 16 | 322 | """
Setup pubsub for the kwargs message protocol. In a default installation
this is the default protocol so this module is only needed if setupkargs
utility functions are used, or in a custom installation where kwargs
is not the default messaging protocol (such as in some versions of
wxPython).
This module must be ... | """
Setup pubsub for the kwargs message protocol. In a default installation
this is the default protocol so this module is only needed if setupkargs
utility functions are used, or in a custom installation where kwargs
is not the default messaging protocol (such as in some versions of
wxPython).
This module must be ... | |
42,394 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/wx/lib/pubsub/utils/exchandling.py | 84,85 | 68,101 | init | ExcPublisher | 87,94 | 85,94 | class ExcPublisher(IListenerExcHandler):
"""
Example exception handler that simply publishes the exception traceback
as a message of topic name given by topicUncaughtExc.
"""
# name of the topic
topicUncaughtExc = 'uncaughtExcInListener'
def __init__(self, topicMgr=None):
"""If top... | class ExcPublisher(IListenerExcHandler):
"""
Example exception handler that simply publishes the exception traceback
as a message of topic name given by topicUncaughtExc.
"""
# name of the topic
topicUncaughtExc = 'uncaughtExcInListener'
def __init__(self, topicMgr=None):
"""If top... | obj = topicMgr.getOrCreateTopic(self.topicUncaughtExc)
obj.setDescription('generated when a listener raises an exception')
obj.setMsgArgSpec( dict(
listenerStr = 'string representation of listener',
excTraceback = 'instance of TracebackInfo containing exception info'))
... | """Must be called only after pubsub has been imported since this
handler creates a pubsub topic."""
obj = topicMgr.getOrCreateTopic(self.topicUncaughtExc)
obj.setDescription('generated when a listener raises an exception')
obj.setMsgArgSpec( dict(
listenerStr = 'stri... | 29 | 277 | 92 | 369 | """
Some utility classes for exception handling of exceptions raised
within listeners:
- TracebackInfo: convenient way of getting stack trace of latest
exception raised. The handler can create the instance to retrieve
the stack trace and then log it, present it to user, etc.
- ExcPublisher: example handler that pu... | """
Some utility classes for exception handling of exceptions raised
within listeners:
- TracebackInfo: convenient way of getting stack trace of latest
exception raised. The handler can create the instance to retrieve
the stack trace and then log it, present it to user, etc.
- ExcPublisher: example handler that pu... |
42,395 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/wx/lib/pubsub/utils/exchandling.py | 52,53 | 22,68 | getFormattedList | TracebackInfo | 55,59 | 53,59 | class TracebackInfo:
"""
Represent the traceback information for when an exception is
raised -- but not caught -- in a listener. The complete
traceback cannot be stored since this leads to circular
references (see docs for sys.exc_info()) which keeps
listeners alive even after the application is... | class TracebackInfo:
"""
Represent the traceback information for when an exception is
raised -- but not caught -- in a listener. The complete
traceback cannot be stored since this leads to circular
references (see docs for sys.exc_info()) which keeps
listeners alive even after the application is... | tmp = traceback.format_list(self.traceback)
tmp.extend( traceback.format_exception_only(self.ExcClass, self.excArg) )
return tmp
| """Get a list of strings as returned by the traceback module's
format_list() and format_exception_only() functions."""
tmp = traceback.format_list(self.traceback)
tmp.extend( traceback.format_exception_only(self.ExcClass, self.excArg) )
return tmp
| 9 | 457 | 51 | 508 | """
Some utility classes for exception handling of exceptions raised
within listeners:
- TracebackInfo: convenient way of getting stack trace of latest
exception raised. The handler can create the instance to retrieve
the stack trace and then log it, present it to user, etc.
- ExcPublisher: example handler that pu... | """
Some utility classes for exception handling of exceptions raised
within listeners:
- TracebackInfo: convenient way of getting stack trace of latest
exception raised. The handler can create the instance to retrieve
the stack trace and then log it, present it to user, etc.
- ExcPublisher: example handler that pu... |
42,396 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/wx/lib/pubsub/utils/misc.py | 15,16 | 1,101 | printImported | 17,22 | 16,22 | """
Provides useful functions and classes. Most useful are probably
printTreeDocs and printTreeSpec.
:copyright: Copyright since 2006 by Oliver Schoenborn, all rights reserved.
:license: BSD, see LICENSE_BSD_Simple.txt for details.
"""
import sys
from .. import py2and3
__all__ = ('printImported', 'StructMsg', 'Callb... | """
Provides useful functions and classes. Most useful are probably
printTreeDocs and printTreeSpec.
:copyright: Copyright since 2006 by Oliver Schoenborn, all rights reserved.
:license: BSD, see LICENSE_BSD_Simple.txt for details.
"""
import sys
from .. import py2and3
__all__ = ('printImported', 'StructMsg', 'Callb... | ll = sorted([mod for mod in sys.modules if mod.find('pubsub') >= 0])
py2and3.print_('\n'.join(ll))
| """Output a list of pubsub modules imported so far"""
ll = sorted([mod for mod in sys.modules if mod.find('pubsub') >= 0])
py2and3.print_('\n'.join(ll))
| 12 | 864 | 49 | 913 | """
Provides useful functions and classes. Most useful are probably
printTreeDocs and printTreeSpec.
:copyright: Copyright since 2006 by Oliver Schoenborn, all rights reserved.
:license: BSD, see LICENSE_BSD_Simple.txt for details.
"""
import sys
from .. import py2and3
__all__ = ('printImported', 'StructMsg', 'Callb... | """
Provides useful functions and classes. Most useful are probably
printTreeDocs and printTreeSpec.
:copyright: Copyright since 2006 by Oliver Schoenborn, all rights reserved.
:license: BSD, see LICENSE_BSD_Simple.txt for details.
"""
import sys
from .. import py2and3
__all__ = ('printImported', 'StructMsg', 'Callb... | |
42,398 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/wx/lib/pubsub/utils/notification.py | 179,180 | 109,225 | notifyDeadListener | NotifyByPubsubMessage | 180,187 | 180,187 | class NotifyByPubsubMessage(INotificationHandler):
"""
Handle pubsub notification messages by generating
messages of a 'pubsub.' subtopic. Also provides
an example of how to create a notification handler.
Use it by calling::
import pubsub.utils
pubsub.utils.useNotifyByPub... | class NotifyByPubsubMessage(INotificationHandler):
"""
Handle pubsub notification messages by generating
messages of a 'pubsub.' subtopic. Also provides
an example of how to create a notification handler.
Use it by calling::
import pubsub.utils
pubsub.utils.useNotifyByPub... | if (self._pubTopic is None) or self.__sending:
return
pubTopic = self._pubTopic.getSubtopic('deadListener')
kwargs = dict(topic=topicObj, listener=pubListener)
self.__doNotification(pubTopic, kwargs)
| if (self._pubTopic is None) or self.__sending:
return
pubTopic = self._pubTopic.getSubtopic('deadListener')
kwargs = dict(topic=topicObj, listener=pubListener)
self.__doNotification(pubTopic, kwargs)
| 16 | 1,200 | 82 | 1,282 | """
Provide an interface class for handling pubsub notification messages,
and an example class (though very useful in practice) showing how to
use it.
Notification messages are generated by pubsub
- if a handler has been configured via pub.addNotificationHandler()
- when pubsub does certain tasks, such as when a l... | """
Provide an interface class for handling pubsub notification messages,
and an example class (though very useful in practice) showing how to
use it.
Notification messages are generated by pubsub
- if a handler has been configured via pub.addNotificationHandler()
- when pubsub does certain tasks, such as when a l... |
42,399 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/wx/lib/pubsub/utils/notification.py | 84,85 | 49,109 | notifyDeadListener | NotifyByWriteFile | 85,91 | 85,91 | class NotifyByWriteFile(INotificationHandler):
"""
Print a message to stdout when a notification is received.
"""
defaultPrefix = 'PUBSUB:'
def __init__(self, fileObj = None, prefix = None):
"""Will write to stdout unless fileObj given. Will use
defaultPrefix as prefix for eac... | class NotifyByWriteFile(INotificationHandler):
"""
Print a message to stdout when a notification is received.
"""
defaultPrefix = 'PUBSUB:'
def __init__(self, fileObj = None, prefix = None):
"""Will write to stdout unless fileObj given. Will use
defaultPrefix as prefix for eac... | msg = '%s Listener "%s" of Topic "%s" has died\n' \
% (self.__pre, pubListener, topicObj.getName())
# a bug apparently: sometimes on exit, the stream gets closed before
# and leads to a TypeError involving NoneType
self.__fileObj.write(msg)
| msg = '%s Listener "%s" of Topic "%s" has died\n' \
% (self.__pre, pubListener, topicObj.getName())
# a bug apparently: sometimes on exit, the stream gets closed before
# and leads to a TypeError involving NoneType
self.__fileObj.write(msg)
| 36 | 616 | 85 | 701 | """
Provide an interface class for handling pubsub notification messages,
and an example class (though very useful in practice) showing how to
use it.
Notification messages are generated by pubsub
- if a handler has been configured via pub.addNotificationHandler()
- when pubsub does certain tasks, such as when a l... | """
Provide an interface class for handling pubsub notification messages,
and an example class (though very useful in practice) showing how to
use it.
Notification messages are generated by pubsub
- if a handler has been configured via pub.addNotificationHandler()
- when pubsub does certain tasks, such as when a l... |
42,401 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/wx/lib/pubsub/utils/topictreeprinter.py | 130,131 | 13,163 | __printTopicArgsAll | TopicTreePrinter | 131,150 | 131,150 | class TopicTreePrinter(ITopicTreeVisitor):
"""
Example topic tree visitor that prints a prettified representation
of topic tree by doing a depth-first traversal of topic tree and
print information at each (topic) node of tree. Extra info to be
printed is specified via the 'extra' kwarg. Its value mu... | class TopicTreePrinter(ITopicTreeVisitor):
"""
Example topic tree visitor that prints a prettified representation
of topic tree by doing a depth-first traversal of topic tree and
print information at each (topic) node of tree. Extra info to be
printed is specified via the 'extra' kwarg. Its value mu... | # topic kwargs
args = topicObj.getArgDescriptions()
if args:
#required, optional, complete = topicObj.getArgs()
headName = 'Names of Message arguments:'
if desc:
headName = 'Descriptions of message arguments:'
head = '%s %s' % (self... | # topic kwargs
args = topicObj.getArgDescriptions()
if args:
#required, optional, complete = topicObj.getArgs()
headName = 'Names of Message arguments:'
if desc:
headName = 'Descriptions of message arguments:'
head = '%s %s' % (self... | 86 | 1,487 | 251 | 1,738 | """
Output various aspects of topic tree to string or file.
:copyright: Copyright since 2006 by Oliver Schoenborn, all rights reserved.
:license: BSD, see LICENSE_BSD_Simple.txt for details.
"""
from textwrap import TextWrapper
from ..core.topictreetraverser import (ITopicTreeVisitor, TopicTreeTraverser)
class Top... | """
Output various aspects of topic tree to string or file.
:copyright: Copyright since 2006 by Oliver Schoenborn, all rights reserved.
:license: BSD, see LICENSE_BSD_Simple.txt for details.
"""
from textwrap import TextWrapper
from ..core.topictreetraverser import (ITopicTreeVisitor, TopicTreeTraverser)
class Top... |
42,403 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/wx/lib/scrolledpanel.py | 156,157 | 87,227 | _SetupAfter | ScrolledPanel | 157,163 | 157,163 | class ScrolledPanel(wx.ScrolledWindow):
"""
:class:`ScrolledPanel` fills a "hole" in the implementation of
:class:`ScrolledWindow`, providing automatic scrollbar and scrolling
behavior and the tab traversal management that :class:`ScrolledWindow` lacks.
"""
def __init__(self, parent, id=-1, pos... | class ScrolledPanel(wx.ScrolledWindow):
"""
:class:`ScrolledPanel` fills a "hole" in the implementation of
:class:`ScrolledWindow`, providing automatic scrollbar and scrolling
behavior and the tab traversal management that :class:`ScrolledWindow` lacks.
"""
def __init__(self, parent, id=-1, pos... | if self:
self.SetVirtualSize(self.GetBestVirtualSize())
if scrollToTop:
self.Scroll(0,0)
| if self:
self.SetVirtualSize(self.GetBestVirtualSize())
if scrollToTop:
self.Scroll(0,0)
| 6 | 1,697 | 45 | 1,742 | #----------------------------------------------------------------------------
# Name: scrolledpanel.py
# Author: Will Sadkin
# Created: 03/21/2003
# Copyright: (c) 2003 by Will Sadkin
# License: wxWindows license
# Tags: phoenix-port
#--------------------------------------------------... | #----------------------------------------------------------------------------
# Name: scrolledpanel.py
# Author: Will Sadkin
# Created: 03/21/2003
# Copyright: (c) 2003 by Will Sadkin
# License: wxWindows license
# Tags: phoenix-port
#--------------------------------------------------... |
42,404 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/wx/lib/splitter.py | 873,874 | 798,926 | GetSashPosition | MultiSplitterEvent | 883,886 | 874,886 | class MultiSplitterEvent(wx.PyCommandEvent):
"""
This event class is almost the same as `wx.SplitterEvent` except
it adds an accessor for the sash index that is being changed. The
same event type IDs and event binders are used as with
`wx.SplitterEvent`.
"""
def __init__(self, type=wx.wxEVT... | class MultiSplitterEvent(wx.PyCommandEvent):
"""
This event class is almost the same as `wx.SplitterEvent` except
it adds an accessor for the sash index that is being changed. The
same event type IDs and event binders are used as with
`wx.SplitterEvent`.
"""
def __init__(self, type=wx.wxEVT... | return self.sashPos
# methods from wx.NotifyEvent
| """
Returns the new sash position.
May only be called while processing ``wxEVT_SPLITTER_SASH_POS_CHANGING``
and ``wxEVT_SPLITTER_SASH_POS_CHANGED`` events.
:rtype: `int`
"""
return self.sashPos
# methods from wx.NotifyEvent
| 6 | 1,119 | 22 | 1,141 | #----------------------------------------------------------------------
# Name: wx.lib.splitter
# Purpose: A class similar to wx.SplitterWindow but that allows more
# than a single split
#
# Author: Robin Dunn
#
# Created: 9-June-2005
# Copyright: (c) 2005-2020 by Total Control Softwa... | #----------------------------------------------------------------------
# Name: wx.lib.splitter
# Purpose: A class similar to wx.SplitterWindow but that allows more
# than a single split
#
# Author: Robin Dunn
#
# Created: 9-June-2005
# Copyright: (c) 2005-2020 by Total Control Softwa... |
42,406 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/wx/lib/statbmp.py | 171,172 | 62,200 | OnPaint | GenStaticBitmap | 177,183 | 172,183 | class GenStaticBitmap(wx.Control):
""" :class:`GenStaticBitmap` is a generic implementation of :class:`wx.StaticBitmap`. """
labelDelta = 1
def __init__(self, parent, ID, bitmap,
pos = wx.DefaultPosition, size = wx.DefaultSize,
style = 0,
name = "genstatb... | class GenStaticBitmap(wx.Control):
""" :class:`GenStaticBitmap` is a generic implementation of :class:`wx.StaticBitmap`. """
labelDelta = 1
def __init__(self, parent, ID, bitmap,
pos = wx.DefaultPosition, size = wx.DefaultSize,
style = 0,
name = "genstatb... |
dc = wx.PaintDC(self)
if self._bitmap:
dc.DrawBitmap(self._bitmap, 0, 0, True)
| """
Handles the ``wx.EVT_PAINT`` for :class:`GenStaticBitmap`.
:param `event`: a :class:`wx.PaintEvent` event to be processed.
"""
dc = wx.PaintDC(self)
if self._bitmap:
dc.DrawBitmap(self._bitmap, 0, 0, True)
| 9 | 1,124 | 52 | 1,176 | #----------------------------------------------------------------------
# Name: wx.lib.statbmp
# Purpose: A generic StaticBitmap class.
#
# Author: Robin Dunn
#
# Created: 12-May-2004
# Copyright: (c) 2004-2020 by Total Control Software
# Licence: wxWindows license
# Tags: phoenix-port,... | #----------------------------------------------------------------------
# Name: wx.lib.statbmp
# Purpose: A generic StaticBitmap class.
#
# Author: Robin Dunn
#
# Created: 12-May-2004
# Copyright: (c) 2004-2020 by Total Control Software
# Licence: wxWindows license
# Tags: phoenix-port,... |
42,410 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/wx/lib/utils.py | 23,24 | 1,90 | AdjustRectToScreen | 41,90 | 24,90 | #----------------------------------------------------------------------
# Name: wx.lib.utils
# Purpose: Miscellaneous utility functions
#
# Author: Robin Dunn
#
# Created: 18-Jan-2009
# Copyright: (c) 2009-2020 Total Control Software
# Licence: wxWidgets license
#
# Tags: phoenix-port, ... | #----------------------------------------------------------------------
# Name: wx.lib.utils
# Purpose: Miscellaneous utility functions
#
# Author: Robin Dunn
#
# Created: 18-Jan-2009
# Copyright: (c) 2009-2020 Total Control Software
# Licence: wxWidgets license
#
# Tags: phoenix-port, ... |
assert isinstance(rect, wx.Rect)
if -1 in rect.Get():
# bail out if there are any -1's in the dimensions
return rect
dispidx = wx.Display.GetFromPoint(rect.Position)
if dispidx == wx.NOT_FOUND:
dispidx = 0
ca = wx.Display(dispidx).GetClientArea()
assert isinstance(ca, w... | """
Compare the rect with the dimensions of the display that the rect's
upper left corner is positioned on. If it doesn't fit entirely on
screen then attempt to make it do so either by repositioning the
rectangle, resizing it, or both. Returns the adjusted rectangle.
If the adjustment value is... | 170 | 347 | 485 | 832 | #----------------------------------------------------------------------
# Name: wx.lib.utils
# Purpose: Miscellaneous utility functions
#
# Author: Robin Dunn
#
# Created: 18-Jan-2009
# Copyright: (c) 2009-2020 Total Control Software
# Licence: wxWidgets license
#
# Tags: phoenix-port, ... | #----------------------------------------------------------------------
# Name: wx.lib.utils
# Purpose: Miscellaneous utility functions
#
# Author: Robin Dunn
#
# Created: 18-Jan-2009
# Copyright: (c) 2009-2020 Total Control Software
# Licence: wxWidgets license
#
# Tags: phoenix-port, ... | |
42,411 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/wx/lib/wordwrap.py | 13,14 | 1,98 | wordwrap | 23,56 | 14,56 | #----------------------------------------------------------------------
# Name: wx.lib.wordwrap
# Purpose: Contains a function to aid in word-wrapping some text
#
# Author: Robin Dunn
#
# Created: 15-Oct-2006
# Copyright: (c) 2006-2020 by Total Control Software
# Licence: wxWindows license
# T... | #----------------------------------------------------------------------
# Name: wx.lib.wordwrap
# Purpose: Contains a function to aid in word-wrapping some text
#
# Author: Robin Dunn
#
# Created: 15-Oct-2006
# Copyright: (c) 2006-2020 by Total Control Software
# Licence: wxWindows license
# T... |
wrapped_lines = []
text = text.split('\n')
for line in text:
pte = dc.GetPartialTextExtents(line)
wid = ( width - (2*margin+1)*dc.GetTextExtent(' ')[0]
- max([0] + [pte[i]-pte[i-1] for i in range(1,len(pte))]) )
idx = 0
start = 0
startIdx = 0
sp... | """
Returns a copy of text with newline characters inserted where long
lines should be broken such that they will fit within the given
width, with the given margin left and right, on the given `wx.DC`
using its current font settings. By default words that are wider
than the margin-adjusted widt... | 122 | 736 | 372 | 1,108 | #----------------------------------------------------------------------
# Name: wx.lib.wordwrap
# Purpose: Contains a function to aid in word-wrapping some text
#
# Author: Robin Dunn
#
# Created: 15-Oct-2006
# Copyright: (c) 2006-2020 by Total Control Software
# Licence: wxWindows license
# T... | #----------------------------------------------------------------------
# Name: wx.lib.wordwrap
# Purpose: Contains a function to aid in word-wrapping some text
#
# Author: Robin Dunn
#
# Created: 15-Oct-2006
# Copyright: (c) 2006-2020 by Total Control Software
# Licence: wxWindows license
# T... | |
42,412 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/wx/lib/wordwrap.py | 71,72 | 58,91 | OnDoUpdate | TestPanel | 72,91 | 72,91 | class TestPanel(wx.Panel):
def __init__(self, parent):
wx.Panel.__init__(self, parent)
self.tc = wx.TextCtrl(self, -1, "", (20,20), (150,150), wx.TE_MULTILINE)
self.Bind(wx.EVT_TEXT, self.OnDoUpdate, self.tc)
self.Bind(wx.EVT_SIZE, self.OnSize)
def ... | class TestPanel(wx.Panel):
def __init__(self, parent):
wx.Panel.__init__(self, parent)
self.tc = wx.TextCtrl(self, -1, "", (20,20), (150,150), wx.TE_MULTILINE)
self.Bind(wx.EVT_TEXT, self.OnDoUpdate, self.tc)
self.Bind(wx.EVT_SIZE, self.OnSize)
def ... | WIDTH = self.GetSize().width - 220
HEIGHT = 200
bmp = wx.Bitmap(WIDTH, HEIGHT)
mdc = wx.MemoryDC(bmp)
mdc.SetBackground(wx.Brush("white"))
mdc.Clear()
mdc.SetPen(wx.Pen("black"))
mdc.SetFont(wx.Font(10, wx.FONTFAMILY_SWISS, ... | WIDTH = self.GetSize().width - 220
HEIGHT = 200
bmp = wx.Bitmap(WIDTH, HEIGHT)
mdc = wx.MemoryDC(bmp)
mdc.SetBackground(wx.Brush("white"))
mdc.Clear()
mdc.SetPen(wx.Pen("black"))
mdc.SetFont(wx.Font(10, wx.FONTFAMILY_SWISS, ... | 44 | 168 | 274 | 442 | #----------------------------------------------------------------------
# Name: wx.lib.wordwrap
# Purpose: Contains a function to aid in word-wrapping some text
#
# Author: Robin Dunn
#
# Created: 15-Oct-2006
# Copyright: (c) 2006-2020 by Total Control Software
# Licence: wxWindows license
# T... | #----------------------------------------------------------------------
# Name: wx.lib.wordwrap
# Purpose: Contains a function to aid in word-wrapping some text
#
# Author: Robin Dunn
#
# Created: 15-Oct-2006
# Copyright: (c) 2006-2020 by Total Control Software
# Licence: wxWindows license
# T... |
42,413 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/wx/py/PyAlaCarte.py | 25,26 | 1,35 | main | 26,33 | 26,33 | #!/usr/bin/env python
"""PyAlaCarte is a simple programmer's editor."""
__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
import wx
from wx import py
import os
import sys
class App(wx.App):
"""PyAlaCarte standalone application."""
def __init__(self, filename=None):
self.filename = filename
... | #!/usr/bin/env python
"""PyAlaCarte is a simple programmer's editor."""
__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
import wx
from wx import py
import os
import sys
class App(wx.App):
"""PyAlaCarte standalone application."""
def __init__(self, filename=None):
self.filename = filename
... | if not filename and len(sys.argv) > 1:
filename = sys.argv[1]
if filename:
filename = os.path.realpath(filename)
app = App(filename)
app.MainLoop()
| if not filename and len(sys.argv) > 1:
filename = sys.argv[1]
if filename:
filename = os.path.realpath(filename)
app = App(filename)
app.MainLoop()
| 19 | 207 | 68 | 275 | #!/usr/bin/env python
"""PyAlaCarte is a simple programmer's editor."""
__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
import wx
from wx import py
import os
import sys
class App(wx.App):
"""PyAlaCarte standalone application."""
def __init__(self, filename=None):
self.filename = filename
... | #!/usr/bin/env python
"""PyAlaCarte is a simple programmer's editor."""
__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
import wx
from wx import py
import os
import sys
class App(wx.App):
"""PyAlaCarte standalone application."""
def __init__(self, filename=None):
self.filename = filename
... | |
42,414 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/wx/py/PyAlaCarte.py | 19,20 | 12,25 | OnInit | App | 20,25 | 20,25 | class App(wx.App):
"""PyAlaCarte standalone application."""
def __init__(self, filename=None):
self.filename = filename
wx.App.__init__(self, redirect=False)
def OnInit(self):
FILL_FUNC_BODY | class App(wx.App):
"""PyAlaCarte standalone application."""
def __init__(self, filename=None):
self.filename = filename
wx.App.__init__(self, redirect=False)
def OnInit(self):
FILL_FUNC_BODY | self.frame = py.editor.EditorFrame(filename=self.filename)
self.frame.Show()
self.SetTopWindow(self.frame)
return True
| self.frame = py.editor.EditorFrame(filename=self.filename)
self.frame.Show()
self.SetTopWindow(self.frame)
return True
| 7 | 73 | 49 | 122 | #!/usr/bin/env python
"""PyAlaCarte is a simple programmer's editor."""
__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
import wx
from wx import py
import os
import sys
class App(wx.App):
"""PyAlaCarte standalone application."""
def __init__(self, filename=None):
self.filename = filename
... | #!/usr/bin/env python
"""PyAlaCarte is a simple programmer's editor."""
__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
import wx
from wx import py
import os
import sys
class App(wx.App):
"""PyAlaCarte standalone application."""
def __init__(self, filename=None):
self.filename = filename
... |
42,415 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/wx/py/PyAlaMode.py | 25,26 | 1,35 | main | 26,33 | 26,33 | #!/usr/bin/env python
"""PyAlaMode is a programmer's editor."""
__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
import wx
from wx import py
import os
import sys
class App(wx.App):
"""PyAlaMode standalone application."""
def __init__(self, filename=None):
self.filename = filename
wx.... | #!/usr/bin/env python
"""PyAlaMode is a programmer's editor."""
__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
import wx
from wx import py
import os
import sys
class App(wx.App):
"""PyAlaMode standalone application."""
def __init__(self, filename=None):
self.filename = filename
wx.... | if not filename and len(sys.argv) > 1:
filename = sys.argv[1]
if filename:
filename = os.path.realpath(filename)
app = App(filename)
app.MainLoop()
| if not filename and len(sys.argv) > 1:
filename = sys.argv[1]
if filename:
filename = os.path.realpath(filename)
app = App(filename)
app.MainLoop()
| 19 | 206 | 68 | 274 | #!/usr/bin/env python
"""PyAlaMode is a programmer's editor."""
__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
import wx
from wx import py
import os
import sys
class App(wx.App):
"""PyAlaMode standalone application."""
def __init__(self, filename=None):
self.filename = filename
wx.... | #!/usr/bin/env python
"""PyAlaMode is a programmer's editor."""
__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
import wx
from wx import py
import os
import sys
class App(wx.App):
"""PyAlaMode standalone application."""
def __init__(self, filename=None):
self.filename = filename
wx.... | |
42,416 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/wx/py/PyAlaMode.py | 19,20 | 12,25 | OnInit | App | 20,25 | 20,25 | class App(wx.App):
"""PyAlaMode standalone application."""
def __init__(self, filename=None):
self.filename = filename
wx.App.__init__(self, redirect=False)
def OnInit(self):
FILL_FUNC_BODY | class App(wx.App):
"""PyAlaMode standalone application."""
def __init__(self, filename=None):
self.filename = filename
wx.App.__init__(self, redirect=False)
def OnInit(self):
FILL_FUNC_BODY | self.frame = py.editor.EditorNotebookFrame(filename=self.filename)
self.frame.Show()
self.SetTopWindow(self.frame)
return True
| self.frame = py.editor.EditorNotebookFrame(filename=self.filename)
self.frame.Show()
self.SetTopWindow(self.frame)
return True
| 7 | 72 | 51 | 123 | #!/usr/bin/env python
"""PyAlaMode is a programmer's editor."""
__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
import wx
from wx import py
import os
import sys
class App(wx.App):
"""PyAlaMode standalone application."""
def __init__(self, filename=None):
self.filename = filename
wx.... | #!/usr/bin/env python
"""PyAlaMode is a programmer's editor."""
__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
import wx
from wx import py
import os
import sys
class App(wx.App):
"""PyAlaMode standalone application."""
def __init__(self, filename=None):
self.filename = filename
wx.... |
42,417 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/wx/py/PyAlaModeTest.py | 25,26 | 1,34 | main | 26,29 | 26,29 | #!/usr/bin/env python
"""PyAlaModeTest is a programmer's editor."""
__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
import wx
from wx import py
import os
import sys
class App(wx.App):
"""PyAlaModeTest standalone application."""
def __init__(self, filename=None):
self.filename = filename
... | #!/usr/bin/env python
"""PyAlaModeTest is a programmer's editor."""
__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
import wx
from wx import py
import os
import sys
class App(wx.App):
"""PyAlaModeTest standalone application."""
def __init__(self, filename=None):
self.filename = filename
... | app = App(filename)
app.MainLoop()
| app = App(filename)
app.MainLoop()
| 4 | 247 | 19 | 266 | #!/usr/bin/env python
"""PyAlaModeTest is a programmer's editor."""
__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
import wx
from wx import py
import os
import sys
class App(wx.App):
"""PyAlaModeTest standalone application."""
def __init__(self, filename=None):
self.filename = filename
... | #!/usr/bin/env python
"""PyAlaModeTest is a programmer's editor."""
__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
import wx
from wx import py
import os
import sys
class App(wx.App):
"""PyAlaModeTest standalone application."""
def __init__(self, filename=None):
self.filename = filename
... | |
42,418 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/wx/py/PyAlaModeTest.py | 19,20 | 12,25 | OnInit | App | 20,25 | 20,25 | class App(wx.App):
"""PyAlaModeTest standalone application."""
def __init__(self, filename=None):
self.filename = filename
wx.App.__init__(self, redirect=False)
def OnInit(self):
FILL_FUNC_BODY | class App(wx.App):
"""PyAlaModeTest standalone application."""
def __init__(self, filename=None):
self.filename = filename
wx.App.__init__(self, redirect=False)
def OnInit(self):
FILL_FUNC_BODY | self.frame = py.editor.EditorShellNotebookFrame(filename=self.filename)
self.frame.Show()
self.SetTopWindow(self.frame)
return True
| self.frame = py.editor.EditorShellNotebookFrame(filename=self.filename)
self.frame.Show()
self.SetTopWindow(self.frame)
return True
| 7 | 73 | 52 | 125 | #!/usr/bin/env python
"""PyAlaModeTest is a programmer's editor."""
__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
import wx
from wx import py
import os
import sys
class App(wx.App):
"""PyAlaModeTest standalone application."""
def __init__(self, filename=None):
self.filename = filename
... | #!/usr/bin/env python
"""PyAlaModeTest is a programmer's editor."""
__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
import wx
from wx import py
import os
import sys
class App(wx.App):
"""PyAlaModeTest standalone application."""
def __init__(self, filename=None):
self.filename = filename
... |
42,419 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/wx/py/PyCrust.py | 47,48 | 1,79 | main | 49,77 | 48,77 | #!/usr/bin/env python
"""PyCrust is a python shell and namespace browser application."""
# The next two lines, and the other code below that makes use of
# ``__main__`` and ``original``, serve the purpose of cleaning up the
# main namespace to look as much as possible like the regular Python
# shell environment.
impor... | #!/usr/bin/env python
"""PyCrust is a python shell and namespace browser application."""
# The next two lines, and the other code below that makes use of
# ``__main__`` and ``original``, serve the purpose of cleaning up the
# main namespace to look as much as possible like the regular Python
# shell environment.
impor... | # Cleanup the main namespace, leaving the App class.
import __main__
md = __main__.__dict__
keepers = original
keepers.append('App')
for key in list(md):
if key not in keepers:
del md[key]
# Create an application instance.
app = App(0)
# Mimic the contents of the ... | """The main function for the PyCrust program."""
# Cleanup the main namespace, leaving the App class.
import __main__
md = __main__.__dict__
keepers = original
keepers.append('App')
for key in list(md):
if key not in keepers:
del md[key]
# Create an application instan... | 118 | 423 | 294 | 717 | #!/usr/bin/env python
"""PyCrust is a python shell and namespace browser application."""
# The next two lines, and the other code below that makes use of
# ``__main__`` and ``original``, serve the purpose of cleaning up the
# main namespace to look as much as possible like the regular Python
# shell environment.
impor... | #!/usr/bin/env python
"""PyCrust is a python shell and namespace browser application."""
# The next two lines, and the other code below that makes use of
# ``__main__`` and ``original``, serve the purpose of cleaning up the
# main namespace to look as much as possible like the regular Python
# shell environment.
impor... | |
42,420 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/wx/py/PyCrust.py | 18,19 | 15,37 | OnInit | App | 19,37 | 19,37 | class App(wx.App):
"""PyCrust standalone application."""
def OnInit(self):
FILL_FUNC_BODY | class App(wx.App):
"""PyCrust standalone application."""
def OnInit(self):
FILL_FUNC_BODY | import os
import wx
from wx import py
self.SetAppName("pycrust")
confDir = wx.StandardPaths.Get().GetUserDataDir()
if not os.path.exists(confDir):
os.mkdir(confDir)
fileName = os.path.join(confDir, 'config')
self.config = wx.FileConfig(localFi... | import os
import wx
from wx import py
self.SetAppName("pycrust")
confDir = wx.StandardPaths.Get().GetUserDataDir()
if not os.path.exists(confDir):
os.mkdir(confDir)
fileName = os.path.join(confDir, 'config')
self.config = wx.FileConfig(localFi... | 32 | 37 | 188 | 225 | #!/usr/bin/env python
"""PyCrust is a python shell and namespace browser application."""
# The next two lines, and the other code below that makes use of
# ``__main__`` and ``original``, serve the purpose of cleaning up the
# main namespace to look as much as possible like the regular Python
# shell environment.
impor... | #!/usr/bin/env python
"""PyCrust is a python shell and namespace browser application."""
# The next two lines, and the other code below that makes use of
# ``__main__`` and ``original``, serve the purpose of cleaning up the
# main namespace to look as much as possible like the regular Python
# shell environment.
impor... |
42,421 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/wx/py/PyFilling.py | 27,28 | 1,36 | main | 29,34 | 28,34 | #!/usr/bin/env python
"""PyFilling is a python namespace inspection application."""
__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
# We use this object to get more introspection when run standalone.
app = None
from . import filling
# These are imported just to have something interesting to inspect.
from . ... | #!/usr/bin/env python
"""PyFilling is a python namespace inspection application."""
__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
# We use this object to get more introspection when run standalone.
app = None
from . import filling
# These are imported just to have something interesting to inspect.
from . ... | global app
app = App(0)
app.fillingFrame.filling.tree.Expand(app.root)
app.MainLoop()
| """Create and run the application."""
global app
app = App(0)
app.fillingFrame.filling.tree.Expand(app.root)
app.MainLoop()
| 7 | 213 | 45 | 258 | #!/usr/bin/env python
"""PyFilling is a python namespace inspection application."""
__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
# We use this object to get more introspection when run standalone.
app = None
from . import filling
# These are imported just to have something interesting to inspect.
from . ... | #!/usr/bin/env python
"""PyFilling is a python namespace inspection application."""
__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
# We use this object to get more introspection when run standalone.
app = None
from . import filling
# These are imported just to have something interesting to inspect.
from . ... | |
42,422 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/wx/py/PyFilling.py | 22,23 | 21,27 | OnInit | App | 23,27 | 23,27 | class App(filling.App):
def OnInit(self):
FILL_FUNC_BODY | class App(filling.App):
def OnInit(self):
FILL_FUNC_BODY | filling.App.OnInit(self)
self.root = self.fillingFrame.filling.tree.root
return True
| filling.App.OnInit(self)
self.root = self.fillingFrame.filling.tree.root
return True
| 6 | 27 | 38 | 65 | #!/usr/bin/env python
"""PyFilling is a python namespace inspection application."""
__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
# We use this object to get more introspection when run standalone.
app = None
from . import filling
# These are imported just to have something interesting to inspect.
from . ... | #!/usr/bin/env python
"""PyFilling is a python namespace inspection application."""
__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
# We use this object to get more introspection when run standalone.
app = None
from . import filling
# These are imported just to have something interesting to inspect.
from . ... |
42,423 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/wx/py/PyShell.py | 47,48 | 1,79 | main | 49,77 | 48,77 | #!/usr/bin/env python
"""PyShell is a python shell application."""
# The next two lines, and the other code below that makes use of
# ``__main__`` and ``original``, serve the purpose of cleaning up the
# main namespace to look as much as possible like the regular Python
# shell environment.
import __main__
original = ... | #!/usr/bin/env python
"""PyShell is a python shell application."""
# The next two lines, and the other code below that makes use of
# ``__main__`` and ``original``, serve the purpose of cleaning up the
# main namespace to look as much as possible like the regular Python
# shell environment.
import __main__
original = ... | # Cleanup the main namespace, leaving the App class.
import __main__
md = __main__.__dict__
keepers = original
keepers.append('App')
for key in list(md):
if key not in keepers:
del md[key]
# Create an application instance.
app = App(0)
# Cleanup the main namespace... | """The main function for the PyShell program."""
# Cleanup the main namespace, leaving the App class.
import __main__
md = __main__.__dict__
keepers = original
keepers.append('App')
for key in list(md):
if key not in keepers:
del md[key]
# Create an application instan... | 118 | 416 | 294 | 710 | #!/usr/bin/env python
"""PyShell is a python shell application."""
# The next two lines, and the other code below that makes use of
# ``__main__`` and ``original``, serve the purpose of cleaning up the
# main namespace to look as much as possible like the regular Python
# shell environment.
import __main__
original = ... | #!/usr/bin/env python
"""PyShell is a python shell application."""
# The next two lines, and the other code below that makes use of
# ``__main__`` and ``original``, serve the purpose of cleaning up the
# main namespace to look as much as possible like the regular Python
# shell environment.
import __main__
original = ... | |
42,424 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/wx/py/PyShell.py | 19,20 | 16,37 | OnInit | App | 20,37 | 20,37 | class App(wx.App):
"""PyShell standalone application."""
def OnInit(self):
FILL_FUNC_BODY | class App(wx.App):
"""PyShell standalone application."""
def OnInit(self):
FILL_FUNC_BODY | import os
import wx
from wx import py
self.SetAppName("pyshell")
confDir = wx.StandardPaths.Get().GetUserDataDir()
if not os.path.exists(confDir):
os.mkdir(confDir)
fileName = os.path.join(confDir, 'config')
self.config = wx.FileConfig(localFi... | import os
import wx
from wx import py
self.SetAppName("pyshell")
confDir = wx.StandardPaths.Get().GetUserDataDir()
if not os.path.exists(confDir):
os.mkdir(confDir)
fileName = os.path.join(confDir, 'config')
self.config = wx.FileConfig(localFi... | 32 | 36 | 184 | 220 | #!/usr/bin/env python
"""PyShell is a python shell application."""
# The next two lines, and the other code below that makes use of
# ``__main__`` and ``original``, serve the purpose of cleaning up the
# main namespace to look as much as possible like the regular Python
# shell environment.
import __main__
original = ... | #!/usr/bin/env python
"""PyShell is a python shell application."""
# The next two lines, and the other code below that makes use of
# ``__main__`` and ``original``, serve the purpose of cleaning up the
# main namespace to look as much as possible like the regular Python
# shell environment.
import __main__
original = ... |
42,425 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/wx/py/PySlices.py | 58,59 | 1,99 | main | 60,97 | 59,97 | #!/usr/bin/env python
"""PySlices is a python block code editor / shell and namespace browser application."""
# The next two lines, and the other code below that makes use of
# ``__main__`` and ``original``, serve the purpose of cleaning up the
# main namespace to look as much as possible like the regular Python
# she... | #!/usr/bin/env python
"""PySlices is a python block code editor / shell and namespace browser application."""
# The next two lines, and the other code below that makes use of
# ``__main__`` and ``original``, serve the purpose of cleaning up the
# main namespace to look as much as possible like the regular Python
# she... | # Cleanup the main namespace, leaving the App class.
import sys
if not filename and len(sys.argv) > 1:
filename = sys.argv[1]
if filename:
filename = os.path.realpath(filename)
import __main__
md = __main__.__dict__
keepers = original
keepers.append('App')
keepers.ap... | """The main function for the PySlices program."""
# Cleanup the main namespace, leaving the App class.
import sys
if not filename and len(sys.argv) > 1:
filename = sys.argv[1]
if filename:
filename = os.path.realpath(filename)
import __main__
md = __main__.__dict__
keepe... | 146 | 573 | 387 | 960 | #!/usr/bin/env python
"""PySlices is a python block code editor / shell and namespace browser application."""
# The next two lines, and the other code below that makes use of
# ``__main__`` and ``original``, serve the purpose of cleaning up the
# main namespace to look as much as possible like the regular Python
# she... | #!/usr/bin/env python
"""PySlices is a python block code editor / shell and namespace browser application."""
# The next two lines, and the other code below that makes use of
# ``__main__`` and ``original``, serve the purpose of cleaning up the
# main namespace to look as much as possible like the regular Python
# she... | |
42,426 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/wx/py/PySlices.py | 26,27 | 17,48 | OnInit | App | 27,48 | 27,48 | class App(wx.App):
"""PySlices standalone application."""
def __init__(self, filename=None):
self.filename = filename
import wx
wx.App.__init__(self, redirect=False)
def OnInit(self):
FILL_FUNC_BODY | class App(wx.App):
"""PySlices standalone application."""
def __init__(self, filename=None):
self.filename = filename
import wx
wx.App.__init__(self, redirect=False)
def OnInit(self):
FILL_FUNC_BODY | import os
import wx
from wx import py
self.SetAppName("pyslices")
confDir = wx.StandardPaths.Get().GetUserDataDir()
if not os.path.exists(confDir):
os.mkdir(confDir)
fileName = os.path.join(confDir, 'config')
self.config = wx.FileConfig(localF... | import os
import wx
from wx import py
self.SetAppName("pyslices")
confDir = wx.StandardPaths.Get().GetUserDataDir()
if not os.path.exists(confDir):
os.mkdir(confDir)
fileName = os.path.join(confDir, 'config')
self.config = wx.FileConfig(localF... | 41 | 77 | 259 | 336 | #!/usr/bin/env python
"""PySlices is a python block code editor / shell and namespace browser application."""
# The next two lines, and the other code below that makes use of
# ``__main__`` and ``original``, serve the purpose of cleaning up the
# main namespace to look as much as possible like the regular Python
# she... | #!/usr/bin/env python
"""PySlices is a python block code editor / shell and namespace browser application."""
# The next two lines, and the other code below that makes use of
# ``__main__`` and ``original``, serve the purpose of cleaning up the
# main namespace to look as much as possible like the regular Python
# she... |
42,427 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/wx/py/PySlicesShell.py | 54,55 | 1,95 | main | 56,93 | 55,93 | #!/usr/bin/env python
"""PySlicesShell is a python shell application."""
# The next two lines, and the other code below that makes use of
# ``__main__`` and ``original``, serve the purpose of cleaning up the
# main namespace to look as much as possible like the regular Python
# shell environment.
import __main__
origi... | #!/usr/bin/env python
"""PySlicesShell is a python shell application."""
# The next two lines, and the other code below that makes use of
# ``__main__`` and ``original``, serve the purpose of cleaning up the
# main namespace to look as much as possible like the regular Python
# shell environment.
import __main__
origi... | # Cleanup the main namespace, leaving the App class.
import sys
if not filename and len(sys.argv) > 1:
filename = sys.argv[1]
if filename:
filename = os.path.realpath(filename)
import __main__
md = __main__.__dict__
keepers = original
keepers.append('App')
keepers.ap... | """The main function for the PySlicesShell program."""
# Cleanup the main namespace, leaving the App class.
import sys
if not filename and len(sys.argv) > 1:
filename = sys.argv[1]
if filename:
filename = os.path.realpath(filename)
import __main__
md = __main__.__dict__
... | 146 | 490 | 387 | 877 | #!/usr/bin/env python
"""PySlicesShell is a python shell application."""
# The next two lines, and the other code below that makes use of
# ``__main__`` and ``original``, serve the purpose of cleaning up the
# main namespace to look as much as possible like the regular Python
# shell environment.
import __main__
origi... | #!/usr/bin/env python
"""PySlicesShell is a python shell application."""
# The next two lines, and the other code below that makes use of
# ``__main__`` and ``original``, serve the purpose of cleaning up the
# main namespace to look as much as possible like the regular Python
# shell environment.
import __main__
origi... | |
42,428 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/wx/py/PySlicesShell.py | 24,25 | 16,44 | OnInit | App | 25,44 | 25,44 | class App(wx.App):
"""PySlicesShell standalone application."""
def __init__(self, filename=None):
self.filename = filename
import wx
wx.App.__init__(self, redirect=False)
def OnInit(self):
FILL_FUNC_BODY | class App(wx.App):
"""PySlicesShell standalone application."""
def __init__(self, filename=None):
self.filename = filename
import wx
wx.App.__init__(self, redirect=False)
def OnInit(self):
FILL_FUNC_BODY | import os
import wx
from wx import py
self.SetAppName("pysliceshell")
confDir = wx.StandardPaths.Get().GetUserDataDir()
if not os.path.exists(confDir):
os.mkdir(confDir)
fileName = os.path.join(confDir, 'config')
self.config = wx.FileConfig(lo... | import os
import wx
from wx import py
self.SetAppName("pysliceshell")
confDir = wx.StandardPaths.Get().GetUserDataDir()
if not os.path.exists(confDir):
os.mkdir(confDir)
fileName = os.path.join(confDir, 'config')
self.config = wx.FileConfig(lo... | 33 | 77 | 206 | 283 | #!/usr/bin/env python
"""PySlicesShell is a python shell application."""
# The next two lines, and the other code below that makes use of
# ``__main__`` and ``original``, serve the purpose of cleaning up the
# main namespace to look as much as possible like the regular Python
# shell environment.
import __main__
origi... | #!/usr/bin/env python
"""PySlicesShell is a python shell application."""
# The next two lines, and the other code below that makes use of
# ``__main__`` and ``original``, serve the purpose of cleaning up the
# main namespace to look as much as possible like the regular Python
# shell environment.
import __main__
origi... |
42,429 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/wx/py/PyWrap.py | 26,27 | 1,53 | main | 27,51 | 27,51 | #!/usr/bin/env python
#----------------------------------------------------------------------
# Name: PyWrap.py
# Purpose: PyWrap is a command line utility that runs a wxPython program with
# additional runtime-tools, such as PyCrust.
# Tags: phoenix-port
#--------------------------------... | #!/usr/bin/env python
#----------------------------------------------------------------------
# Name: PyWrap.py
# Purpose: PyWrap is a command line utility that runs a wxPython program with
# additional runtime-tools, such as PyCrust.
# Tags: phoenix-port
#--------------------------------... | sys.path.insert(0, os.curdir)
if not modulename:
if len(sys.argv) < 2:
print("Please specify a module name.")
raise SystemExit
modulename = sys.argv[1]
if modulename.endswith('.py'):
modulename = modulename[:-3]
module = __import__(modulename)
... | sys.path.insert(0, os.curdir)
if not modulename:
if len(sys.argv) < 2:
print("Please specify a module name.")
raise SystemExit
modulename = sys.argv[1]
if modulename.endswith('.py'):
modulename = modulename[:-3]
module = __import__(modulename)
... | 68 | 244 | 229 | 473 | #!/usr/bin/env python
#----------------------------------------------------------------------
# Name: PyWrap.py
# Purpose: PyWrap is a command line utility that runs a wxPython program with
# additional runtime-tools, such as PyCrust.
# Tags: phoenix-port
#--------------------------------... | #!/usr/bin/env python
#----------------------------------------------------------------------
# Name: PyWrap.py
# Purpose: PyWrap is a command line utility that runs a wxPython program with
# additional runtime-tools, such as PyCrust.
# Tags: phoenix-port
#--------------------------------... | |
42,430 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/wx/py/buffer.py | 61,62 | 13,137 | open | Buffer | 63,77 | 62,77 | class Buffer:
"""Buffer class."""
id = 0
def __init__(self, filename=None):
"""Create a Buffer instance."""
Buffer.id += 1
self.id = Buffer.id
self.interp = Interpreter(locals={})
self.name = ''
self.editors = {}
self.editor = None
self.modul... | class Buffer:
"""Buffer class."""
id = 0
def __init__(self, filename=None):
"""Create a Buffer instance."""
Buffer.id += 1
self.id = Buffer.id
self.interp = Interpreter(locals={})
self.name = ''
self.editors = {}
self.editor = None
self.modul... | self.doc = document.Document(filename)
self.name = self.doc.filename or ('Untitled:' + str(self.id))
self.modulename = self.doc.filebase
# XXX This should really make sure filedir is first item in syspath.
# XXX Or maybe this should be moved to the update namespace method.
... | """Open file into buffer."""
self.doc = document.Document(filename)
self.name = self.doc.filename or ('Untitled:' + str(self.id))
self.modulename = self.doc.filebase
# XXX This should really make sure filedir is first item in syspath.
# XXX Or maybe this should be moved t... | 70 | 890 | 223 | 1,113 | """Buffer class."""
__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
from .interpreter import Interpreter
import types
import os
import sys
from . import document
class Buffer:
"""Buffer class."""
id = 0
def __init__(self, filename=None):
"""Create a Buffer instance."""
Buffer.... | """Buffer class."""
__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
from .interpreter import Interpreter
import types
import os
import sys
from . import document
class Buffer:
"""Buffer class."""
id = 0
def __init__(self, filename=None):
"""Create a Buffer instance."""
Buffer.... |
42,431 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/wx/py/crust.py | 210,211 | 196,223 | display | Calltip | 212,223 | 211,223 | class Calltip(wx.TextCtrl):
"""Text control containing the most recent shell calltip."""
def __init__(self, parent=None, id=-1,ShellClassName='Shell'):
style = (wx.TE_MULTILINE | wx.TE_READONLY | wx.TE_RICH2)
wx.TextCtrl.__init__(self, parent, id, style=style)
self.SetBackgroundColour(w... | class Calltip(wx.TextCtrl):
"""Text control containing the most recent shell calltip."""
def __init__(self, parent=None, id=-1,ShellClassName='Shell'):
style = (wx.TE_MULTILINE | wx.TE_READONLY | wx.TE_RICH2)
wx.TextCtrl.__init__(self, parent, id, style=style)
self.SetBackgroundColour(w... | if not self:
dispatcher.disconnect(receiver=self.display, signal=self.ShellClassName+'.calltip')
return
## self.SetValue(calltip) # Caused refresh problem on Windows.
self.Clear()
self.AppendText(calltip)
self.SetInsertionPoint(0)
# TODO: Switch this t... | """Receiver for this.calltip signal."""
if not self:
dispatcher.disconnect(receiver=self.display, signal=self.ShellClassName+'.calltip')
return
## self.SetValue(calltip) # Caused refresh problem on Windows.
self.Clear()
self.AppendText(calltip)
s... | 24 | 262 | 111 | 373 | """Crust combines the shell and filling into one control."""
__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
import wx
import os
import pprint
import re
import sys
from . import dispatcher
from . import editwindow
from .filling import Filling
from . import frame
from .shell import Shell
from .version import... | """Crust combines the shell and filling into one control."""
__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
import wx
import os
import pprint
import re
import sys
from . import dispatcher
from . import editwindow
from .filling import Filling
from . import frame
from .shell import Shell
from .version import... |
42,432 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/wx/py/crust.py | 135,136 | 20,155 | _updateSashPosValue | Crust | 136,138 | 136,138 | class Crust(wx.SplitterWindow):
"""Crust based on SplitterWindow."""
name = 'Crust'
sashoffset = 300
def __init__(self, parent, id=-1, pos=wx.DefaultPosition,
size=wx.DefaultSize, style=wx.SP_3D|wx.SP_LIVE_UPDATE,
name='Crust Window', rootObject=None, rootLabel=None,
... | class Crust(wx.SplitterWindow):
"""Crust based on SplitterWindow."""
name = 'Crust'
sashoffset = 300
def __init__(self, parent, id=-1, pos=wx.DefaultPosition,
size=wx.DefaultSize, style=wx.SP_3D|wx.SP_LIVE_UPDATE,
name='Crust Window', rootObject=None, rootLabel=None,
... | sz = self.GetSize()
self.sashoffset = sz.height - self.GetSashPosition()
| sz = self.GetSize()
self.sashoffset = sz.height - self.GetSashPosition()
| 8 | 1,602 | 32 | 1,634 | """Crust combines the shell and filling into one control."""
__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
import wx
import os
import pprint
import re
import sys
from . import dispatcher
from . import editwindow
from .filling import Filling
from . import frame
from .shell import Shell
from .version import... | """Crust combines the shell and filling into one control."""
__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
import wx
import os
import pprint
import re
import sys
from . import dispatcher
from . import editwindow
from .filling import Filling
from . import frame
from .shell import Shell
from .version import... |
42,433 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/wx/py/crust.py | 384,385 | 304,404 | LoadSettings | CrustFrame | 385,391 | 385,391 | class CrustFrame(frame.Frame, frame.ShellFrameMixin):
"""Frame containing all the PyCrust components."""
name = 'CrustFrame'
def __init__(self, parent=None, id=-1, title='PyCrust',
pos=wx.DefaultPosition, size=wx.DefaultSize,
style=wx.DEFAULT_FRAME_STYLE,
... | class CrustFrame(frame.Frame, frame.ShellFrameMixin):
"""Frame containing all the PyCrust components."""
name = 'CrustFrame'
def __init__(self, parent=None, id=-1, title='PyCrust',
pos=wx.DefaultPosition, size=wx.DefaultSize,
style=wx.DEFAULT_FRAME_STYLE,
... | if self.config is not None:
frame.ShellFrameMixin.LoadSettings(self)
frame.Frame.LoadSettings(self, self.config)
self.crust.LoadSettings(self.config)
| if self.config is not None:
frame.ShellFrameMixin.LoadSettings(self)
frame.Frame.LoadSettings(self, self.config)
self.crust.LoadSettings(self.config)
| 9 | 984 | 61 | 1,045 | """Crust combines the shell and filling into one control."""
__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
import wx
import os
import pprint
import re
import sys
from . import dispatcher
from . import editwindow
from .filling import Filling
from . import frame
from .shell import Shell
from .version import... | """Crust combines the shell and filling into one control."""
__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
import wx
import os
import pprint
import re
import sys
from . import dispatcher
from . import editwindow
from .filling import Filling
from . import frame
from .shell import Shell
from .version import... |
42,434 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/wx/py/crust.py | 290,291 | 277,304 | spy | DispatcherListing | 292,304 | 291,304 | class DispatcherListing(wx.TextCtrl):
"""Text control containing all dispatches for session."""
def __init__(self, parent=None, id=-1):
style = (wx.TE_MULTILINE | wx.TE_READONLY |
wx.TE_RICH2 | wx.TE_DONTWRAP)
wx.TextCtrl.__init__(self, parent, id, style=style)
dispatch... | class DispatcherListing(wx.TextCtrl):
"""Text control containing all dispatches for session."""
def __init__(self, parent=None, id=-1):
style = (wx.TE_MULTILINE | wx.TE_READONLY |
wx.TE_RICH2 | wx.TE_DONTWRAP)
wx.TextCtrl.__init__(self, parent, id, style=style)
dispatch... | if not self:
dispatcher.disconnect(receiver=self.spy)
return
text = '%r from %s' % (signal, sender)
self.SetInsertionPointEnd()
start, end = self.GetSelection()
if start != end:
self.SetSelection(0, 0)
self.AppendText(text + '\n')
| """Receiver for Any signal from Any sender."""
if not self:
dispatcher.disconnect(receiver=self.spy)
return
text = '%r from %s' % (signal, sender)
self.SetInsertionPointEnd()
start, end = self.GetSelection()
if start != end:
self.SetSel... | 27 | 218 | 109 | 327 | """Crust combines the shell and filling into one control."""
__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
import wx
import os
import pprint
import re
import sys
from . import dispatcher
from . import editwindow
from .filling import Filling
from . import frame
from .shell import Shell
from .version import... | """Crust combines the shell and filling into one control."""
__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
import wx
import os
import pprint
import re
import sys
from . import dispatcher
from . import editwindow
from .filling import Filling
from . import frame
from .shell import Shell
from .version import... |
42,435 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/wx/py/crust.py | 185,186 | 155,196 | setItem | Display | 187,196 | 186,196 | class Display(editwindow.EditWindow):
"""STC used to display an object using Pretty Print."""
def __init__(self, parent, id=-1, pos=wx.DefaultPosition,
size=wx.DefaultSize,
style=wx.CLIP_CHILDREN | wx.SUNKEN_BORDER,
static=False):
"""Create Display ins... | class Display(editwindow.EditWindow):
"""STC used to display an object using Pretty Print."""
def __init__(self, parent, id=-1, pos=wx.DefaultPosition,
size=wx.DefaultSize,
style=wx.CLIP_CHILDREN | wx.SUNKEN_BORDER,
static=False):
"""Create Display ins... | self.item = item
self.Refresh()
if self.GetParent().GetSelection() != self.nbTab:
focus = wx.Window.FindFocus()
self.GetParent().SetSelection(self.nbTab)
wx.CallAfter(focus.SetFocus)
# TODO: Switch this to a editwindow.EditWindow
| """Set item to pretty print in the notebook Display tab."""
self.item = item
self.Refresh()
if self.GetParent().GetSelection() != self.nbTab:
focus = wx.Window.FindFocus()
self.GetParent().SetSelection(self.nbTab)
wx.CallAfter(focus.SetFocus)
# TODO:... | 20 | 345 | 94 | 439 | """Crust combines the shell and filling into one control."""
__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
import wx
import os
import pprint
import re
import sys
from . import dispatcher
from . import editwindow
from .filling import Filling
from . import frame
from .shell import Shell
from .version import... | """Crust combines the shell and filling into one control."""
__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
import wx
import os
import pprint
import re
import sys
from . import dispatcher
from . import editwindow
from .filling import Filling
from . import frame
from .shell import Shell
from .version import... |
42,436 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/wx/py/crust.py | 252,253 | 223,277 | loadHistory | SessionListing | 253,262 | 253,262 | class SessionListing(wx.TextCtrl):
"""Text control containing all commands for session."""
def __init__(self, parent=None, id=-1,ShellClassName='Shell'):
style = (wx.TE_MULTILINE | wx.TE_READONLY |
wx.TE_RICH2 | wx.TE_DONTWRAP)
wx.TextCtrl.__init__(self, parent, id, style=style... | class SessionListing(wx.TextCtrl):
"""Text control containing all commands for session."""
def __init__(self, parent=None, id=-1,ShellClassName='Shell'):
style = (wx.TE_MULTILINE | wx.TE_READONLY |
wx.TE_RICH2 | wx.TE_DONTWRAP)
wx.TextCtrl.__init__(self, parent, id, style=style... | # preload the existing history, if any
if not self:
self._disconnect()
return
hist = history[:]
hist.reverse()
self.SetValue('\n'.join(hist) + '\n')
self.SetInsertionPointEnd()
| # preload the existing history, if any
if not self:
self._disconnect()
return
hist = history[:]
hist.reverse()
self.SetValue('\n'.join(hist) + '\n')
self.SetInsertionPointEnd()
| 20 | 483 | 79 | 562 | """Crust combines the shell and filling into one control."""
__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
import wx
import os
import pprint
import re
import sys
from . import dispatcher
from . import editwindow
from .filling import Filling
from . import frame
from .shell import Shell
from .version import... | """Crust combines the shell and filling into one control."""
__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
import wx
import os
import pprint
import re
import sys
from . import dispatcher
from . import editwindow
from .filling import Filling
from . import frame
from .shell import Shell
from .version import... |
42,437 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/wx/py/document.py | 30,31 | 8,38 | write | Document | 32,38 | 31,38 | class Document:
"""Document class."""
def __init__(self, filename=None):
"""Create a Document instance."""
self.filename = filename
self.filepath = None
self.filedir = None
self.filebase = None
self.fileext = None
if self.filename:
self.filepa... | class Document:
"""Document class."""
def __init__(self, filename=None):
"""Create a Document instance."""
self.filename = filename
self.filepath = None
self.filedir = None
self.filebase = None
self.fileext = None
if self.filename:
self.filepa... | with open(self.filepath, 'wb') as f:
try: # Convert from unicode to bytes
text = text.encode('utf-8')
f.write(text)
except AttributeError:
pass
| """Write text to file."""
with open(self.filepath, 'wb') as f:
try: # Convert from unicode to bytes
text = text.encode('utf-8')
f.write(text)
except AttributeError:
pass
| 19 | 239 | 65 | 304 | """Document class."""
__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
import os
class Document:
"""Document class."""
def __init__(self, filename=None):
"""Create a Document instance."""
self.filename = filename
self.filepath = None
self.filedir = None
self.f... | """Document class."""
__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
import os
class Document:
"""Document class."""
def __init__(self, filename=None):
"""Create a Document instance."""
self.filename = filename
self.filepath = None
self.filedir = None
self.f... |
42,438 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/wx/py/filling.py | 353,354 | 350,358 | OnInit | App | 354,358 | 354,358 | class App(wx.App):
"""PyFilling standalone application."""
def OnInit(self):
FILL_FUNC_BODY | class App(wx.App):
"""PyFilling standalone application."""
def OnInit(self):
FILL_FUNC_BODY | self.fillingFrame = FillingFrame()
self.fillingFrame.Show(True)
self.SetTopWindow(self.fillingFrame)
return True
| self.fillingFrame = FillingFrame()
self.fillingFrame.Show(True)
self.SetTopWindow(self.fillingFrame)
return True
| 7 | 37 | 46 | 83 | """Filling is the gui tree control through which a user can navigate
the local namespace or any object."""
__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
# Tags: py3-port
import wx
import six
from . import dispatcher
from . import editwindow
from . import images
import inspect
from . import introspect
impor... | """Filling is the gui tree control through which a user can navigate
the local namespace or any object."""
__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
# Tags: py3-port
import wx
import six
from . import dispatcher
from . import editwindow
from . import images
import inspect
from . import introspect
impor... |
42,439 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/wx/py/filling.py | 321,322 | 275,327 | SaveSettings | Filling | 322,327 | 322,327 | class Filling(wx.SplitterWindow):
"""Filling based on wxSplitterWindow."""
name = 'Filling'
def __init__(self, parent, id=-1, pos=wx.DefaultPosition,
size=wx.DefaultSize, style=wx.SP_3D|wx.SP_LIVE_UPDATE,
name='Filling Window', rootObject=None,
rootLabel=... | class Filling(wx.SplitterWindow):
"""Filling based on wxSplitterWindow."""
name = 'Filling'
def __init__(self, parent, id=-1, pos=wx.DefaultPosition,
size=wx.DefaultSize, style=wx.SP_3D|wx.SP_LIVE_UPDATE,
name='Filling Window', rootObject=None,
rootLabel=... | config.WriteInt('Sash/FillingPos', self.GetSashPosition())
config.WriteInt('View/Zoom/Filling', self.text.GetZoom())
| config.WriteInt('Sash/FillingPos', self.GetSashPosition())
config.WriteInt('View/Zoom/Filling', self.text.GetZoom())
| 4 | 535 | 52 | 587 | """Filling is the gui tree control through which a user can navigate
the local namespace or any object."""
__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
# Tags: py3-port
import wx
import six
from . import dispatcher
from . import editwindow
from . import images
import inspect
from . import introspect
impor... | """Filling is the gui tree control through which a user can navigate
the local namespace or any object."""
__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
# Tags: py3-port
import wx
import six
from . import dispatcher
from . import editwindow
from . import images
import inspect
from . import introspect
impor... |
42,440 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/wx/py/filling.py | 269,270 | 245,275 | SetText | FillingText | 270,275 | 270,275 | class FillingText(editwindow.EditWindow):
"""FillingText based on StyledTextCtrl."""
name = 'Filling Text'
def __init__(self, parent, id=-1, pos=wx.DefaultPosition,
size=wx.DefaultSize, style=wx.CLIP_CHILDREN,
static=False):
"""Create FillingText instance."""
... | class FillingText(editwindow.EditWindow):
"""FillingText based on StyledTextCtrl."""
name = 'Filling Text'
def __init__(self, parent, id=-1, pos=wx.DefaultPosition,
size=wx.DefaultSize, style=wx.CLIP_CHILDREN,
static=False):
"""Create FillingText instance."""
... | self.SetReadOnly(False)
editwindow.EditWindow.SetText(self, *args, **kwds)
self.SetReadOnly(True)
| self.SetReadOnly(False)
editwindow.EditWindow.SetText(self, *args, **kwds)
self.SetReadOnly(True)
| 5 | 282 | 47 | 329 | """Filling is the gui tree control through which a user can navigate
the local namespace or any object."""
__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
# Tags: py3-port
import wx
import six
from . import dispatcher
from . import editwindow
from . import images
import inspect
from . import introspect
impor... | """Filling is the gui tree control through which a user can navigate
the local namespace or any object."""
__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
# Tags: py3-port
import wx
import six
from . import dispatcher
from . import editwindow
from . import images
import inspect
from . import introspect
impor... |
42,443 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/wx/py/magic.py | 25,26 | 1,99 | magicSingle | 26,74 | 26,74 | #----------------------------------------------------------------------
# Name: magic.py
# Author: David N. Mashburn <david.n.mashburn@gmail.com>
# Created: 07/01/2009
# Tags: phoenix-port
#----------------------------------------------------------------------
"""magic.py is a utility that allows... | #----------------------------------------------------------------------
# Name: magic.py
# Author: David N. Mashburn <david.n.mashburn@gmail.com>
# Created: 07/01/2009
# Tags: phoenix-port
#----------------------------------------------------------------------
"""magic.py is a utility that allows... | if command=='': # Pass if command is blank
return command
first_space=command.find(' ')
if command[0]==' ': # Pass if command begins with a space
pass
elif command[0]=='?': # Do help if starts with ?
command='help('+command[1:]+')'
elif command[0]=='!': # Use os.system if s... | if command=='': # Pass if command is blank
return command
first_space=command.find(' ')
if command[0]==' ': # Pass if command begins with a space
pass
elif command[0]=='?': # Do help if starts with ?
command='help('+command[1:]+')'
elif command[0]=='!': # Use os.system if s... | 197 | 543 | 714 | 1,257 | #----------------------------------------------------------------------
# Name: magic.py
# Author: David N. Mashburn <david.n.mashburn@gmail.com>
# Created: 07/01/2009
# Tags: phoenix-port
#----------------------------------------------------------------------
"""magic.py is a utility that allows... | #----------------------------------------------------------------------
# Name: magic.py
# Author: David N. Mashburn <david.n.mashburn@gmail.com>
# Created: 07/01/2009
# Tags: phoenix-port
#----------------------------------------------------------------------
"""magic.py is a utility that allows... | |
42,444 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/wx/py/parse.py | 20,21 | 1,135 | testForContinuations | 21,135 | 21,135 | #----------------------------------------------------------------------
# Name: parse.py
# Author: David N. Mashburn <david.n.mashburn@gmail.com>
# Created: 12/20/2009
# Tags: phoenix-port
#----------------------------------------------------------------------
"""parse.py is a utility that allows... | #----------------------------------------------------------------------
# Name: parse.py
# Author: David N. Mashburn <david.n.mashburn@gmail.com>
# Created: 12/20/2009
# Tags: phoenix-port
#----------------------------------------------------------------------
"""parse.py is a utility that allows... | """ Test 4 different types of continuations:""" + \
""" String Continuations (ie with ''')""" + \
""" Indentation Block Continuations (ie "if 1:" )""" + \
""" Line Continuations (ie with \\ character )""" + \
""" Parenthetical continuations (, [, or {"""
stringMark = None
paraList = []
... | """ Test 4 different types of continuations:""" + \
""" String Continuations (ie with ''')""" + \
""" Indentation Block Continuations (ie "if 1:" )""" + \
""" Line Continuations (ie with \\ character )""" + \
""" Parenthetical continuations (, [, or {"""
stringMark = None
paraList = []
... | 371 | 207 | 1,360 | 1,567 | #----------------------------------------------------------------------
# Name: parse.py
# Author: David N. Mashburn <david.n.mashburn@gmail.com>
# Created: 12/20/2009
# Tags: phoenix-port
#----------------------------------------------------------------------
"""parse.py is a utility that allows... | #----------------------------------------------------------------------
# Name: parse.py
# Author: David N. Mashburn <david.n.mashburn@gmail.com>
# Created: 12/20/2009
# Tags: phoenix-port
#----------------------------------------------------------------------
"""parse.py is a utility that allows... | |
42,445 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/wx/py/path.py | 18,19 | 1,37 | ls | 19,33 | 19,33 | """path.py is a utility containing some very simple path utilities for Py to use"""
__author__ = "David N. Mashburn <david.n.mashburn@gmail.com>"
# 07/01/2009
import os
import glob
import subprocess
def pwd():
print(os.getcwd())
def cd(path,usePrint=True):
os.chdir(os.path.expandvars(os.path.expanduser(path... | """path.py is a utility containing some very simple path utilities for Py to use"""
__author__ = "David N. Mashburn <david.n.mashburn@gmail.com>"
# 07/01/2009
import os
import glob
import subprocess
def pwd():
print(os.getcwd())
def cd(path,usePrint=True):
os.chdir(os.path.expandvars(os.path.expanduser(path... | g=glob.glob(os.path.expandvars(os.path.expanduser(str)))
if fullpath:
for i in g:
print(i)
else:
for i in g:
print(os.path.split(i)[1])
# This prints the results of running a command in the GUI shell but be warned!
# This is a blocking call, and if you open any kind ... | g=glob.glob(os.path.expandvars(os.path.expanduser(str)))
if fullpath:
for i in g:
print(i)
else:
for i in g:
print(os.path.split(i)[1])
# This prints the results of running a command in the GUI shell but be warned!
# This is a blocking call, and if you open any kind ... | 83 | 192 | 167 | 359 | """path.py is a utility containing some very simple path utilities for Py to use"""
__author__ = "David N. Mashburn <david.n.mashburn@gmail.com>"
# 07/01/2009
import os
import glob
import subprocess
def pwd():
print(os.getcwd())
def cd(path,usePrint=True):
os.chdir(os.path.expandvars(os.path.expanduser(path... | """path.py is a utility containing some very simple path utilities for Py to use"""
__author__ = "David N. Mashburn <david.n.mashburn@gmail.com>"
# 07/01/2009
import os
import glob
import subprocess
def pwd():
print(os.getcwd())
def cd(path,usePrint=True):
os.chdir(os.path.expandvars(os.path.expanduser(path... | |
42,446 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/wx/py/pseudo.py | 54,55 | 42,64 | writelines | PseudoFile | 55,57 | 55,57 | class PseudoFile:
def __init__(self):
"""Create a file-like object."""
pass
def readline(self):
pass
def write(self, s):
pass
def writelines(self, l):
FILL_FUNC_BODY def flush(self):
pass
def isatty(self):
pass
| class PseudoFile:
def __init__(self):
"""Create a file-like object."""
pass
def readline(self):
pass
def write(self, s):
pass
def writelines(self, l):
FILL_FUNC_BODY def flush(self):
pass
def isatty(self):
pass
| map(self.write, l)
| map(self.write, l)
| 2 | 100 | 13 | 113 | """Provides a variety of classes to create pseudo keywords and pseudo files."""
__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
class PseudoKeyword:
"""A callable class that calls a method passed as a parameter.
Good for creating a pseudo keyword in the python runtime
environment. The keyword is... | """Provides a variety of classes to create pseudo keywords and pseudo files."""
__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
class PseudoKeyword:
"""A callable class that calls a method passed as a parameter.
Good for creating a pseudo keyword in the python runtime
environment. The keyword is... |
42,447 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/wx/py/pseudo.py | 98,99 | 90,100 | isatty | PseudoFileErr | 99,100 | 99,100 | class PseudoFileErr(PseudoFile):
def __init__(self, write):
if callable(write):
self.write = write
else:
raise ValueError('write must be callable')
def isatty(self):
FILL_FUNC_BODY | class PseudoFileErr(PseudoFile):
def __init__(self, write):
if callable(write):
self.write = write
else:
raise ValueError('write must be callable')
def isatty(self):
FILL_FUNC_BODY | return 1
| return 1
| 2 | 75 | 6 | 81 | """Provides a variety of classes to create pseudo keywords and pseudo files."""
__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
class PseudoKeyword:
"""A callable class that calls a method passed as a parameter.
Good for creating a pseudo keyword in the python runtime
environment. The keyword is... | """Provides a variety of classes to create pseudo keywords and pseudo files."""
__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
class PseudoKeyword:
"""A callable class that calls a method passed as a parameter.
Good for creating a pseudo keyword in the python runtime
environment. The keyword is... |
42,448 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/wx/py/pseudo.py | 74,75 | 64,78 | isatty | PseudoFileIn | 75,78 | 75,78 | class PseudoFileIn(PseudoFile):
def __init__(self, readline, readlines=None):
if callable(readline):
self.readline = readline
else:
raise ValueError('readline must be callable')
if callable(readlines):
self.readlines = readlines
def isatty(self):
FIL... | class PseudoFileIn(PseudoFile):
def __init__(self, readline, readlines=None):
if callable(readline):
self.readline = readline
else:
raise ValueError('readline must be callable')
if callable(readlines):
self.readlines = readlines
def isatty(self):
FIL... | return 1
| return 1
| 2 | 103 | 10 | 113 | """Provides a variety of classes to create pseudo keywords and pseudo files."""
__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
class PseudoKeyword:
"""A callable class that calls a method passed as a parameter.
Good for creating a pseudo keyword in the python runtime
environment. The keyword is... | """Provides a variety of classes to create pseudo keywords and pseudo files."""
__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
class PseudoKeyword:
"""A callable class that calls a method passed as a parameter.
Good for creating a pseudo keyword in the python runtime
environment. The keyword is... |
42,449 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/wx/py/pseudo.py | 86,87 | 78,90 | isatty | PseudoFileOut | 87,90 | 87,90 | class PseudoFileOut(PseudoFile):
def __init__(self, write):
if callable(write):
self.write = write
else:
raise ValueError('write must be callable')
def isatty(self):
FILL_FUNC_BODY | class PseudoFileOut(PseudoFile):
def __init__(self, write):
if callable(write):
self.write = write
else:
raise ValueError('write must be callable')
def isatty(self):
FILL_FUNC_BODY | return 1
| return 1
| 2 | 75 | 10 | 85 | """Provides a variety of classes to create pseudo keywords and pseudo files."""
__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
class PseudoKeyword:
"""A callable class that calls a method passed as a parameter.
Good for creating a pseudo keyword in the python runtime
environment. The keyword is... | """Provides a variety of classes to create pseudo keywords and pseudo files."""
__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
class PseudoKeyword:
"""A callable class that calls a method passed as a parameter.
Good for creating a pseudo keyword in the python runtime
environment. The keyword is... |
42,450 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/wx/tools/img2img.py | 23,24 | 1,86 | convert | 24,51 | 24,51 | #----------------------------------------------------------------------
# Name: wx.tools.img2img
# Purpose: Common routines for the image converter utilities.
#
# Author: Robin Dunn
#
# Copyright: (c) 2002-2020 by Total Control Software
# Licence: wxWindows license
# Tags: phoenix-port, py3... | #----------------------------------------------------------------------
# Name: wx.tools.img2img
# Purpose: Common routines for the image converter utilities.
#
# Author: Robin Dunn
#
# Copyright: (c) 2002-2020 by Total Control Software
# Licence: wxWindows license
# Tags: phoenix-port, py3... | img = wx.Bitmap(file, wx.BITMAP_TYPE_ANY)
if not img.IsOk():
return 0, file + " failed to load!"
else:
if maskClr:
om = img.GetMask()
mask = wx.Mask(img, maskClr)
img.SetMask(mask)
if om is not None:
om.Destroy()
if outp... | img = wx.Bitmap(file, wx.BITMAP_TYPE_ANY)
if not img.IsOk():
return 0, file + " failed to load!"
else:
if maskClr:
om = img.GetMask()
mask = wx.Mask(img, maskClr)
img.SetMask(mask)
if om is not None:
om.Destroy()
if outp... | 76 | 440 | 276 | 716 | #----------------------------------------------------------------------
# Name: wx.tools.img2img
# Purpose: Common routines for the image converter utilities.
#
# Author: Robin Dunn
#
# Copyright: (c) 2002-2020 by Total Control Software
# Licence: wxWindows license
# Tags: phoenix-port, py3... | #----------------------------------------------------------------------
# Name: wx.tools.img2img
# Purpose: Common routines for the image converter utilities.
#
# Author: Robin Dunn
#
# Copyright: (c) 2002-2020 by Total Control Software
# Licence: wxWindows license
# Tags: phoenix-port, py3... | |
42,451 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/wx/tools/img2png.py | 43,44 | 1,55 | main | 44,50 | 44,50 | #----------------------------------------------------------------------
# Name: wx.tools.img2png
# Purpose: Convert an image to PNG format
#
# Author: Robin Dunn
#
# Copyright: (c) 2002-2020 by Total Control Software
# Licence: wxWindows license
#---------------------------------------------------... | #----------------------------------------------------------------------
# Name: wx.tools.img2png
# Purpose: Convert an image to PNG format
#
# Author: Robin Dunn
#
# Copyright: (c) 2002-2020 by Total Control Software
# Licence: wxWindows license
#---------------------------------------------------... | # some bitmap related things need to have a wxApp initialized...
if wx.GetApp() is None:
global app
app = wx.App()
img2img.main(sys.argv[1:], wx.BITMAP_TYPE_PNG, ".png", __doc__)
| # some bitmap related things need to have a wxApp initialized...
if wx.GetApp() is None:
global app
app = wx.App()
img2img.main(sys.argv[1:], wx.BITMAP_TYPE_PNG, ".png", __doc__)
| 24 | 361 | 78 | 439 | #----------------------------------------------------------------------
# Name: wx.tools.img2png
# Purpose: Convert an image to PNG format
#
# Author: Robin Dunn
#
# Copyright: (c) 2002-2020 by Total Control Software
# Licence: wxWindows license
#---------------------------------------------------... | #----------------------------------------------------------------------
# Name: wx.tools.img2png
# Purpose: Convert an image to PNG format
#
# Author: Robin Dunn
#
# Copyright: (c) 2002-2020 by Total Control Software
# Licence: wxWindows license
#---------------------------------------------------... | |
42,452 | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix | /home/hieuvd/dung_repo/raw/stars_02/wxWidgets_Phoenix/Phoenix/wx/tools/img2xpm.py | 42,43 | 1,55 | main | 43,50 | 43,50 | #----------------------------------------------------------------------
# Name: wx.tools.img2xpm
# Purpose: Convert an image to XPM format
#
# Author: Robin Dunn
#
# Copyright: (c) 2002-2020 by Total Control Software
# Licence: wxWindows license
#---------------------------------------------------... | #----------------------------------------------------------------------
# Name: wx.tools.img2xpm
# Purpose: Convert an image to XPM format
#
# Author: Robin Dunn
#
# Copyright: (c) 2002-2020 by Total Control Software
# Licence: wxWindows license
#---------------------------------------------------... | # some bitmap related things need to have a wxApp initialized...
if wx.GetApp() is None:
global app
app = wx.App()
img2img.main(sys.argv[1:], wx.BITMAP_TYPE_XPM, ".xpm", __doc__)
| # some bitmap related things need to have a wxApp initialized...
if wx.GetApp() is None:
global app
app = wx.App()
img2img.main(sys.argv[1:], wx.BITMAP_TYPE_XPM, ".xpm", __doc__)
| 24 | 365 | 81 | 446 | #----------------------------------------------------------------------
# Name: wx.tools.img2xpm
# Purpose: Convert an image to XPM format
#
# Author: Robin Dunn
#
# Copyright: (c) 2002-2020 by Total Control Software
# Licence: wxWindows license
#---------------------------------------------------... | #----------------------------------------------------------------------
# Name: wx.tools.img2xpm
# Purpose: Convert an image to XPM format
#
# Author: Robin Dunn
#
# Copyright: (c) 2002-2020 by Total Control Software
# Licence: wxWindows license
#---------------------------------------------------... | |
42,457 | /home/hieuvd/dung_repo/raw/stars_02/xmendez_wfuzz/wfuzz | /home/hieuvd/dung_repo/raw/stars_02/xmendez_wfuzz/wfuzz/src/wfuzz/api.py | 20,21 | 1,40 | get_payload | 21,25 | 21,25 | from .options import FuzzSession
from .facade import Facade
from .ui.console.clparser import CLParser
"""
Wfuzz API
"""
def fuzz(**kwargs):
return FuzzSession(**kwargs).fuzz()
def get_payloads(iterator):
fs = FuzzSession()
return fs.get_payloads(iterator)
def get_payload(iterator):
FILL_FUNC_BODYdef... | from .options import FuzzSession
from .facade import Facade
from .ui.console.clparser import CLParser
"""
Wfuzz API
"""
def fuzz(**kwargs):
return FuzzSession(**kwargs).fuzz()
def get_payloads(iterator):
fs = FuzzSession()
return fs.get_payloads(iterator)
def get_payload(iterator):
FILL_FUNC_BODYdef... | fs = FuzzSession()
return fs.get_payload(iterator)
| fs = FuzzSession()
return fs.get_payload(iterator)
| 5 | 243 | 26 | 269 | from .options import FuzzSession
from .facade import Facade
from .ui.console.clparser import CLParser
"""
Wfuzz API
"""
def fuzz(**kwargs):
return FuzzSession(**kwargs).fuzz()
def get_payloads(iterator):
fs = FuzzSession()
return fs.get_payloads(iterator)
def get_payload(iterator):
FILL_FUNC_BODYdef... | from .options import FuzzSession
from .facade import Facade
from .ui.console.clparser import CLParser
"""
Wfuzz API
"""
def fuzz(**kwargs):
return FuzzSession(**kwargs).fuzz()
def get_payloads(iterator):
fs = FuzzSession()
return fs.get_payloads(iterator)
def get_payload(iterator):
FILL_FUNC_BODYdef... | |
42,458 | /home/hieuvd/dung_repo/raw/stars_02/xmendez_wfuzz/wfuzz | /home/hieuvd/dung_repo/raw/stars_02/xmendez_wfuzz/wfuzz/src/wfuzz/core.py | 120,121 | 27,135 | stats | Fuzzer | 121,127 | 121,127 | class Fuzzer(object):
def __init__(self, options):
# Create queues
# genReq ---> seed_queue -> [slice_queue] -> http_queue/dryrun -> [round_robin -> plugins_queue] * N
# -> [recursive_queue -> routing_queue] -> [filter_queue] -> [save_queue] -> [printer_queue] ---> results
self.opti... | class Fuzzer(object):
def __init__(self, options):
# Create queues
# genReq ---> seed_queue -> [slice_queue] -> http_queue/dryrun -> [round_robin -> plugins_queue] * N
# -> [recursive_queue -> routing_queue] -> [filter_queue] -> [save_queue] -> [printer_queue] ---> results
self.opti... | return dict(
list(self.qmanager.get_stats().items())
+ list(self.qmanager["transport_queue"].http_pool.job_stats().items())
+ list(self.options.stats.get_stats().items())
)
| return dict(
list(self.qmanager.get_stats().items())
+ list(self.qmanager["transport_queue"].http_pool.job_stats().items())
+ list(self.options.stats.get_stats().items())
)
| 8 | 1,080 | 71 | 1,151 | from .fuzzobjects import FuzzType
from .myqueues import MyPriorityQueue, QueueManager
from .fuzzqueues import (
SeedQ,
SaveQ,
PrinterQ,
RoutingQ,
FilterQ,
SliceQ,
JobQ,
RecursiveQ,
DryRunQ,
HttpQueue,
HttpReceiver,
AllVarQ,
CLIPrinterQ,
ConsolePrinterQ,
PassP... | from .fuzzobjects import FuzzType
from .myqueues import MyPriorityQueue, QueueManager
from .fuzzqueues import (
SeedQ,
SaveQ,
PrinterQ,
RoutingQ,
FilterQ,
SliceQ,
JobQ,
RecursiveQ,
DryRunQ,
HttpQueue,
HttpReceiver,
AllVarQ,
CLIPrinterQ,
ConsolePrinterQ,
PassP... |
42,459 | /home/hieuvd/dung_repo/raw/stars_02/xmendez_wfuzz/wfuzz | /home/hieuvd/dung_repo/raw/stars_02/xmendez_wfuzz/wfuzz/src/wfuzz/dictionaries.py | 168,169 | 160,177 | width | AllVarDictio | 169,171 | 169,171 | class AllVarDictio(BaseDictionary, BaseIterator):
def __init__(self, iterator, allvar_len):
self._it = iter(iterator)
self._count = allvar_len
def count(self):
return self._count
def width(self):
FILL_FUNC_BODY def payloads(self):
return []
def next_word(self):
... | class AllVarDictio(BaseDictionary, BaseIterator):
def __init__(self, iterator, allvar_len):
self._it = iter(iterator)
self._count = allvar_len
def count(self):
return self._count
def width(self):
FILL_FUNC_BODY def payloads(self):
return []
def next_word(self):
... | return 0
| return 0
| 2 | 145 | 8 | 153 | from .exception import FuzzExceptNoPluginError, FuzzExceptBadOptions
from .facade import Facade
from .filters.ppfilter import FuzzResFilterSlice, FuzzResFilter
from .fuzzobjects import FuzzWord, FuzzWordType
class BaseIterator:
def count(self):
raise NotImplementedError
def width(self):
raise... | from .exception import FuzzExceptNoPluginError, FuzzExceptBadOptions
from .facade import Facade
from .filters.ppfilter import FuzzResFilterSlice, FuzzResFilter
from .fuzzobjects import FuzzWord, FuzzWordType
class BaseIterator:
def count(self):
raise NotImplementedError
def width(self):
raise... |
42,460 | /home/hieuvd/dung_repo/raw/stars_02/xmendez_wfuzz/wfuzz | /home/hieuvd/dung_repo/raw/stars_02/xmendez_wfuzz/wfuzz/src/wfuzz/dictionaries.py | 26,27 | 22,39 | next_word | BaseDictionary | 27,29 | 27,29 | class BaseDictionary:
def count(self):
raise NotImplementedError
def next_word(self):
FILL_FUNC_BODY def __next__(self):
return self.next_word()
def __iter__(self):
return self
def close(self):
pass
| class BaseDictionary:
def count(self):
raise NotImplementedError
def next_word(self):
FILL_FUNC_BODY def __next__(self):
return self.next_word()
def __iter__(self):
return self
def close(self):
pass
| raise NotImplementedError
| raise NotImplementedError
| 2 | 83 | 11 | 94 | from .exception import FuzzExceptNoPluginError, FuzzExceptBadOptions
from .facade import Facade
from .filters.ppfilter import FuzzResFilterSlice, FuzzResFilter
from .fuzzobjects import FuzzWord, FuzzWordType
class BaseIterator:
def count(self):
raise NotImplementedError
def width(self):
raise... | from .exception import FuzzExceptNoPluginError, FuzzExceptBadOptions
from .facade import Facade
from .filters.ppfilter import FuzzResFilterSlice, FuzzResFilter
from .fuzzobjects import FuzzWord, FuzzWordType
class BaseIterator:
def count(self):
raise NotImplementedError
def width(self):
raise... |
42,461 | /home/hieuvd/dung_repo/raw/stars_02/xmendez_wfuzz/wfuzz | /home/hieuvd/dung_repo/raw/stars_02/xmendez_wfuzz/wfuzz/src/wfuzz/dictionaries.py | 17,18 | 7,22 | cleanup | BaseIterator | 18,22 | 18,22 | class BaseIterator:
def count(self):
raise NotImplementedError
def width(self):
raise NotImplementedError
def payloads(self):
raise NotImplementedError
def cleanup(self):
FILL_FUNC_BODY | class BaseIterator:
def count(self):
raise NotImplementedError
def width(self):
raise NotImplementedError
def payloads(self):
raise NotImplementedError
def cleanup(self):
FILL_FUNC_BODY | for payload in self.payloads():
payload.close()
| for payload in self.payloads():
payload.close()
| 5 | 72 | 23 | 95 | from .exception import FuzzExceptNoPluginError, FuzzExceptBadOptions
from .facade import Facade
from .filters.ppfilter import FuzzResFilterSlice, FuzzResFilter
from .fuzzobjects import FuzzWord, FuzzWordType
class BaseIterator:
def count(self):
raise NotImplementedError
def width(self):
raise... | from .exception import FuzzExceptNoPluginError, FuzzExceptBadOptions
from .facade import Facade
from .filters.ppfilter import FuzzResFilterSlice, FuzzResFilter
from .fuzzobjects import FuzzWord, FuzzWordType
class BaseIterator:
def count(self):
raise NotImplementedError
def width(self):
raise... |
42,462 | /home/hieuvd/dung_repo/raw/stars_02/xmendez_wfuzz/wfuzz | /home/hieuvd/dung_repo/raw/stars_02/xmendez_wfuzz/wfuzz/src/wfuzz/dictionaries.py | 71,72 | 39,89 | _gen | EncodeIt | 72,85 | 72,85 | class EncodeIt(BaseDictionary):
def __init__(self, parent, encoders_list):
self.parent = parent
self.encoders = encoders_list
self.__generator = self._gen()
def count(self):
return self.parent.count() * len(self.encoders)
def concatenate(self, encoder_name, payload_word):
... | class EncodeIt(BaseDictionary):
def __init__(self, parent, encoders_list):
self.parent = parent
self.encoders = encoders_list
self.__generator = self._gen()
def count(self):
return self.parent.count() * len(self.encoders)
def concatenate(self, encoder_name, payload_word):
... | while 1:
try:
payload_word = next(self.parent)
except StopIteration:
return
for encoder_name in self.encoders:
if encoder_name.find("@") > 0:
yield self.concatenate(encoder_name, payload_word)
... | while 1:
try:
payload_word = next(self.parent)
except StopIteration:
return
for encoder_name in self.encoders:
if encoder_name.find("@") > 0:
yield self.concatenate(encoder_name, payload_word)
... | 28 | 355 | 118 | 473 | from .exception import FuzzExceptNoPluginError, FuzzExceptBadOptions
from .facade import Facade
from .filters.ppfilter import FuzzResFilterSlice, FuzzResFilter
from .fuzzobjects import FuzzWord, FuzzWordType
class BaseIterator:
def count(self):
raise NotImplementedError
def width(self):
raise... | from .exception import FuzzExceptNoPluginError, FuzzExceptBadOptions
from .facade import Facade
from .filters.ppfilter import FuzzResFilterSlice, FuzzResFilter
from .fuzzobjects import FuzzWord, FuzzWordType
class BaseIterator:
def count(self):
raise NotImplementedError
def width(self):
raise... |
42,463 | /home/hieuvd/dung_repo/raw/stars_02/xmendez_wfuzz/wfuzz | /home/hieuvd/dung_repo/raw/stars_02/xmendez_wfuzz/wfuzz/src/wfuzz/dictionaries.py | 132,133 | 120,160 | _get_filtered_value | SliceIt | 133,140 | 133,140 | class SliceIt(BaseDictionary):
def __init__(self, payload, slicestr):
self.ffilter = FuzzResFilter(filter_string=slicestr)
self.ffilter_slice = FuzzResFilterSlice(filter_string=slicestr)
self.payload = payload
def count(self):
return -1
def get_type(self):
return se... | class SliceIt(BaseDictionary):
def __init__(self, payload, slicestr):
self.ffilter = FuzzResFilter(filter_string=slicestr)
self.ffilter_slice = FuzzResFilterSlice(filter_string=slicestr)
self.payload = payload
def count(self):
return -1
def get_type(self):
return se... | if item.type == FuzzWordType.FUZZRES:
filter_ret = self.ffilter.is_visible(item.content)
else:
filter_ret = self.ffilter_slice.is_visible(item.content)
return filter_ret
| if item.type == FuzzWordType.FUZZRES:
filter_ret = self.ffilter.is_visible(item.content)
else:
filter_ret = self.ffilter_slice.is_visible(item.content)
return filter_ret
| 13 | 337 | 78 | 415 | from .exception import FuzzExceptNoPluginError, FuzzExceptBadOptions
from .facade import Facade
from .filters.ppfilter import FuzzResFilterSlice, FuzzResFilter
from .fuzzobjects import FuzzWord, FuzzWordType
class BaseIterator:
def count(self):
raise NotImplementedError
def width(self):
raise... | from .exception import FuzzExceptNoPluginError, FuzzExceptBadOptions
from .facade import Facade
from .filters.ppfilter import FuzzResFilterSlice, FuzzResFilter
from .fuzzobjects import FuzzWord, FuzzWordType
class BaseIterator:
def count(self):
raise NotImplementedError
def width(self):
raise... |
42,464 | /home/hieuvd/dung_repo/raw/stars_02/xmendez_wfuzz/wfuzz | /home/hieuvd/dung_repo/raw/stars_02/xmendez_wfuzz/wfuzz/src/wfuzz/dictionaries.py | 93,94 | 89,106 | count | TupleIt | 94,96 | 94,96 | class TupleIt(BaseDictionary, BaseIterator):
def __init__(self, parent):
self.parent = parent
def count(self):
FILL_FUNC_BODY def width(self):
return 1
def payloads(self):
return [self.parent]
def next_word(self):
return (next(self.parent),)
| class TupleIt(BaseDictionary, BaseIterator):
def __init__(self, parent):
self.parent = parent
def count(self):
FILL_FUNC_BODY def width(self):
return 1
def payloads(self):
return [self.parent]
def next_word(self):
return (next(self.parent),)
| return self.parent.count()
| return self.parent.count()
| 2 | 99 | 12 | 111 | from .exception import FuzzExceptNoPluginError, FuzzExceptBadOptions
from .facade import Facade
from .filters.ppfilter import FuzzResFilterSlice, FuzzResFilter
from .fuzzobjects import FuzzWord, FuzzWordType
class BaseIterator:
def count(self):
raise NotImplementedError
def width(self):
raise... | from .exception import FuzzExceptNoPluginError, FuzzExceptBadOptions
from .facade import Facade
from .filters.ppfilter import FuzzResFilterSlice, FuzzResFilter
from .fuzzobjects import FuzzWord, FuzzWordType
class BaseIterator:
def count(self):
raise NotImplementedError
def width(self):
raise... |
42,465 | /home/hieuvd/dung_repo/raw/stars_02/xmendez_wfuzz/wfuzz | /home/hieuvd/dung_repo/raw/stars_02/xmendez_wfuzz/wfuzz/src/wfuzz/dictionaries.py | 116,117 | 106,120 | next_word | WrapperIt | 117,120 | 117,120 | class WrapperIt(BaseDictionary):
def __init__(self, iterator):
self._it = iter(iterator)
def count(self):
return -1
def get_type(self):
return FuzzWordType.WORD
def next_word(self):
FILL_FUNC_BODY | class WrapperIt(BaseDictionary):
def __init__(self, iterator):
self._it = iter(iterator)
def count(self):
return -1
def get_type(self):
return FuzzWordType.WORD
def next_word(self):
FILL_FUNC_BODY | return FuzzWord(str(next(self._it)), FuzzWordType.WORD)
| return FuzzWord(str(next(self._it)), FuzzWordType.WORD)
| 3 | 83 | 27 | 110 | from .exception import FuzzExceptNoPluginError, FuzzExceptBadOptions
from .facade import Facade
from .filters.ppfilter import FuzzResFilterSlice, FuzzResFilter
from .fuzzobjects import FuzzWord, FuzzWordType
class BaseIterator:
def count(self):
raise NotImplementedError
def width(self):
raise... | from .exception import FuzzExceptNoPluginError, FuzzExceptBadOptions
from .facade import Facade
from .filters.ppfilter import FuzzResFilterSlice, FuzzResFilter
from .fuzzobjects import FuzzWord, FuzzWordType
class BaseIterator:
def count(self):
raise NotImplementedError
def width(self):
raise... |
42,466 | /home/hieuvd/dung_repo/raw/stars_02/xmendez_wfuzz/wfuzz | /home/hieuvd/dung_repo/raw/stars_02/xmendez_wfuzz/wfuzz/src/wfuzz/externals/moduleman/loader.py | 101,102 | 96,162 | set_params | DirLoader | 102,112 | 102,112 | class DirLoader(FileLoader):
def __init__(self, **params):
FileLoader.__init__(self, **params)
self.__logger = logging.getLogger("libraries.DirLoader")
def set_params(self, **params):
FILL_FUNC_BODY def load(self, registrant):
self.module_registrant = registrant
self.structur... | class DirLoader(FileLoader):
def __init__(self, **params):
FileLoader.__init__(self, **params)
self.__logger = logging.getLogger("libraries.DirLoader")
def set_params(self, **params):
FILL_FUNC_BODY def load(self, registrant):
self.module_registrant = registrant
self.structur... | if "base_dir" not in params:
return
elif "base_path" not in params:
return
self.base_dir = params["base_dir"]
self.base_path = params["base_path"]
if self.base_path.endswith("/"):
self.base_path = self.base_path[:-1]
| if "base_dir" not in params:
return
elif "base_path" not in params:
return
self.base_dir = params["base_dir"]
self.base_path = params["base_path"]
if self.base_path.endswith("/"):
self.base_path = self.base_path[:-1]
| 23 | 570 | 102 | 672 | import inspect
import logging
import imp
import os.path
class IModuleLoader:
def __init__(self, **params):
self.set_params(**params)
def set_params(self, **params):
raise NotImplementedError
def load(self, registrant):
raise NotImplementedError
class FileLoader(IModuleLoader):
... | import inspect
import logging
import imp
import os.path
class IModuleLoader:
def __init__(self, **params):
self.set_params(**params)
def set_params(self, **params):
raise NotImplementedError
def load(self, registrant):
raise NotImplementedError
class FileLoader(IModuleLoader):
... |
42,467 | /home/hieuvd/dung_repo/raw/stars_02/xmendez_wfuzz/wfuzz | /home/hieuvd/dung_repo/raw/stars_02/xmendez_wfuzz/wfuzz/src/wfuzz/externals/moduleman/loader.py | 49,50 | 18,96 | _load_py_from_file | FileLoader | 53,96 | 50,96 | class FileLoader(IModuleLoader):
def __init__(self, **params):
IModuleLoader.__init__(self, **params)
self.__logger = logging.getLogger("libraries.FileLoader")
def set_params(self, **params):
if "base_path" not in params:
return
elif "filename" not in params:
... | class FileLoader(IModuleLoader):
def __init__(self, **params):
IModuleLoader.__init__(self, **params)
self.__logger = logging.getLogger("libraries.FileLoader")
def set_params(self, **params):
if "base_path" not in params:
return
elif "filename" not in params:
... | self.__logger.debug("__load_py_from_file. START, file=%s" % (filename,))
dirname, filename = os.path.split(filename)
fn = os.path.splitext(filename)[0]
exten_file = None
module = None
try:
exten_file, filename, description = imp.find_module(fn, [dirname])
... | """
Opens "filename", inspects it and calls the registrant
"""
self.__logger.debug("__load_py_from_file. START, file=%s" % (filename,))
dirname, filename = os.path.split(filename)
fn = os.path.splitext(filename)[0]
exten_file = None
module = None
... | 113 | 340 | 475 | 815 | import inspect
import logging
import imp
import os.path
class IModuleLoader:
def __init__(self, **params):
self.set_params(**params)
def set_params(self, **params):
raise NotImplementedError
def load(self, registrant):
raise NotImplementedError
class FileLoader(IModuleLoader):
... | import inspect
import logging
import imp
import os.path
class IModuleLoader:
def __init__(self, **params):
self.set_params(**params)
def set_params(self, **params):
raise NotImplementedError
def load(self, registrant):
raise NotImplementedError
class FileLoader(IModuleLoader):
... |
42,468 | /home/hieuvd/dung_repo/raw/stars_02/xmendez_wfuzz/wfuzz | /home/hieuvd/dung_repo/raw/stars_02/xmendez_wfuzz/wfuzz/src/wfuzz/externals/moduleman/loader.py | 11,12 | 7,18 | set_params | IModuleLoader | 12,14 | 12,14 | class IModuleLoader:
def __init__(self, **params):
self.set_params(**params)
def set_params(self, **params):
FILL_FUNC_BODY def load(self, registrant):
raise NotImplementedError
| class IModuleLoader:
def __init__(self, **params):
self.set_params(**params)
def set_params(self, **params):
FILL_FUNC_BODY def load(self, registrant):
raise NotImplementedError
| raise NotImplementedError
| raise NotImplementedError
| 2 | 71 | 11 | 82 | import inspect
import logging
import imp
import os.path
class IModuleLoader:
def __init__(self, **params):
self.set_params(**params)
def set_params(self, **params):
FILL_FUNC_BODY def load(self, registrant):
raise NotImplementedError
class FileLoader(IModuleLoader):
def __init__(self... | import inspect
import logging
import imp
import os.path
class IModuleLoader:
def __init__(self, **params):
self.set_params(**params)
def set_params(self, **params):
FILL_FUNC_BODY def load(self, registrant):
raise NotImplementedError
class FileLoader(IModuleLoader):
def __init__(self... |
42,469 | /home/hieuvd/dung_repo/raw/stars_02/xmendez_wfuzz/wfuzz | /home/hieuvd/dung_repo/raw/stars_02/xmendez_wfuzz/wfuzz/src/wfuzz/externals/moduleman/modulefilter.py | 87,88 | 46,136 | __myreduce | Filter | 88,97 | 88,97 | class Filter(IFilter):
def __init__(self):
if PYPARSING:
category = Word(alphas + "_-*", alphanums + "_-*")
operator = oneOf("and or ,")
neg_operator = "not"
elementRef = category
definition = elementRef + ZeroOrMore(operator + elementRef)
... | class Filter(IFilter):
def __init__(self):
if PYPARSING:
category = Word(alphas + "_-*", alphanums + "_-*")
operator = oneOf("and or ,")
neg_operator = "not"
elementRef = category
definition = elementRef + ZeroOrMore(operator + elementRef)
... | first = elements[0]
for i in range(1, len(elements), 2):
if elements[i] == "and":
first = first and elements[i + 1]
elif elements[i] == "or" or elements[i] == ",":
first = first or elements[i + 1]
return first
| first = elements[0]
for i in range(1, len(elements), 2):
if elements[i] == "and":
first = first and elements[i + 1]
elif elements[i] == "or" or elements[i] == ",":
first = first or elements[i + 1]
return first
| 37 | 810 | 94 | 904 | # mimicking nmap script filter
# nmap --script "http-*"
# Loads all scripts whose name starts with http-, such as http-auth and http-open-proxy. The argument to --script had to be in quotes to protect the wildcard from the shell.
# not valid for categories!
#
# More complicated script selection can be done using... | # mimicking nmap script filter
# nmap --script "http-*"
# Loads all scripts whose name starts with http-, such as http-auth and http-open-proxy. The argument to --script had to be in quotes to protect the wildcard from the shell.
# not valid for categories!
#
# More complicated script selection can be done using... |
42,470 | /home/hieuvd/dung_repo/raw/stars_02/xmendez_wfuzz/wfuzz | /home/hieuvd/dung_repo/raw/stars_02/xmendez_wfuzz/wfuzz/src/wfuzz/externals/moduleman/modulefilter.py | 42,43 | 41,46 | is_visible | IFilter | 43,46 | 43,46 | class IFilter:
def is_visible(self, plugin, filter_string):
FILL_FUNC_BODY | class IFilter:
def is_visible(self, plugin, filter_string):
FILL_FUNC_BODY | raise NotImplementedError
| raise NotImplementedError
| 2 | 30 | 13 | 43 | # mimicking nmap script filter
# nmap --script "http-*"
# Loads all scripts whose name starts with http-, such as http-auth and http-open-proxy. The argument to --script had to be in quotes to protect the wildcard from the shell.
# not valid for categories!
#
# More complicated script selection can be done using... | # mimicking nmap script filter
# nmap --script "http-*"
# Loads all scripts whose name starts with http-, such as http-auth and http-open-proxy. The argument to --script had to be in quotes to protect the wildcard from the shell.
# not valid for categories!
#
# More complicated script selection can be done using... |
42,471 | /home/hieuvd/dung_repo/raw/stars_02/xmendez_wfuzz/wfuzz | /home/hieuvd/dung_repo/raw/stars_02/xmendez_wfuzz/wfuzz/src/wfuzz/externals/moduleman/plugin.py | 7,8 | 1,23 | moduleman_plugin | 8,23 | 8,23 | try:
from collections.abc import Callable
except ImportError:
from collections import Callable
def moduleman_plugin(*args):
FILL_FUNC_BODY | try:
from collections.abc import Callable
except ImportError:
from collections import Callable
def moduleman_plugin(*args):
FILL_FUNC_BODY | method_args = []
def inner_decorator(cls):
for method in method_args:
if not (method in dir(cls)):
raise Exception("Required method %s not implemented" % method)
cls.__PLUGIN_MODULEMAN_MARK = "Plugin mark"
return cls
if not isinstance(args[0], Callable)... | method_args = []
def inner_decorator(cls):
for method in method_args:
if not (method in dir(cls)):
raise Exception("Required method %s not implemented" % method)
cls.__PLUGIN_MODULEMAN_MARK = "Plugin mark"
return cls
if not isinstance(args[0], Callable)... | 39 | 45 | 136 | 181 | try:
from collections.abc import Callable
except ImportError:
from collections import Callable
def moduleman_plugin(*args):
FILL_FUNC_BODY | try:
from collections.abc import Callable
except ImportError:
from collections import Callable
def moduleman_plugin(*args):
FILL_FUNC_BODY | |
42,472 | /home/hieuvd/dung_repo/raw/stars_02/xmendez_wfuzz/wfuzz | /home/hieuvd/dung_repo/raw/stars_02/xmendez_wfuzz/wfuzz/src/wfuzz/externals/moduleman/registrant.py | 160,161 | 65,167 | get_plugins_names | BRegistrant | 161,163 | 161,163 | class BRegistrant(IRegistrant):
def __init__(self, loader, plg_filter=Filter()):
self.__plugins = {}
self.__active_plugins = {}
self.kbase = KnowledgeBase()
IRegistrant.__init__(self, loader, plg_filter)
def register(self, identifier, module):
self.__plugins[identifier]... | class BRegistrant(IRegistrant):
def __init__(self, loader, plg_filter=Filter()):
self.__plugins = {}
self.__active_plugins = {}
self.kbase = KnowledgeBase()
IRegistrant.__init__(self, loader, plg_filter)
def register(self, identifier, module):
self.__plugins[identifier]... | return [plg.name for plg_id, plg in self.__get_plugins(category, sorting)]
| return [plg.name for plg_id, plg in self.__get_plugins(category, sorting)]
| 8 | 867 | 31 | 898 | from .modulefilter import Filter
from collections import defaultdict
try:
from collections.abc import MutableMapping
except ImportError:
from collections import MutableMapping
from threading import Lock
class IRegistrant:
def __init__(self, loader, plg_filter):
self.plg_filter = plg_filter
... | from .modulefilter import Filter
from collections import defaultdict
try:
from collections.abc import MutableMapping
except ImportError:
from collections import MutableMapping
from threading import Lock
class IRegistrant:
def __init__(self, loader, plg_filter):
self.plg_filter = plg_filter
... |
42,473 | /home/hieuvd/dung_repo/raw/stars_02/xmendez_wfuzz/wfuzz | /home/hieuvd/dung_repo/raw/stars_02/xmendez_wfuzz/wfuzz/src/wfuzz/externals/moduleman/registrant.py | 20,21 | 11,36 | register | IRegistrant | 21,23 | 21,23 | class IRegistrant:
def __init__(self, loader, plg_filter):
self.plg_filter = plg_filter
self.loader = loader
self.start_loading()
self.load()
self.end_loading()
def register(self, identifier, module):
FILL_FUNC_BODY def start_loading(self):
raise NotImplement... | class IRegistrant:
def __init__(self, loader, plg_filter):
self.plg_filter = plg_filter
self.loader = loader
self.start_loading()
self.load()
self.end_loading()
def register(self, identifier, module):
FILL_FUNC_BODY def start_loading(self):
raise NotImplement... | raise NotImplementedError
| raise NotImplementedError
| 2 | 160 | 11 | 171 | from .modulefilter import Filter
from collections import defaultdict
try:
from collections.abc import MutableMapping
except ImportError:
from collections import MutableMapping
from threading import Lock
class IRegistrant:
def __init__(self, loader, plg_filter):
self.plg_filter = plg_filter
... | from .modulefilter import Filter
from collections import defaultdict
try:
from collections.abc import MutableMapping
except ImportError:
from collections import MutableMapping
from threading import Lock
class IRegistrant:
def __init__(self, loader, plg_filter):
self.plg_filter = plg_filter
... |
42,474 | /home/hieuvd/dung_repo/raw/stars_02/xmendez_wfuzz/wfuzz | /home/hieuvd/dung_repo/raw/stars_02/xmendez_wfuzz/wfuzz/src/wfuzz/externals/moduleman/registrant.py | 168,169 | 167,171 | load | MulRegistrant | 169,171 | 169,171 | class MulRegistrant(BRegistrant):
def load(self):
FILL_FUNC_BODY | class MulRegistrant(BRegistrant):
def load(self):
FILL_FUNC_BODY | for loader in self.loader:
loader.load(self)
| for loader in self.loader:
loader.load(self)
| 5 | 30 | 19 | 49 | from .modulefilter import Filter
from collections import defaultdict
try:
from collections.abc import MutableMapping
except ImportError:
from collections import MutableMapping
from threading import Lock
class IRegistrant:
def __init__(self, loader, plg_filter):
self.plg_filter = plg_filter
... | from .modulefilter import Filter
from collections import defaultdict
try:
from collections.abc import MutableMapping
except ImportError:
from collections import MutableMapping
from threading import Lock
class IRegistrant:
def __init__(self, loader, plg_filter):
self.plg_filter = plg_filter
... |
42,477 | /home/hieuvd/dung_repo/raw/stars_02/xmendez_wfuzz/wfuzz | /home/hieuvd/dung_repo/raw/stars_02/xmendez_wfuzz/wfuzz/src/wfuzz/externals/reqresp/Response.py | 142,143 | 56,244 | parseResponse | Response | 143,244 | 143,244 | class Response:
def __init__(self, protocol="", code="", message=""):
self.protocol = protocol # HTTP/1.1
self.code = code # 200
self.message = message # OK
self._headers = [] # bueno pues las cabeceras igual que en la request
self.__content = (
"" # contenid... | class Response:
def __init__(self, protocol="", code="", message=""):
self.protocol = protocol # HTTP/1.1
self.code = code # 200
self.message = message # OK
self._headers = [] # bueno pues las cabeceras igual que en la request
self.__content = (
"" # contenid... | self.__content = ""
self._headers = []
tp = TextParser()
tp.setSource("string", rawheader)
tp.readUntil(r"(HTTP/[0-9.]+) ([0-9]+)")
while True:
while True:
try:
self.protocol = tp[0][0]
except Exception:
... | self.__content = ""
self._headers = []
tp = TextParser()
tp.setSource("string", rawheader)
tp.readUntil(r"(HTTP/[0-9.]+) ([0-9]+)")
while True:
while True:
try:
self.protocol = tp[0][0]
except Exception:
... | 237 | 792 | 1,038 | 1,830 | import re
import cgi
from io import BytesIO
import gzip
import zlib
from .TextParser import TextParser
from wfuzz.helpers.str_func import python2_3_convert_from_unicode
def get_encoding_from_headers(headers):
"""Returns encodings from given HTTP Header Dict.
:param headers: dictionary to extract encoding ... | import re
import cgi
from io import BytesIO
import gzip
import zlib
from .TextParser import TextParser
from wfuzz.helpers.str_func import python2_3_convert_from_unicode
def get_encoding_from_headers(headers):
"""Returns encodings from given HTTP Header Dict.
:param headers: dictionary to extract encoding ... |
42,478 | /home/hieuvd/dung_repo/raw/stars_02/xmendez_wfuzz/wfuzz | /home/hieuvd/dung_repo/raw/stars_02/xmendez_wfuzz/wfuzz/src/wfuzz/externals/reqresp/TextParser.py | 119,120 | 11,151 | readLine | TextParser | 121,151 | 120,151 | class TextParser(object):
def __init__(self):
self.string = ""
self.oldindex = 0
self.newindex = 0
self.type = ""
self.lastFull_line = None
self.lastline = None
self.actualIndex = 0
def __del__(self):
if self.type == "file":
self.fd.c... | class TextParser(object):
def __init__(self):
self.string = ""
self.oldindex = 0
self.newindex = 0
self.type = ""
self.lastFull_line = None
self.lastline = None
self.actualIndex = 0
def __del__(self):
if self.type == "file":
self.fd.c... |
if self.type == "file":
self.lastFull_line = self.fd.readline()
elif self.type == "stdin":
self.lastFull_line = input()
elif self.type == "string":
if self.newindex == -1:
return 0
if self.oldindex >= 0:
self.newin... | "Lee la siguiente linea eliminando retornos de carro"
if self.type == "file":
self.lastFull_line = self.fd.readline()
elif self.type == "stdin":
self.lastFull_line = input()
elif self.type == "string":
if self.newindex == -1:
return 0
... | 87 | 910 | 322 | 1,232 | # Covered by GPL V2.0
# Coded by Carlos del Ojo Elias (deepbit@gmail.com)
import sys
import re
# python 2 and 3: iterator
from builtins import object
class TextParser(object):
def __init__(self):
self.string = ""
self.oldindex = 0
self.newindex = 0
self.type = ""
self.las... | # Covered by GPL V2.0
# Coded by Carlos del Ojo Elias (deepbit@gmail.com)
import sys
import re
# python 2 and 3: iterator
from builtins import object
class TextParser(object):
def __init__(self):
self.string = ""
self.oldindex = 0
self.newindex = 0
self.type = ""
self.las... |
42,479 | /home/hieuvd/dung_repo/raw/stars_02/xmendez_wfuzz/wfuzz | /home/hieuvd/dung_repo/raw/stars_02/xmendez_wfuzz/wfuzz/src/wfuzz/externals/reqresp/Variables.py | 21,22 | 5,28 | append | Variable | 22,24 | 22,24 | class Variable:
def __init__(self, name, value="", extraInfo=""):
self.name = name
self.value = value
self.initValue = value
self.extraInfo = extraInfo
def restore(self):
self.value = self.initValue
def change(self, newval):
self.initValue = self.value = new... | class Variable:
def __init__(self, name, value="", extraInfo=""):
self.name = name
self.value = value
self.initValue = value
self.extraInfo = extraInfo
def restore(self):
self.value = self.initValue
def change(self, newval):
self.initValue = self.value = new... | self.value += val
| self.value += val
| 3 | 165 | 10 | 175 | from .TextParser import TextParser
import json
class Variable:
def __init__(self, name, value="", extraInfo=""):
self.name = name
self.value = value
self.initValue = value
self.extraInfo = extraInfo
def restore(self):
self.value = self.initValue
def change(self, n... | from .TextParser import TextParser
import json
class Variable:
def __init__(self, name, value="", extraInfo=""):
self.name = name
self.value = value
self.initValue = value
self.extraInfo = extraInfo
def restore(self):
self.value = self.initValue
def change(self, n... |
42,480 | /home/hieuvd/dung_repo/raw/stars_02/xmendez_wfuzz/wfuzz | /home/hieuvd/dung_repo/raw/stars_02/xmendez_wfuzz/wfuzz/src/wfuzz/externals/reqresp/Variables.py | 109,110 | 28,142 | parseMultipart | VariablesSet | 110,142 | 110,142 | class VariablesSet:
def __init__(self):
self.variables = []
self.boundary = None
def names(self):
dicc = []
for i in self.variables:
dicc.append(i.name)
return dicc
def existsVar(self, name):
return name in self.names()
def addVariable(self... | class VariablesSet:
def __init__(self):
self.variables = []
self.boundary = None
def names(self):
dicc = []
for i in self.variables:
dicc.append(i.name)
return dicc
def existsVar(self, name):
return name in self.names()
def addVariable(self... | self.boundary = boundary
dicc = []
tp = TextParser()
tp.setSource("string", cad)
while True:
headers = []
if not tp.readUntil('name="([^"]+)"'):
break
var = tp[0][0]
headers.append(tp.lastFull_line.strip())
... | self.boundary = boundary
dicc = []
tp = TextParser()
tp.setSource("string", cad)
while True:
headers = []
if not tp.readUntil('name="([^"]+)"'):
break
var = tp[0][0]
headers.append(tp.lastFull_line.strip())
... | 60 | 733 | 280 | 1,013 | from .TextParser import TextParser
import json
class Variable:
def __init__(self, name, value="", extraInfo=""):
self.name = name
self.value = value
self.initValue = value
self.extraInfo = extraInfo
def restore(self):
self.value = self.initValue
def change(self, n... | from .TextParser import TextParser
import json
class Variable:
def __init__(self, name, value="", extraInfo=""):
self.name = name
self.value = value
self.initValue = value
self.extraInfo = extraInfo
def restore(self):
self.value = self.initValue
def change(self, n... |
42,481 | /home/hieuvd/dung_repo/raw/stars_02/xmendez_wfuzz/wfuzz | /home/hieuvd/dung_repo/raw/stars_02/xmendez_wfuzz/wfuzz/src/wfuzz/externals/reqresp/cache.py | 22,23 | 4,26 | msg_in_cache | HttpCache | 23,26 | 23,26 | class HttpCache:
def __init__(self):
# cache control
self.__cache_map = defaultdict(list)
def update_cache(self, req, category="default"):
key = req.to_cache_key()
# first hit
if key not in self.__cache_map:
self.__cache_map[key].append(category)
... | class HttpCache:
def __init__(self):
# cache control
self.__cache_map = defaultdict(list)
def update_cache(self, req, category="default"):
key = req.to_cache_key()
# first hit
if key not in self.__cache_map:
self.__cache_map[key].append(category)
... | key = req.to_cache_key()
return key in self.__cache_map and category in self.__cache_map[key]
| key = req.to_cache_key()
return key in self.__cache_map and category in self.__cache_map[key]
| 11 | 172 | 37 | 209 | from collections import defaultdict
class HttpCache:
def __init__(self):
# cache control
self.__cache_map = defaultdict(list)
def update_cache(self, req, category="default"):
key = req.to_cache_key()
# first hit
if key not in self.__cache_map:
self.__cache... | from collections import defaultdict
class HttpCache:
def __init__(self):
# cache control
self.__cache_map = defaultdict(list)
def update_cache(self, req, category="default"):
key = req.to_cache_key()
# first hit
if key not in self.__cache_map:
self.__cache... |
42,482 | /home/hieuvd/dung_repo/raw/stars_02/xmendez_wfuzz/wfuzz | /home/hieuvd/dung_repo/raw/stars_02/xmendez_wfuzz/wfuzz/src/wfuzz/externals/settings/settings.py | 75,76 | 10,103 | set_all | SettingsBase | 76,82 | 76,82 | class SettingsBase:
"""
Contains application settings. uses a ConfigParser
"""
def __init__(self, save=False):
self.cparser = ConfigParser()
self.set_all(self.set_defaults())
self.filename = os.path.join(
self._path_to_program_dir(), self.get_config_file()
)... | class SettingsBase:
"""
Contains application settings. uses a ConfigParser
"""
def __init__(self, save=False):
self.cparser = ConfigParser()
self.set_all(self.set_defaults())
self.filename = os.path.join(
self._path_to_program_dir(), self.get_config_file()
)... | self.cparser = ConfigParser()
for section, settings in sett.items():
self.cparser.add_section(section)
for key, value in settings:
self.cparser.set(section, key, value)
| self.cparser = ConfigParser()
for section, settings in sett.items():
self.cparser.add_section(section)
for key, value in settings:
self.cparser.set(section, key, value)
| 17 | 637 | 65 | 702 | # Python 2 and 3 (after ``pip install configparser``):
try:
from configparser import ConfigParser
except ImportError:
import ConfigParser
import os
import sys
class SettingsBase:
"""
Contains application settings. uses a ConfigParser
"""
def __init__(self, save=False):
self.cparser = ... | # Python 2 and 3 (after ``pip install configparser``):
try:
from configparser import ConfigParser
except ImportError:
import ConfigParser
import os
import sys
class SettingsBase:
"""
Contains application settings. uses a ConfigParser
"""
def __init__(self, save=False):
self.cparser = ... |
42,483 | /home/hieuvd/dung_repo/raw/stars_02/xmendez_wfuzz/wfuzz | /home/hieuvd/dung_repo/raw/stars_02/xmendez_wfuzz/wfuzz/src/wfuzz/facade.py | 74,75 | 65,104 | _load | Facade | 75,93 | 75,93 | class Facade(metaclass=Singleton):
def __init__(self):
self.__plugins = dict(
printers=None, scripts=None, encoders=None, iterators=None, payloads=None,
)
self.sett = Settings()
def _load(self, cat):
FILL_FUNC_BODY def proxy(self, which):
return self._load(which... | class Facade(metaclass=Singleton):
def __init__(self):
self.__plugins = dict(
printers=None, scripts=None, encoders=None, iterators=None, payloads=None,
)
self.sett = Settings()
def _load(self, cat):
FILL_FUNC_BODY def proxy(self, which):
return self._load(which... | try:
if cat not in self.__plugins:
raise FuzzExceptNoPluginError("Non-existent plugin category %s" % cat)
if not self.__plugins[cat]:
loader_list = []
loader_list.append(
DirLoader(**{"base_dir": cat, "base_path": get_p... | try:
if cat not in self.__plugins:
raise FuzzExceptNoPluginError("Non-existent plugin category %s" % cat)
if not self.__plugins[cat]:
loader_list = []
loader_list.append(
DirLoader(**{"base_dir": cat, "base_path": get_p... | 47 | 186 | 203 | 389 | from .helpers.file_func import get_home, get_path, get_config_dir
from .helpers.obj_factory import Singleton
from . import __version__ as version
from .externals.moduleman.registrant import MulRegistrant
from .externals.moduleman.loader import DirLoader
from .externals.settings.settings import SettingsBase
from .except... | from .helpers.file_func import get_home, get_path, get_config_dir
from .helpers.obj_factory import Singleton
from . import __version__ as version
from .externals.moduleman.registrant import MulRegistrant
from .externals.moduleman.loader import DirLoader
from .externals.settings.settings import SettingsBase
from .except... |
42,484 | /home/hieuvd/dung_repo/raw/stars_02/xmendez_wfuzz/wfuzz | /home/hieuvd/dung_repo/raw/stars_02/xmendez_wfuzz/wfuzz/src/wfuzz/facade.py | 56,57 | 55,65 | get_plugin | MyRegistrant | 57,65 | 57,65 | class MyRegistrant(MulRegistrant):
def get_plugin(self, identifier):
FILL_FUNC_BODY | class MyRegistrant(MulRegistrant):
def get_plugin(self, identifier):
FILL_FUNC_BODY | try:
return MulRegistrant.get_plugin(self, identifier)
except KeyError as e:
raise FuzzExceptNoPluginError(
"Requested plugin %s. Error: %s" % (identifier, str(e))
)
| try:
return MulRegistrant.get_plugin(self, identifier)
except KeyError as e:
raise FuzzExceptNoPluginError(
"Requested plugin %s. Error: %s" % (identifier, str(e))
)
| 19 | 34 | 75 | 109 | from .helpers.file_func import get_home, get_path, get_config_dir
from .helpers.obj_factory import Singleton
from . import __version__ as version
from .externals.moduleman.registrant import MulRegistrant
from .externals.moduleman.loader import DirLoader
from .externals.settings.settings import SettingsBase
from .except... | from .helpers.file_func import get_home, get_path, get_config_dir
from .helpers.obj_factory import Singleton
from . import __version__ as version
from .externals.moduleman.registrant import MulRegistrant
from .externals.moduleman.loader import DirLoader
from .externals.settings.settings import SettingsBase
from .except... |
42,485 | /home/hieuvd/dung_repo/raw/stars_02/xmendez_wfuzz/wfuzz | /home/hieuvd/dung_repo/raw/stars_02/xmendez_wfuzz/wfuzz/src/wfuzz/facade.py | 17,18 | 16,55 | get_config_file | Settings | 18,29 | 18,29 | class Settings(SettingsBase):
def get_config_file(self):
FILL_FUNC_BODY def set_defaults(self):
return dict(
plugins=[("bing_apikey", ""), ("shodan_apikey", "")],
kbase=[
(
"discovery.blacklist",
".svg-.css-.js-.jpg-.gif-.png... | class Settings(SettingsBase):
def get_config_file(self):
FILL_FUNC_BODY def set_defaults(self):
return dict(
plugins=[("bing_apikey", ""), ("shodan_apikey", "")],
kbase=[
(
"discovery.blacklist",
".svg-.css-.js-.jpg-.gif-.png... | config_file = "wfuzz.ini"
config = os.path.join(get_config_dir(check=False), config_file)
legacy_config = os.path.join(get_home(check=False), config_file)
if os.path.exists(config):
return config
elif os.path.exists(legacy_config):
return legacy_config
... | config_file = "wfuzz.ini"
config = os.path.join(get_config_dir(check=False), config_file)
legacy_config = os.path.join(get_home(check=False), config_file)
if os.path.exists(config):
return config
elif os.path.exists(legacy_config):
return legacy_config
... | 22 | 255 | 133 | 388 | from .helpers.file_func import get_home, get_path, get_config_dir
from .helpers.obj_factory import Singleton
from . import __version__ as version
from .externals.moduleman.registrant import MulRegistrant
from .externals.moduleman.loader import DirLoader
from .externals.settings.settings import SettingsBase
from .except... | from .helpers.file_func import get_home, get_path, get_config_dir
from .helpers.obj_factory import Singleton
from . import __version__ as version
from .externals.moduleman.registrant import MulRegistrant
from .externals.moduleman.loader import DirLoader
from .externals.settings.settings import SettingsBase
from .except... |
42,486 | /home/hieuvd/dung_repo/raw/stars_02/xmendez_wfuzz/wfuzz | /home/hieuvd/dung_repo/raw/stars_02/xmendez_wfuzz/wfuzz/src/wfuzz/factories/dictfactory.py | 33,35 | 32,53 | validate | BaseDictioBuilder | 35,43 | 35,43 | class BaseDictioBuilder:
@staticmethod
def validate(options, selected_dic):
FILL_FUNC_BODY @staticmethod
def get_dictio(options, selected_dic):
if len(selected_dic) == 1:
return TupleIt(selected_dic[0])
elif options["iterator"]:
return Facade().iterators.get_plugin... | class BaseDictioBuilder:
@staticmethod
def validate(options, selected_dic):
FILL_FUNC_BODY @staticmethod
def get_dictio(options, selected_dic):
if len(selected_dic) == 1:
return TupleIt(selected_dic[0])
elif options["iterator"]:
return Facade().iterators.get_plugin... | if not selected_dic:
raise FuzzExceptBadOptions("Empty dictionary! Check payload and filter")
if len(selected_dic) == 1 and options["iterator"]:
raise FuzzExceptBadOptions(
"Several dictionaries must be used when specifying an iterator"
)
| if not selected_dic:
raise FuzzExceptBadOptions("Empty dictionary! Check payload and filter")
if len(selected_dic) == 1 and options["iterator"]:
raise FuzzExceptBadOptions(
"Several dictionaries must be used when specifying an iterator"
)
| 28 | 135 | 83 | 218 | # Python 2 and 3: zip_longest
try:
from itertools import zip_longest
except ImportError:
from itertools import izip_longest as zip_longest
from ..helpers.obj_factory import ObjectFactory
from ..exception import FuzzExceptBadOptions
from ..facade import Facade
from ..dictionaries import (
TupleIt,
Wrapp... | # Python 2 and 3: zip_longest
try:
from itertools import zip_longest
except ImportError:
from itertools import izip_longest as zip_longest
from ..helpers.obj_factory import ObjectFactory
from ..exception import FuzzExceptBadOptions
from ..facade import Facade
from ..dictionaries import (
TupleIt,
Wrapp... |
42,487 | /home/hieuvd/dung_repo/raw/stars_02/xmendez_wfuzz/wfuzz | /home/hieuvd/dung_repo/raw/stars_02/xmendez_wfuzz/wfuzz/src/wfuzz/factories/dictfactory.py | 99,101 | 98,119 | from_all_fuzz_request_gen | DictioFromAllVarBuilder | 101,110 | 101,110 | class DictioFromAllVarBuilder(BaseDictioBuilder):
@staticmethod
def from_all_fuzz_request_gen(options, dictio_list):
FILL_FUNC_BODY def __call__(self, options):
dictio_list = DictioFromOptions()(options)
return AllVarDictio(
self.from_all_fuzz_request_gen(options, dictio_list),
... | class DictioFromAllVarBuilder(BaseDictioBuilder):
@staticmethod
def from_all_fuzz_request_gen(options, dictio_list):
FILL_FUNC_BODY def __call__(self, options):
dictio_list = DictioFromOptions()(options)
return AllVarDictio(
self.from_all_fuzz_request_gen(options, dictio_list),
... | for payload in dictio_list:
if len(payload) > 1:
raise FuzzExceptBadOptions(
"Only one payload is allowed when fuzzing all parameters!"
)
for var_name in options["compiled_seed"].history.wf_allvars_set.keys():
yield (va... | for payload in dictio_list:
if len(payload) > 1:
raise FuzzExceptBadOptions(
"Only one payload is allowed when fuzzing all parameters!"
)
for var_name in options["compiled_seed"].history.wf_allvars_set.keys():
yield (va... | 27 | 144 | 98 | 242 | # Python 2 and 3: zip_longest
try:
from itertools import zip_longest
except ImportError:
from itertools import izip_longest as zip_longest
from ..helpers.obj_factory import ObjectFactory
from ..exception import FuzzExceptBadOptions
from ..facade import Facade
from ..dictionaries import (
TupleIt,
Wrapp... | # Python 2 and 3: zip_longest
try:
from itertools import zip_longest
except ImportError:
from itertools import izip_longest as zip_longest
from ..helpers.obj_factory import ObjectFactory
from ..exception import FuzzExceptBadOptions
from ..facade import Facade
from ..dictionaries import (
TupleIt,
Wrapp... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.