當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。