bugged
stringlengths
4
228k
fixed
stringlengths
0
96.3M
__index_level_0__
int64
0
481k
def get_absolute_url(self): return ("grid", [self.slug])
defget_absolute_url(self):return("grid",[self.slug])
473,600
def __unicode__(self): return '%s : %s' % (self.grid.slug, self.title)
def __unicode__(self): return '%s : %s' % (self.grid.slug, self.title)
473,601
def handle(self, *args, **options):
def handle(self, *args, **options):
473,602
def handle(self, *args, **options):
def handle(self, *args, **options):
473,603
def handle(self, *args, **options): print >> stdout, "Commencing package updating now" github = Github()
def handle(self, *args, **options): print >> stdout, "Commencing package updating now" github = Github()
473,604
def save(self, *args, **kwargs): # Get the downloads from pypi if self.pypi_url: page = urlopen(self.pypi_url).read() # If the target page is an Index of packages if 'Index of Packages' in page: if self.pypi_url.endswith('/'): project_name = self.pypi_url[:-1] else: project_name = self.pypi_url project_name = os.path....
def save(self, *args, **kwargs): # Get the downloads from pypi if self.pypi_url: page = urlopen(self.pypi_url).read() # If the target page is an Index of packages if 'Index of Packages' in page: if self.pypi_url.endswith('/'): project_name = self.pypi_url[:-1] else: project_name = self.pypi_url project_name = os.path....
473,605
def __init__(self): """ Setup the serial system. """ super(GameButtons, self).__init__()
def __init__(self): """ Setup the serial system. """ super(GameButtons, self).__init__()
473,606
def __init__(self): super(GUI, self).__init__()
def __init__(self): super(GUI, self).__init__()
473,607
def on_allocation_changed(self, stage, box, flags): """ """ logging.debug("self size %d x %d and stage size %d x %d" % (self.get_width(), self.get_height(), stage.get_width(), stage.get_height())) self.clue_overlay.set_size(self.get_width(), self.get_height()) self.daily_double_overlay(self.get_width(), self.get_heigh...
def on_allocation_changed(self, stage, box, flags): """ """ logging.debug("self size %d x %d and stage size %d x %d" % (self.get_width(), self.get_height(), stage.get_width(), stage.get_height())) self.clue_overlay.set_size(self.get_width(), self.get_height()) self.daily_double_overlay.set_size(self.get_width(), self....
473,608
def set_text(self, font, text): """ """ logging.debug('called set text.') self.remove(self.text) self.text = Text(font, text) self.text.set_size(self.get_width(), self.get_height()) scale_x, scale_y = self.get_scale() print scale_x self.text.set_scale(scale_x, scale_y) self.add(self.text)
def set_text(self, font, text): """ """ self.remove(self.text) self.text = Text(font, text) self.text.set_size(self.get_width(), self.get_height()) scale_x, scale_y = self.get_scale() print scale_x self.text.set_scale(scale_x, scale_y) self.add(self.text)
473,609
def on_paint(self, actor): logging.debug("Entered clue square on_paint.") if self.clue.state == 'unanswered': self.set_text(config.clue_value_font, self.clue.get_value()) self.set_color(config.clue_value_color) elif self.clue.state == 'selected': self.set_text(config.clue_font, self.clue.answer) elif self.clue.state ==...
def on_paint(self, actor): if self.clue.state == 'unanswered': self.set_text(config.clue_value_font, self.clue.get_value()) self.set_color(config.clue_value_color) elif self.clue.state == 'selected': self.set_text(config.clue_font, self.clue.answer) elif self.clue.state == 'question': self.set_text(config.clue_font, se...
473,610
def _find_config_file(self): absolute_path = None for location in CONFIG_LOCATIONS: if os.path.isfile(location): absolute_path = path return absolute_path
def _find_config_file(self): absolute_path = None for location in CONFIG_LOCATIONS: if os.path.isfile(location): absolute_path = location return absolute_path
473,611
def on_click(self, actor, event): """ """ logging.debug("Clue square click! state = %s" % self.clue.state) if self.clue.state == 'unanswered': self.clue.state = 'selected' logging.debug("Clue answer = %s" % self.clue.get_answer()) self.set_text('')
def on_click(self, actor, event): """ """ logging.debug("Clue square click! state = %s" % self.clue.state) if self.clue.state == 'unanswered': self.clue.state = 'selected' logging.debug("Clue answer = %s" % self.clue.get_answer()) self.set_text('')
473,612
def __init__(self): super(IdleBox, self).__init__(clutter.FlowLayout(clutter.FLOW_VERTICAL))
def __init__(self): super(IdleBox, self).__init__(clutter.FlowLayout(clutter.FLOW_VERTICAL))
473,613
def set_size(self, width, height): super(IdleBox, self).set_size(width, height) self.game_board.set_size(width, height) self.game_board.set_scale(0.6, 0.6)
def set_size(self, width, height): super(IdleBox, self).set_size(width, height) self.game_board.set_size(width, height) self.game_board.set_scale(0.6, 0.6)
473,614
def set_text(self, text): """ """ self.remove(self.text) self.text = Text(config.player_overlay_font, text) self.add(self.text)
def set_text(self, text): """ """ self.remove(self.text) self.text = Text(config.player_overlay_font, text) self.add(self.text)
473,615
def __init__(self): super(GUI, self).__init__()
def __init__(self): super(GUI, self).__init__()
473,616
def __init__(self): super(GUI, self).__init__()
def __init__(self): super(GUI, self).__init__()
473,617
def on_allocation_changed(self, stage, box, flags): """ """ logging.debug("self size %d x %d and stage size %d x %d" % (self.get_width(), self.get_height(), stage.get_width(), stage.get_height())) self.clue_overlay.set_size(self.get_width(), self.get_height()) self.daily_double_overlay.set_size(self.get_width(), self....
def on_allocation_changed(self, stage, box, flags): """ """ logging.debug("self size %d x %d and stage size %d x %d" % (self.get_width(), self.get_height(), stage.get_width(), stage.get_height())) self.clue_overlay.set_size(self.get_width(), self.get_height()) self.daily_double_overlay.set_size(self.get_width(), self....
473,618
def update(self): """ Update the GUI based on the current state of the game. """ if game.check_update_game_board(): self.remove(self.game_board) self.game_board = GameBoard() self.game_board.set_size(self.get_width(), self.get_height()) self.add(self.game_board) self.game_board.lower_bottom() if game.check_timeout_beep...
def update(self): """ Update the GUI based on the current state of the game. """ if game.check_update_game_board(): self.board_box.remove(self.game_board) self.game_board = GameBoard() self.game_board.set_size(self.get_width(), self.get_height()) self.add(self.game_board) self.game_board.lower_bottom() if game.check_ti...
473,619
def update(self): """ Update the GUI based on the current state of the game. """ if game.check_update_game_board(): self.remove(self.game_board) self.game_board = GameBoard() self.game_board.set_size(self.get_width(), self.get_height()) self.add(self.game_board) self.game_board.lower_bottom() if game.check_timeout_beep...
def update(self): """ Update the GUI based on the current state of the game. """ if game.check_update_game_board(): self.remove(self.game_board) self.game_board = GameBoard() self.board_box.add(self.game_board) if config.display_player_scores: self.game_board.set_size(0.9 * self.get_width(), self.get_height()) else: se...
473,620
def __init__(self, model): super(GameBoard, self).__init__(clutter.BoxLayout())
def __init__(self, model): super(GameBoard, self).__init__(clutter.BoxLayout())
473,621
def set_click_handler(self, click_handler): """ """ for category in self.categories: category.set_click_handler(click_handler)
def set_click_handler(self, click_handler): """ """ for category in self.categories: category.set_click_handler(click_handler)
473,622
def get_player_index(self, player): """ Given a player return that player's index. """ self.players.index(player)
def get_player_index(self, player): """ Given a player return that player's index. """ self.players.index(player)
473,623
def nextInt(self, n = None): """ Return a random int in [0, `n`).
def nextInt(self, n = None): """ Return a random int in [0, `n`).
473,624
def nextInt(self, n = None): """ Return a random int in [0, `n`).
def nextInt(self, n = None): """ Return a random int in [0, `n`).
473,625
def nextBoolean(self): """ Return a random bool. """
def nextBoolean(self): """ Return a random bool. """
473,626
def nextFloat(self): """ Return a random float in (0, 1).
def nextFloat(self): """ Return a random float in (0, 1).
473,627
def nextDouble(self): """ Return a random float in (0, 1). """
def nextDouble(self): """ Return a random float in (0, 1). """
473,628
def nextLong(self): """ Return a random long.
def nextLong(self): """ Return a random long.
473,629
def _getPartyStatus(self, now, nextEvents): firstEvent = self.context.getFirstEvent(self.request) lastEvent = self.context.getLastEvent(self.request)
def _getPartyStatus(self, now, nextEvents): firstEvent = self.context.getFirstEvent(self.request) lastEvent = self.context.getLastEvent(self.request)
473,630
def _initialize(config): cls = NoneLocation_cls cls.priority = config.defaultLocationPriority clshideUntil = datetime.timedelta(seconds=config.defaultHideTime)
def _initialize(config): cls = NoneLocation_cls cls.priority = config.defaultLocationPriority clshideUntil = datetime.timedelta(seconds=config.defaultHideTime)
473,631
def reinit (self) : """Restart scheduler from 0 """ self._scheduler._tasks = list(self._initial_state) #TODO hack pabo self._current_step = 0 self._gen = scheduler.run() if self._init_func is not None : self._init_func()
def reinit (self) : """Restart scheduler from 0 """ self._scheduler._tasks = list(self._initial_state) #TODO hack pabo self._current_step = 0 self._gen = self._scheduler.run() if self._init_func is not None : self._init_func()
473,632
def __call__(self, inputs): """ inputs is the list of input values """ import copy return (copy.copy(inputs[0]), )
def __call__(self, inputs): """ inputs is the list of input values """ import copy return (copy.copy(inputs[0]), )
473,633
def bounding_box (mask) : """Compute the bounding box of a mask :Parameters: - `mask` (array of bool) - a nd array of booleans :Returns: a slice (ind_min,ind_max) for each dimension of the mask or None if the mask do not contain any True value. Where ind_min correspond to the first slice that contains a True value an...
def bounding_box (mask) : """Compute the bounding box of a mask :Parameters: - `mask` (array of bool) - a nd array of booleans :Returns: a slice (ind_min,ind_max) for each dimension of the mask or None if the mask do not contain any True value. Where ind_min correspond to the first slice that contains a True value an...
473,634
def bounding_box (mask) : """Compute the bounding box of a mask :Parameters: - `mask` (array of bool) - a nd array of booleans :Returns: a slice (ind_min,ind_max) for each dimension of the mask or None if the mask do not contain any True value. Where ind_min correspond to the first slice that contains a True value an...
def bounding_box (mask) : """Compute the bounding box of a mask :Parameters: - `mask` (array of bool) - a nd array of booleans :Returns: a slice (ind_min,ind_max) for each dimension of the mask or None if the mask do not contain any True value. Where ind_min correspond to the first slice that contains a True value an...
473,635
def flatten (img_list) : """Concatenate all images into a single image Use alpha to blend images one on top of each other .. warning:: all images must have the same shape either 2D or 3D and an alpha channel .. warning:: the resulting image has no alpha channel :Parameters: - `img_list` (list of NxM(xP)x4 array of ...
def flatten (img_list, alpha = False) : """Concatenate all images into a single image Use alpha to blend images one on top of each other .. warning:: all images must have the same shape either 2D or 3D and an alpha channel .. warning:: the resulting image has no alpha channel :Parameters: - `img_list` (list of NxM(...
473,636
def flatten (img_list) : """Concatenate all images into a single image Use alpha to blend images one on top of each other .. warning:: all images must have the same shape either 2D or 3D and an alpha channel .. warning:: the resulting image has no alpha channel :Parameters: - `img_list` (list of NxM(xP)x4 array of ...
def flatten (img_list) : """Concatenate all images into a single image Use alpha to blend images one on top of each other .. warning:: all images must have the same nD shape and an alpha channel (except maybe for the first one) If alpha is True, the resulting image will use the max of all alpha channels as an alpha ...
473,637
def flatten (img_list) : """Concatenate all images into a single image Use alpha to blend images one on top of each other .. warning:: all images must have the same shape either 2D or 3D and an alpha channel .. warning:: the resulting image has no alpha channel :Parameters: - `img_list` (list of NxM(xP)x4 array of ...
def flatten (img_list) : """Concatenate all images into a single image Use alpha to blend images one on top of each other .. warning:: all images must have the same shape either 2D or 3D and an alpha channel .. warning:: the resulting image has no alpha channel :Parameters: - `img_list` (list of NxM(xP)x4 array of ...
473,638
def flatten (img_list) : """Concatenate all images into a single image Use alpha to blend images one on top of each other .. warning:: all images must have the same shape either 2D or 3D and an alpha channel .. warning:: the resulting image has no alpha channel :Parameters: - `img_list` (list of NxM(xP)x4 array of ...
def flatten (img_list) : """Concatenate all images into a single image Use alpha to blend images one on top of each other .. warning:: all images must have the same shape either 2D or 3D and an alpha channel .. warning:: the resulting image has no alpha channel :Parameters: - `img_list` (list of NxM(xP)x4 array of ...
473,639
def set_method_name(self, name): instance = self.get_input(0) if instance and name: meth = getattr(instance, name, None) if meth: sig = Signature(meth) inputs = sig.get_all_parameters() prefix = str(instance) if len(prefix)>15: prefix = prefix[:5]+"..."+prefix[-5:] self.set_caption(prefix+" : "+name) self.internal_data...
def set_method_name(self, name): instance = self.get_input(0) if instance is not None and name is not None: meth = getattr(instance, name, None) if meth: sig = Signature(meth) inputs = sig.get_all_parameters() prefix = str(instance) if len(prefix)>15: prefix = prefix[:5]+"..."+prefix[-5:] self.set_caption(prefix+" : "+...
473,640
def set_method_name(self, name): instance = self.get_input(0) if instance and name: meth = getattr(instance, name, None) if meth: sig = Signature(meth) inputs = sig.get_all_parameters() prefix = str(instance) if len(prefix)>15: prefix = prefix[:5]+"..."+prefix[-5:] self.set_caption(prefix+" : "+name) self.internal_data...
def set_method_name(self, name): instance = self.get_input(0) if instance and name: meth = getattr(instance, name, None) if meth: sig = Signature(meth) inputs = sig.get_all_parameters() prefix = type(instance).__name__ if not hasattr(instance, "__name__") \ else instance.__name__ if len(prefix)>15: prefix = prefix[:5]+...
473,641
def transform (self, transfo) : """Combine a transformation with the actual transformation of this element. :Parameters: - `transfo` (:class:`SVGTransform`) """ self._transform = self._transform * transfo
def transform (self, transfo) : """Combine a transformation with the actual transformation of this element. :Parameters: - `transfo` (:class:`SVGTransform`) """ self._transform = transfo * self._transform
473,642
def translate (self, dx, dy) : """Combine a translation with the actual transformation of this element. :Parameters: - `dx` (float) - x displacement - `dy` (float) - y displacement """ self._transform = self._transform * translation(dx,dy)
def translate (self, dx, dy) : """Combine a translation with the actual transformation of this element. :Parameters: - `dx` (float) - x displacement - `dy` (float) - y displacement """ self._transform = translation(dx,dy) * self._transform
473,643
def rotate (self, angle) : """Combine a rotation with the actual transformation of this element. :Parameters: - `angle` (float) - angle of the rotation around Oz in direct orientation. """ self._transform = self._transform * rotation(angle)
def rotate (self, angle) : """Combine a rotation with the actual transformation of this element. :Parameters: - `angle` (float) - angle of the rotation around Oz in direct orientation. """ self._transform = rotation(angle) * self._transform
473,644
def scale (self, sx, sy) : """Combine a scaling with the actual transformation of this element. :Parameters: - `sx` (float) - x scaling - `sy` (float) - y scaling """ self._transform = self._transform * scaling(sx,sy)
def scale (self, sx, sy) : """Combine a scaling with the actual transformation of this element. :Parameters: - `sx` (float) - x scaling - `sy` (float) - y scaling """ self._transform = scaling(sx,sy) * self._transform
473,645
def _validate_md5(egg_name, data): if egg_name in md5_data: digest = md5(data).hexdigest() if digest != md5_data[egg_name]: print >>sys.stderr, ( "md5 validation of %s failed! (Possible download problem?)" % egg_name ) sys.exit(2) return data
def _validate_md5(egg_name, data): if egg_name in md5_data: digest = md5(data).hexdigest() if digest != md5_data[egg_name]: print >>sys.stderr, ( "md5 validation of %s failed! (Possible download problem?)" % egg_name ) sys.exit(2) return data
473,646
def __init__(self): """init docstring""" from pylab import plot Node.__init__(self) YLabel.__init__(self) XLabel.__init__(self) Title.__init__(self) #self.__doc__+=plot.__doc__
def __init__(self): """init docstring""" from pylab import plot Node.__init__(self) YLabel.__init__(self) XLabel.__init__(self) Title.__init__(self) #self.__doc__+=plot.__doc__
473,647
def __call__(self, inputs): from pylab import figure, plot, show, clf, xlabel, ylabel, hold, title, grid, Line2D, legend, axes xinputs = self.get_input("x") yinputs = self.get_input("y") clf() #figure(**self.get_input('figure')) kwds = {} kwds['markersize']=self.get_input("markersize") kwds['marker']=markers[self.get_...
def __call__(self, inputs): from pylab import figure, plot, show, clf, xlabel, ylabel, hold, title, grid, Line2D, legend, axes xinputs = self.get_input("x") yinputs = self.get_input("y") clf() #figure(**self.get_input('figure')) kwds = {} kwds['markersize']=self.get_input("markersize") kwds['marker']=markers[self.get_...
473,648
def __call__(self, inputs): from pylab import figure, plot, show, clf, xlabel, ylabel, hold, title, grid, Line2D, legend, axes xinputs = self.get_input("x") yinputs = self.get_input("y") clf() #figure(**self.get_input('figure')) kwds = {} kwds['markersize']=self.get_input("markersize") kwds['marker']=markers[self.get_...
def __call__(self, inputs): from pylab import figure, plot, show, clf, xlabel, ylabel, hold, title, grid, Line2D, legend, axes xinputs = self.get_input("x") yinputs = self.get_input("y") clf() #figure(**self.get_input('figure')) kwds = {} kwds['markersize']=self.get_input("markersize") kwds['marker']=markers[self.get_...
473,649
def __call__(self, inputs): from pylab import figure, plot, show, clf, xlabel, ylabel, hold, title, grid, Line2D, legend, axes xinputs = self.get_input("x") yinputs = self.get_input("y") clf() #figure(**self.get_input('figure')) kwds = {} kwds['markersize']=self.get_input("markersize") kwds['marker']=markers[self.get_...
def __call__(self, inputs): from pylab import figure, plot, show, clf, xlabel, ylabel, hold, title, grid, Line2D, legend, axes xinputs = self.get_input("x") yinputs = self.get_input("y") clf() #figure(**self.get_input('figure')) kwds = {} kwds['markersize']=self.get_input("markersize") kwds['marker']=markers[self.get_...
473,650
def __call__(self, inputs): from pylab import figure, plot, show, clf, xlabel, ylabel, hold, title, grid, Line2D, legend, axes xinputs = self.get_input("x") yinputs = self.get_input("y") clf() #figure(**self.get_input('figure')) kwds = {} kwds['markersize']=self.get_input("markersize") kwds['marker']=markers[self.get_...
def __call__(self, inputs): from pylab import figure, plot, show, clf, xlabel, ylabel, hold, title, grid, Line2D, legend, axes xinputs = self.get_input("x") yinputs = self.get_input("y") clf() #figure(**self.get_input('figure')) kwds = {} kwds['markersize']=self.get_input("markersize") kwds['marker']=markers[self.get_...
473,651
def __init__(self): Node.__init__(self) self.add_input(name="legend on", interface=IBool, value=False) self.add_input(name="legend", interface=IStr, value=None)
def __init__(self): Node.__init__(self) self.add_input(name="legend on", interface=IBool, value=False) self.add_input(name="legend", interface=IStr, value=None)
473,652
def __call__(self, inputs): from pylab import legend if self.get_input('legend') is None: legend(loc='best') else: legend(self.get_input('legend'), loc='best')
def __call__(self, inputs): from pylab import legend if self.get_input('legend') is None: legend(loc='best') else: legend(self.get_input('legend'), loc='best')
473,653
def __init__(self): #from pylab import figure #self.__doc__+=figure.__doc__ Node.__init__(self) self.add_input(name="num", interface=IInt, value=1) self.add_input(name="figsize", interface=ITuple3, value=(8, 6)) self.add_input(name="dpi", interface=IFloat, value=80.) self.add_input(name="facecolor", interface=IEnumStr(...
def __init__(self): #from pylab import figure #self.__doc__+=figure.__doc__ Node.__init__(self) self.add_input(name="num", interface=IInt, value=1) self.add_input(name="figsize", interface=ITuple3, value=(8, 6)) self.add_input(name="dpi", interface=IFloat, value=80.) self.add_input(name="facecolor", interface=IEnumStr(...
473,654
def __init__(self): #from pylab import figure #self.__doc__+=figure.__doc__ Node.__init__(self) self.add_input(name="num", interface=IInt, value=1) self.add_input(name="figsize", interface=ITuple3, value=(8, 6)) self.add_input(name="dpi", interface=IFloat, value=80.) self.add_input(name="facecolor", interface=IEnumStr(...
def __init__(self): #from pylab import figure #self.__doc__+=figure.__doc__ Node.__init__(self) self.add_input(name="num", interface=IInt, value=1) self.add_input(name="figsize", interface=ITuple3, value=(8, 6)) self.add_input(name="dpi", interface=IFloat, value=80.) self.add_input(name="facecolor", interface=IEnumStr(...
473,655
def __call__(self, inputs): from pylab import figure kwds={} kwds['num']=self.get_input('num') kwds['figsize']=self.get_input('figsize') kwds['facecolor']=self.get_input('facecolor') kwds['edgecolor']=self.get_input('edgecolor') kwds['dpi']=self.get_input('dpi')
def __call__(self, inputs): from pylab import figure kwds={} kwds['num']=self.get_input('num') kwds['figsize']=self.get_input('figsize') kwds['facecolor']=self.get_input('facecolor') kwds['edgecolor']=self.get_input('edgecolor') kwds['dpi']=self.get_input('dpi')
473,656
def welcome_setup(): revision = __revision__.strip().split() if len(revision) > 2: revision = revision[2] else: revision = '0.8' print "Running ez_alea_setup version %s" % revision print """
def welcome_setup(): try: revision = __revision__.strip().split() if len(revision) > 2: revision = revision[2] else: revision = '0.8' print "Running ez_alea_setup version %s" % revision except: pass print """
473,657
def welcome_setup(): print "Running ez_alea_setup version %s" % __revision__.split()[2] print """
def welcome_setup(): revision = __revision__.strip().split() if len(revision) > 2: revision = revision[2] else: revision = '0.8' print "Running ez_alea_setup version %s" % revision print """
473,658
def check_policy(flicense, llicense, library, static, issue): # is the lib dynamic or static? ltype = 'Dynamic' if static: ltype = 'Static' # it's possible that the license assigned to the target or library is one of # the aliases, in which case we need the 'official' name for the policy check pllicense = llicense # w...
def check_policy(flicense, llicense, library, static, issue): # is the lib dynamic or static? ltype = 'Dynamic' if static: ltype = 'Static' # it's possible that the license assigned to the target or library is one of # the aliases, in which case we need the 'official' name for the policy check pllicense = llicense # w...
473,659
def flag_policy_issue(value, status): # to highlight the issues tag_start = '<span class="' tag_mid = '">' tag_end = '</span>' tcolor = "yellow" if status == 'A': tcolor = "green" if status == 'D': tcolor = "red" tag_end += '<img src="/site_media/images/red_flag.png" width="16" height="16" alt="red_flag.png">' value = ...
def flag_policy_issue(value, status): # to highlight the issues tag_start = '<span class="' tag_mid = '">' tag_end = '</span>' tcolor = '' if status == 'U': tcolor = 'orange' tag_end += '<img src="/site_media/images/orange_flag.png" width="16" height="16" alt="orange_flag.png">' if status == 'D': tcolor = "red" tag_end...
473,660
def flag_policy_issue(value, status): # to highlight the issues tag_start = '<span class="' tag_mid = '">' tag_end = '</span>' tcolor = "yellow" if status == 'A': tcolor = "green" if status == 'D': tcolor = "red" tag_end += '<img src="/site_media/images/red_flag.png" width="16" height="16" alt="red_flag.png">' value = ...
def flag_policy_issue(value, status): # to highlight the issues tag_start = '<span class="' tag_mid = '">' tag_end = '</span>' tcolor = "yellow" if status == 'A': tcolor = "green" if status == 'D': tcolor = 'red' tag_end += '<img src="/site_media/images/red_flag.png" width="16" height="16" alt="red_flag.png">' value = ...
473,661
def check_policy(flicense, llicense, library, static, issue): # is the lib dynamic or static? ltype = 'Dynamic' if static: ltype = 'Static' # it's possible that the license assigned to the target or library is one of # the aliases, in which case we need the 'official' name for the policy check pllicense = llicense # w...
def check_policy(flicense, llicense, library, static, issue): # is the lib dynamic or static? ltype = 'Dynamic' if static: ltype = 'Static' # it's possible that the license assigned to the target or library is one of # the aliases, in which case we need the 'official' name for the policy check pllicense = llicense # w...
473,662
def check_policy(flicense, llicense, library, static, issue): # is the lib dynamic or static? ltype = 'Dynamic' if static: ltype = 'Static' # it's possible that the license assigned to the target or library is one of # the aliases, in which case we need the 'official' name for the policy check pllicense = llicense # w...
def check_policy(flicense, llicense, library, static, issue): # is the lib dynamic or static? ltype = 'Dynamic' if static: ltype = 'Static' # it's possible that the license assigned to the target or library is one of # the aliases, in which case we need the 'official' name for the policy check pllicense = llicense # w...
473,663
def check_policy(flicense, llicense, library, static, issue): # is the lib dynamic or static? ltype = 'Dynamic' if static: ltype = 'Static' # it's possible that the license assigned to the target or library is one of # the aliases, in which case we need the 'official' name for the policy check pllicense = llicense # w...
def check_policy(flicense, llicense, library, static, issue): # is the lib dynamic or static? ltype = 'Dynamic' if static: ltype = 'Static' # it's possible that the license assigned to the target or library is one of # the aliases, in which case we need the 'official' name for the policy check pllicense = llicense # w...
473,664
def check_policy(flicense, llicense, library, static, issue): # is the lib dynamic or static? ltype = 'Dynamic' if static: ltype = 'Static' # it's possible that the license assigned to the target or library is one of # the aliases, in which case we need the 'official' name for the policy check pllicense = llicense # w...
def check_policy(flicense, llicense, library, static, issue): # is the lib dynamic or static? ltype = 'Dynamic' if static: ltype = 'Static' # it's possible that the license assigned to the target or library is one of # the aliases, in which case we need the 'official' name for the policy check pllicense = llicense # w...
473,665
def flag_policy_issue(value, status): # to highlight the issues tag_start = '<font color="' tag_mid = '">' tag_end = '</font>' tcolor = "yellow" if status == 'A': tcolor = "green" if status == 'D': tcolor = "red" tag_end += '<img src="/site_media/images/red_flag.png" width="16" height="16" alt="red_flag.png">' value = ...
def flag_policy_issue(value, status): # to highlight the issues tag_start = '<span class="' tag_mid = '">' tag_end = '</font>' tcolor = "yellow" if status == 'A': tcolor = "green" if status == 'D': tcolor = "red" tag_end += '<img src="/site_media/images/red_flag.png" width="16" height="16" alt="red_flag.png">' value = ...
473,666
def flag_policy_issue(value, status): # to highlight the issues tag_start = '<font color="' tag_mid = '">' tag_end = '</font>' tcolor = "yellow" if status == 'A': tcolor = "green" if status == 'D': tcolor = "red" tag_end += '<img src="/site_media/images/red_flag.png" width="16" height="16" alt="red_flag.png">' value = ...
def flag_policy_issue(value, status): # to highlight the issues tag_start = '<font color="' tag_mid = '">' tag_end = '</span>' tcolor = "yellow" if status == 'A': tcolor = "green" if status == 'D': tcolor = "red" tag_end += '<img src="/site_media/images/red_flag.png" width="16" height="16" alt="red_flag.png">' value = ...
473,667
def dep_loop(parent, soname, dep, level): if level > depth: return if level == 1: print_path_dep(parent, soname, dep, level) print_dep(dep, level) else: print_path_dep(parent, soname, dep, level) print_dep(dep, level) target = dep_path(parent, dep) childdeps = deps_check(target) if len(childdeps) > 0: for childdep i...
def dep_loop(parent, soname, dep, level): if level > depth: return if level == 1: print_path_dep(parent, soname, dep, level) print_dep(dep, level) else: print_path_dep(parent, soname, dep, level) print_dep(dep, level) if not re.search('(static)', dep): target = dep_path(parent, dep) childdeps = deps_check(target) els...
473,668
def static_deps_check(target): "Look for statically linked dependencies." # State enumeration for debug parser. FIND_NEXT = 1 FIND_NAME = 2 # The algorithm here is pretty basic. We grab a complete symbol list # and debug information. Any symbols that aren't covered by debug # information are considered to be source...
def static_deps_check(target): "Look for statically linked dependencies." # State enumeration for debug parser. FIND_NEXT = 1 FIND_NAME = 2 # The algorithm here is pretty basic. We grab a complete symbol list # and debug information. Any symbols that aren't covered by debug # information are considered to be source...
473,669
def dep_path(target, dep): #print target, dep # readelf gives us the lib, but not the path to check during recursion ldcall = "ldd " + target for lddata in os.popen(ldcall).readlines(): if re.search("statically linked", lddata): return "NONE" elif re.search(dep, lddata): ldlist = string.split(lddata) if len(ldlist) > ...
defdep_path(target,dep):#printtarget,dep#readelfgivesusthelib,butnotthepathtocheckduringrecursionldcall="ldd"+targetforlddatainos.popen(ldcall).readlines():ifre.search("staticallylinked",lddata):return"NONE"elifre.search(dep,lddata):ldlist=string.split(lddata)iflen(ldlist)>2:#pathisthe3rdfield,usually...dpath=ldlist[2]...
473,670
def deps_check(target): deps = [] # run the "file" command and see if it's ELF filetype = os.popen("file " + target).read() if re.search("ELF", filetype): if not re.search("statically linked", filetype): elfcall = "readelf -d " + target for elfdata in os.popen(elfcall).readlines(): # lines we want all have "NEEDED" if...
def deps_check(target): deps = [] # run the "file" command and see if it's ELF filetype = os.popen("file " + target).read() if re.search("ELF", filetype): if not re.search("statically linked", filetype): elfcall = "readelf -d " + target for elfdata in os.popen(elfcall).readlines(): # lines we want all have "NEEDED" if...
473,671
def deps_check(target): deps = [] # run the "file" command and see if it's ELF filetype = os.popen("file " + target).read() if re.search("ELF", filetype): if not re.search("statically linked", filetype): elfcall = "readelf -d " + target for elfdata in os.popen(elfcall).readlines(): # lines we want all have "NEEDED" if...
def deps_check(target): deps = [] # run the "file" command and see if it's ELF filetype = os.popen("file " + target).read() if re.search("ELF", filetype): if not re.search("statically linked", filetype): elfcall = "readelf -d " + target for elfdata in os.popen(elfcall).readlines(): # lines we want all have "NEEDED" if...
473,672
def deps_print(title, parent, target, level, deps): csvstring = '' spacer = '' nospace = '' if level > 0: nospace += spacer for space in range(0, level): spacer += " " if len(deps) < 1: # FIXME - this blows up the recursion, just drop it? #deps.append("NONE") # at ld-linux - just suppress the output return if do_c...
def print_deps(target, deps): csvstring = '' spacer = '' nospace = '' if level > 0: nospace += spacer for space in range(0, level): spacer += " " if len(deps) < 1: # FIXME - this blows up the recursion, just drop it? #deps.append("NONE") # at ld-linux - just suppress the output return if do_csv: if depth == 1: cs...
473,673
def deps_print(title, parent, target, level, deps): csvstring = '' spacer = '' nospace = '' if level > 0: nospace += spacer for space in range(0, level): spacer += " " if len(deps) < 1: # FIXME - this blows up the recursion, just drop it? #deps.append("NONE") # at ld-linux - just suppress the output return if do_c...
def deps_print(title, parent, target, level, deps): csvstring = '' spacer = '' if len(deps) < 1: return if do_csv: csvstring += str(1) + "," + target for dep in deps: csvstring += "," + dep print csvstring else: print spacer + "[" + str(1) + "]" + target + ":" spacer += " " if len(deps) < 1: # FIXME - this blows u...
473,674
def deps_print(title, parent, target, level, deps): csvstring = '' spacer = '' nospace = '' if level > 0: nospace += spacer for space in range(0, level): spacer += " " if len(deps) < 1: # FIXME - this blows up the recursion, just drop it? #deps.append("NONE") # at ld-linux - just suppress the output return if do_c...
def deps_print(title, parent, target, level, deps): csvstring = '' spacer = '' nospace = '' if level > 0: nospace += spacer for space in range(0, level): spacer += " " if len(deps) < 1: # FIXME - this blows up the recursion, just drop it? #deps.append("NONE") # at ld-linux - just suppress the output return if do_c...
473,675
def deps_print(title, parent, target, level, deps): csvstring = '' spacer = '' nospace = '' if level > 0: nospace += spacer for space in range(0, level): spacer += " " if len(deps) < 1: # FIXME - this blows up the recursion, just drop it? #deps.append("NONE") # at ld-linux - just suppress the output return if do_c...
def deps_print(title, parent, target, level, deps): csvstring = '' spacer = '' nospace = '' if level > 0: nospace += spacer for space in range(0, level): spacer += " " if len(deps) < 1: # FIXME - this blows up the recursion, just drop it? #deps.append("NONE") # at ld-linux - just suppress the output return if do_c...
473,676
def main(): opt_parser = optparse.OptionParser(usage=usage_line, version="%prog version " + version, option_list=command_line_options) (options, args) = opt_parser.parse_args() if len(args) == 0 or len(args) > 2: opt_parser.error("improper number of non-option arguments") # prog_ndx_start is the offset in argv for th...
def main(): opt_parser = optparse.OptionParser(usage=usage_line, version="%prog version " + version, option_list=command_line_options) (options, args) = opt_parser.parse_args() if len(args) == 0 or len(args) > 2: opt_parser.error("improper number of non-option arguments") # prog_ndx_start is the offset in argv for th...
473,677
def main(): opt_parser = optparse.OptionParser(usage=usage_line, version="%prog version " + version, option_list=command_line_options) (options, args) = opt_parser.parse_args() if len(args) == 0 or len(args) > 2: opt_parser.error("improper number of non-option arguments") # prog_ndx_start is the offset in argv for th...
def main(): opt_parser = optparse.OptionParser(usage=usage_line, version="%prog version " + version, option_list=command_line_options) (options, args) = opt_parser.parse_args() if len(args) == 0 or len(args) > 2: opt_parser.error("improper number of non-option arguments") # prog_ndx_start is the offset in argv for th...
473,678
def main(): opt_parser = optparse.OptionParser(usage=usage_line, version="%prog version " + version, option_list=command_line_options) (options, args) = opt_parser.parse_args() if len(args) == 0 or len(args) > 2: opt_parser.error("improper number of non-option arguments") # prog_ndx_start is the offset in argv for th...
def main(): opt_parser = optparse.OptionParser(usage=usage_line, version="%prog version " + version, option_list=command_line_options) (options, args) = opt_parser.parse_args() if len(args) == 0 or len(args) > 2: opt_parser.error("improper number of non-option arguments") # prog_ndx_start is the offset in argv for th...
473,679
def main(): opt_parser = optparse.OptionParser(usage=usage_line, version="%prog version " + version, option_list=command_line_options) (options, args) = opt_parser.parse_args() if len(args) == 0 or len(args) > 2: opt_parser.error("improper number of non-option arguments") # prog_ndx_start is the offset in argv for th...
def main(): opt_parser = optparse.OptionParser(usage=usage_line, version="%prog version " + version, option_list=command_line_options) (options, args) = opt_parser.parse_args() if len(args) == 0 or len(args) > 2: opt_parser.error("improper number of non-option arguments") # prog_ndx_start is the offset in argv for th...
473,680
def main(): opt_parser = optparse.OptionParser(usage=usage_line, version="%prog version " + version, option_list=command_line_options) (options, args) = opt_parser.parse_args() if len(args) == 0 or len(args) > 2: opt_parser.error("improper number of non-option arguments") # prog_ndx_start is the offset in argv for th...
def main(): opt_parser = optparse.OptionParser(usage=usage_line, version="%prog version " + version, option_list=command_line_options) (options, args) = opt_parser.parse_args() if len(args) == 0 or len(args) > 2: opt_parser.error("improper number of non-option arguments") # prog_ndx_start is the offset in argv for th...
473,681
def deps_check(target): deps = [] # run the "file" command and see if it's ELF filetype = os.popen("file " + target).read() if re.search("ELF", filetype): if not re.search("statically linked", filetype): elfcall = "readelf -d " + target for elfdata in os.popen(elfcall).readlines(): # lines we want all have "NEEDED" if...
def deps_check(target): deps = [] # run the "file" command and see if it's ELF filetype = os.popen("file " + target).read() if re.search("ELF", filetype): if not re.search("statically linked", filetype): elfcall = "readelf -d " + target for elfdata in os.popen(elfcall).readlines(): # lines we want all have "NEEDED" if...
473,682
def __unicode__(self): return self.library
def __unicode__(self): return self.library
473,683
#def __unicode__(self):
#def __unicode__(self):
473,684
#def __unicode__(self):
#def __unicode__(self):
473,685
def results(request): if request.method == 'POST': # If the form has been submitted... testlist = request.POST.get('testlist', '') if testlist != '': tests = testlist.split(",") for test in tests: if test != '': q = Test.objects.filter(id = test) q.delete() q = File.objects.filter(test = test) q.delete() q = Lib.objec...
def results(request): if request.method == 'POST': # If the form has been submitted... testlist = request.POST.get('testlist', '') if testlist != '': tests = testlist.split(",") for test in tests: if test != '': q = Test.objects.filter(id = test) q.delete() q = File.objects.filter(test = test) q.delete() q = Lib.objec...
473,686
def licenses(request): errmsg = '' if request.method == 'POST': # If the form has been submitted... mode = urllib.unquote(request.POST.get('submit')) if re.search("^Add License", mode): licenseform = LicenseForm(request.POST) # A form bound to the POST data # request to add data if licenseform.is_valid(): # All valida...
def licenses(request): errmsg = '' if request.method == 'POST': # If the form has been submitted... mode = urllib.unquote(request.POST.get('submit')) if re.search("^Add", mode) and re.search("License", mode): licenseform = LicenseForm(request.POST) # A form bound to the POST data # request to add data if licenseform.i...
473,687
def get_project_root(): project_root_paths = [ ".", "..", "/opt/linuxfoundation" ] for path in project_root_paths: if os.path.exists(os.path.join(path, "bin/readelf.py")): return path # Shouldn't get here unless we can't find the path. raise RuntimeError, "could not find the project path"
def get_project_root(): project_root_paths = [ ".", "..", "/opt/linuxfoundation" ] for path in project_root_paths: if os.path.exists(os.path.join(path, "bin/readelf.py")): return path # Shouldn't get here unless we can't find the path. raise RuntimeError, "could not find the project path"
473,688
def check_policy(flicense, llicense, library, issue): # is the lib dynamic or static? ltype = 'Dynamic' if re.search(is_static, library): ltype = 'Static' # it's possible that the license assigned to the target or library is one of # the aliases, in which case we need the 'official' name for the policy check pllicense...
def check_policy(flicense, llicense, library, issue): # is the lib dynamic or static? ltype = 'Dynamic' if re.search(is_static, library): ltype = 'Static' # it's possible that the license assigned to the target or library is one of # the aliases, in which case we need the 'official' name for the policy check pllicense...
473,689
def main(argv): if len(argv) < 2 or '-?' in argv or '-h' in argv: show_usage(argv) # prog_ndx_start is the offset in argv for the file/dir and recursion prog_ndx_start = 1 do_search = 0 do_csv = 0 found = 0 parent = "" if '-c' in argv: sloc = string.index(argv, "-c") if prog_ndx_start <= sloc: prog_ndx_start = sloc +...
def main(argv): if len(argv) < 2 or '-?' in argv or '-h' in argv: show_usage(argv) # prog_ndx_start is the offset in argv for the file/dir and recursion prog_ndx_start = 1 do_search = 0 do_csv = 0 found = 0 parent = "" if '-c' in argv: sloc = string.index(argv, "-c") if prog_ndx_start <= sloc: prog_ndx_start = sloc +...
473,690
def start(run_browser, interface=None): if settings.USERDIR_ROOT: setup_userdir() childpid = os.fork() if childpid == 0: os.setsid() log_fn = os.path.join(settings.STATE_ROOT, "server.log") try: log_fd = os.open(log_fn, os.O_WRONLY | os.O_APPEND | os.O_CREAT) except OSError: log_fd = -1 if log_fd < 0: sys.stderr.writ...
def start_server(run_browser, interface=None): if settings.USERDIR_ROOT: setup_userdir() childpid = os.fork() if childpid == 0: os.setsid() log_fn = os.path.join(settings.STATE_ROOT, "server.log") try: log_fd = os.open(log_fn, os.O_WRONLY | os.O_APPEND | os.O_CREAT) except OSError: log_fd = -1 if log_fd < 0: sys.stde...
473,691
def stop(): pid_path = os.path.join(settings.STATE_ROOT, "server.pid") if os.path.exists(pid_path): server_pid = int(open(pid_path).read()) sys.stdout.write("Killing process %d...\n" % server_pid) try: try: os.kill(server_pid, signal.SIGTERM) finally: os.unlink(pid_path) except OSError, e: sys.stderr.write("Could not k...
def stop_server(): pid_path = os.path.join(settings.STATE_ROOT, "server.pid") if os.path.exists(pid_path): server_pid = int(open(pid_path).read()) sys.stdout.write("Killing process %d...\n" % server_pid) try: try: os.kill(server_pid, signal.SIGTERM) finally: os.unlink(pid_path) except OSError, e: sys.stderr.write("Coul...
473,692
def main(): cmdline_parser = optparse.OptionParser(usage=command_line_usage, option_list=command_line_options) (options, args) = cmdline_parser.parse_args() if len(args) != 1 or args[0] not in ["start", "stop"]: cmdline_parser.error("incorrect arguments") # Switch users if needed. if args[0] == "start": if not option...
def main(): cmdline_parser = optparse.OptionParser(usage=command_line_usage, option_list=command_line_options) (options, args) = cmdline_parser.parse_args() if len(args) != 1 or args[0] not in ["start", "stop"]: cmdline_parser.error("incorrect arguments") # Switch users if needed. if args[0] == "start": if not option...
473,693
def main(): cmdline_parser = optparse.OptionParser(usage=command_line_usage, option_list=command_line_options) (options, args) = cmdline_parser.parse_args() if len(args) != 1 or args[0] not in ["start", "stop"]: cmdline_parser.error("incorrect arguments") # Switch users if needed. if args[0] == "start": if not option...
def main(): cmdline_parser = optparse.OptionParser(usage=command_line_usage, option_list=command_line_options) (options, args) = cmdline_parser.parse_args() if len(args) != 1 or args[0] not in ["start", "stop"]: cmdline_parser.error("incorrect arguments") # Switch users if needed. if args[0] == "start": if not option...
473,694
def find_static_library(func): "Given a symbol, return the most likely static library it's from." found_lib = None dbpath = None for dp in database_search_path: if os.path.exists(os.path.join(dp, "staticdb.sqlite")): dbpath = dp break if dbpath: staticdb = sqlite3.connect(os.path.join(dbpath, "staticdb.sqlite")) curs...
def find_static_library(func): "Given a symbol, return the most likely static library it's from." found_libs = [] dbpath = None for dp in database_search_path: if os.path.exists(os.path.join(dp, "staticdb.sqlite")): dbpath = dp break if dbpath: staticdb = sqlite3.connect(os.path.join(dbpath, "staticdb.sqlite")) curso...
473,695
def find_static_library(func): "Given a symbol, return the most likely static library it's from." found_lib = None dbpath = None for dp in database_search_path: if os.path.exists(os.path.join(dp, "staticdb.sqlite")): dbpath = dp break if dbpath: staticdb = sqlite3.connect(os.path.join(dbpath, "staticdb.sqlite")) curs...
def find_static_library(func): "Given a symbol, return the most likely static library it's from." found_lib = None dbpath = None for dp in database_search_path: if os.path.exists(os.path.join(dp, "staticdb.sqlite")): dbpath = dp break if dbpath: staticdb = sqlite3.connect(os.path.join(dbpath, "staticdb.sqlite")) curs...
473,696
def find_static_library(func): "Given a symbol, return the most likely static library it's from." found_lib = None dbpath = None for dp in database_search_path: if os.path.exists(os.path.join(dp, "staticdb.sqlite")): dbpath = dp break if dbpath: staticdb = sqlite3.connect(os.path.join(dbpath, "staticdb.sqlite")) curs...
def find_static_library(func): "Given a symbol, return the most likely static library it's from." found_lib = None dbpath = None for dp in database_search_path: if os.path.exists(os.path.join(dp, "staticdb.sqlite")): dbpath = dp break if dbpath: staticdb = sqlite3.connect(os.path.join(dbpath, "staticdb.sqlite")) curs...
473,697
def static_deps_check(target): "Look for statically linked dependencies." # State enumeration for debug parser. FIND_NEXT = 1 FIND_NAME = 2 # The algorithm here is pretty basic. We grab a complete symbol list # and debug information. Any symbols that aren't covered by debug # information are considered to be source...
def static_deps_check(target): "Look for statically linked dependencies." # State enumeration for debug parser. FIND_NEXT = 1 FIND_NAME = 2 # The algorithm here is pretty basic. We grab a complete symbol list # and debug information. Any symbols that aren't covered by debug # information are considered to be source...
473,698
def static_deps_check(target): "Look for statically linked dependencies." # State enumeration for debug parser. FIND_NEXT = 1 FIND_NAME = 2 # The algorithm here is pretty basic. We grab a complete symbol list # and debug information. Any symbols that aren't covered by debug # information are considered to be source...
def static_deps_check(target): "Look for statically linked dependencies." # State enumeration for debug parser. FIND_NEXT = 1 FIND_NAME = 2 # The algorithm here is pretty basic. We grab a complete symbol list # and debug information. Any symbols that aren't covered by debug # information are considered to be source...
473,699