Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(58)  |  Call(55)  |  Derive(0)  |  Import(3)

src/d/r/DrumBurp-HEAD/src/GUI/DBCommands.py   DrumBurp(Download)
from Data import DBConstants
from Data.NotePosition import NotePosition
from Data.Measure import Measure
import DBVersion
 

src/d/r/DrumBurp-HEAD/src/test/testStaff.py   DrumBurp(Download)
import unittest
from Data.Staff import Staff
from Data.Measure import Measure
from Data.DBConstants import EMPTY_NOTE
from Data.DBErrors import BadTimeError
    def testAddMeasure(self):
        self.staff.addMeasure(Measure(1))
        self.assertEqual(self.staff.numMeasures(), 1)
        self.assertEqual(len(self.staff), 1)
        self.staff.addMeasure(Measure(2))
    def testIterateOverMeasures(self):
        for i in range(1, 16):
            self.staff.addMeasure(Measure(i))
        for i, measure in enumerate(self.staff):
            self.assertEqual(len(measure), i + 1)
 
    def testGetMeasureByIndex(self):
        for i in range(1, 16):
            self.staff.addMeasure(Measure(i))

src/d/r/DrumBurp-HEAD/src/test/testMeasure.py   DrumBurp(Download)
import unittest
from cStringIO import StringIO
from Data.Measure import Measure
from Data.Counter import CounterRegistry
from Data.MeasureCount import MeasureCount
    def setUp(self):
        self.measure = Measure(16)
        counter = self.reg.getCounterByName("16ths")
        mc = MeasureCount()
        mc.addSimpleBeats(counter, 4)
                          "3", "e", "+", "a",
                          "4", "e", "+", "a"])
        measure = Measure(16)
        self.assertEqual(measure.count(), [" "] * 16)
 
    def testCopyPaste(self):
        self.measure.addNote(NotePosition(noteTime = 0, drumIndex = 0), "x")
        self.measure.addNote(NotePosition(noteTime = 1, drumIndex = 1), "o")
        measure2 = Measure(8)
        copied = self.measure.copyMeasure()
        self.measure.setLineBreak(True)
        self.measure.setSectionEnd(True)
        measure2 = Measure(8)
        self.assertFalse(measure2.isRepeatEnd())
        self.assertFalse(measure2.isRepeatStart())