当前位置: 首页>>代码示例>>Python>>正文


Python Repo.stop方法代码示例

本文整理汇总了Python中repo.Repo.stop方法的典型用法代码示例。如果您正苦于以下问题:Python Repo.stop方法的具体用法?Python Repo.stop怎么用?Python Repo.stop使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在repo.Repo的用法示例。


在下文中一共展示了Repo.stop方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: Window

# 需要导入模块: from repo import Repo [as 别名]
# 或者: from repo.Repo import stop [as 别名]
class Window(QtGui.QWidget):

    def __init__(self):
        super(Window, self).__init__()

        pg.setConfigOption('background', 'w')
        pg.setConfigOption('foreground', 'k')

        # Need to put in authentication (token or user/pass)
        self.github = Github()

        print(self.github.rate_limiting)

        self.plots = []
        self.createPlots()

        self.createUI()

    def createPlots(self):
        # today = toUnix(datetime.today())
        self.layout = pg.GraphicsLayoutWidget(self)

        # Plot to show total number of open issues
        self.issuesPlot = Plot(numCurves=1,
                               title="Issues",
                               labels={'left': "Number of Issues",
                                       'bottom': "Date"},
                               axisItems={'bottom': TimeAxisItem(orientation='bottom')})
        self.layout.addItem(self.issuesPlot, row=0, col=0)
        self.issuesPlot.scene().sigMouseMoved.connect(self.issuesPlot.mouseMoved)
        self.plots.append(self.issuesPlot)

        # Plot to show total commits, classified as bugfixes or features
        self.commitsPlot = Plot(numCurves=2,
                                title="Commits",
                                labels={'left': "Number of Commits",
                                        'bottom': "Date"},
                                axisItems={'bottom': TimeAxisItem(orientation='bottom')})
        self.layout.addItem(self.commitsPlot, row=1, col=0)
        self.commitsPlot.scene().sigMouseMoved.connect(self.commitsPlot.mouseMoved)
        self.commitsPlot.link(self.issuesPlot)
        self.plots.append(self.commitsPlot)

        # Plot to show additions and deletions
        self.linesPlot = Plot(numCurves=3,
                              title="Lines of Code",
                              labels={'left': "Number of Lines",
                                      'bottom': "Date"},
                              axisItems={'bottom': TimeAxisItem(orientation='bottom')})
        self.layout.addItem(self.linesPlot, row=2, col=0)
        self.linesPlot.scene().sigMouseMoved.connect(self.linesPlot.mouseMoved)
        self.linesPlot.link(self.issuesPlot)
        self.linesPlot.link(self.commitsPlot)
        self.plots.append(self.linesPlot)

    def createUI(self):
        # Line edit for entering repository
        self.repoEdit = QtGui.QLineEdit(self)
        self.repoStart = QtGui.QPushButton("Start", self)
        self.repoStart.clicked.connect(self.createRepo)
        self.repoStop = QtGui.QPushButton("Stop", self)
        self.repoStop.clicked.connect(self.stopRepo)

        self.repoLabel = QtGui.QLabel(self)
        self.repoLabel.setText("Enter Repository:")

        # Set date range
        self.startLabel = QtGui.QLabel(self)
        self.startLabel.setText("Start Date:")
        self.startDate = QtGui.QDateTimeEdit(self)
        self.startDate.setCalendarPopup(True)
        self.startDate.setDateTime(datetime.today())
        self.startDate.setDateTimeRange(unixDt, datetime.today())
        self.startDate.dateTimeChanged.connect(self.changeStartDate)

        self.endLabel = QtGui.QLabel(self)
        self.endLabel.setText("End Date:")
        self.endDate = QtGui.QDateTimeEdit(self)
        self.endDate.setCalendarPopup(True)
        self.endDate.setDateTime(datetime.today())
        self.endDate.setDateTimeRange(unixDt, datetime.today())
        self.endDate.dateTimeChanged.connect(self.changeEndDate)

        hbox = QtGui.QHBoxLayout()
        hbox.addWidget(self.repoEdit)
        hbox.addWidget(self.repoStart)
        hbox.addWidget(self.repoStop)

        dhbox1 = QtGui.QHBoxLayout()
        dhbox1.addWidget(self.startLabel)
        dhbox1.addWidget(self.endLabel)

        dhbox2 = QtGui.QHBoxLayout()
        dhbox2.addWidget(self.startDate)
        dhbox2.addWidget(self.endDate)

        vbox = QtGui.QVBoxLayout()
        vbox.addWidget(self.repoLabel)
        vbox.addLayout(hbox)
        vbox.addLayout(dhbox1)
#.........这里部分代码省略.........
开发者ID:zrutfield,项目名称:GithubVis,代码行数:103,代码来源:gui.py


注:本文中的repo.Repo.stop方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。