Esempio n. 1
0
 def splitChanged(self, index):
     "This is heavy : we need to refetch everything"
     self.options.split = split_list[index]
     if index == 0:
         # disable maxcaptions
         self.cwui.maxcaptionSpinBox.setEnabled(False)
         self.cwui.maxcaptionsLabel.setEnabled(False)
     else:
         # enable maxcaptions
         self.cwui.maxcaptionSpinBox.setEnabled(True)
         self.cwui.maxcaptionsLabel.setEnabled(True)
     self.dates = collect_data(self.repo.changelog, self.options)
     self.redraw()
Esempio n. 2
0
 def splitChanged(self, index):
     "This is heavy : we need to refetch everything"
     self.options.split = split_list[index]
     if index == 0:
         # disable maxcaptions
         self.cwui.maxcaptionSpinBox.setEnabled(False)
         self.cwui.maxcaptionsLabel.setEnabled(False)
     else:
         # enable maxcaptions
         self.cwui.maxcaptionSpinBox.setEnabled(True)
         self.cwui.maxcaptionsLabel.setEnabled(True)
     self.dates = collect_data(self.repo.changelog, self.options)
     self.redraw()
Esempio n. 3
0
def login_salon():
    data = request.get_json(force=True)
    print(data)
    response = collect_data(data, engine)
    return response
import sys
from data import collect_data

if __name__ == "__main__":
    apoint = sys.argv[1]
    duration = int(sys.argv[2])
    print("started collecting data")
    collect_data(apoint, duration)
    print("finished collecting data")
Esempio n. 5
0
 def timerangeChanged(self):
     "This is heavy : we need to refetch everything"
     index = self.cwui.timerangeComboBox.currentIndex()
     self.timerangeUpdate(index)
     self.dates = collect_data(self.repo.changelog, self.options)
     self.redraw()
Esempio n. 6
0
 def uselinesChanged(self, value):
     "This is heavy : we need to refetch everything"
     self.options.uselines = not not value
     self.dates = collect_data(self.repo.changelog, self.options)
     self.redraw()
Esempio n. 7
0
 def timerangeChanged(self):
     "This is heavy : we need to refetch everything"
     index = self.cwui.timerangeComboBox.currentIndex()
     self.timerangeUpdate(index)
     self.dates = collect_data(self.repo.changelog, self.options)
     self.redraw()
Esempio n. 8
0
 def uselinesChanged(self, value):
     "This is heavy : we need to refetch everything"
     self.options.uselines = not not value
     self.dates = collect_data(self.repo.changelog, self.options)
     self.redraw()
Esempio n. 9
0
def activity(ui, repo, **opts):
    # The doc string below will show up in 'hg activity --help'
    """
    Create a file called activity.png displaying the activity of the current
    repository

    By default, the activity is computed using the number of commits. There
    is an option to consider instead the number of lines modified in the
    changesets (--uselines).

    Most options are self explanatory.
    The map file format used to specify aliases is fairly simple:
    <alias name>; <actual name>
    This file is only used when --split=authors is used.

    The name listed after the option --exclude are those found in the
    mercurial repository. That is, before the map file is applied.
    """
    # do it
    try:
        options = check_options(repo, opts)
        ui.write('There are %d changesets\n' % options.length)

        # do something with this data:
        if options.mode=='display':
            try:
                import matplotlib.pyplot as plt
            except:
                raise UiException('you need matplotlib in your python path in order to use the hg activity extension.')
            from draw import draw_graph

            # harvest data
            dates_tab = collect_data(repo.changelog, options)
            if len(dates_tab)<1 or not options.length:
                raise UiException('no data available with those options.')

            fig = plt.figure() 
            draw_graph(fig, options, dates_tab)
            plt.show()
        elif options.mode=='file':
            try:
                from matplotlib.figure import Figure
                from matplotlib.backends.backend_agg import FigureCanvasAgg
            except:
                raise UiException('you need matplotlib in your python path in order to use the hg activity extension.')
            from draw import draw_graph

            # harvest data
            dates_tab = collect_data(repo.changelog, options)
            if len(dates_tab)<1 or not options.length:
                raise UiException('no data available with those options.')

            fig = Figure()
            canvas = FigureCanvasAgg(fig)
            draw_graph(fig, options, dates_tab)
            fig.set_dpi(100)
            fig.set_size_inches(options.width/100.0,options.height/100.0)
            canvas.print_figure(options.filename)
            ui.status('Created the file \'%s\'\n' % options.filename)
        elif options.mode=='gui':
            from mode_qt import displayQtGui
            displayQtGui(repo, options)
        else:
            raise UiException('unknown mode %s', options.mode)
            
    except UiException, error:
        from sys import exit
        ui.warn("Hg activity, checking options: %s\n" % error.message)
        exit(1)