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


Python conference.Conference类代码示例

本文整理汇总了Python中MaKaC.conference.Conference的典型用法代码示例。如果您正苦于以下问题:Python Conference类的具体用法?Python Conference怎么用?Python Conference使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: TestRemoveTrackCoordinator

class TestRemoveTrackCoordinator( unittest.TestCase ):
    """Tests different scenarios of the Remove Track Coord use case.
    """
    
    def setUp( self ):
        from MaKaC.user import Avatar
        cr = Avatar()
        cr.setId( "creator" )
        from MaKaC.conference import Conference, Track
        self._conf = Conference( cr )
        self._track1 = Track()
        self._track1.setId( "1" )
        self._conf.addTrack( self._track1 )
        
    def tearDown( self ):
        pass

    def testRemoveTC( self ):
        from MaKaC.user import Avatar
        tc1 = Avatar()
        tc1.setId( "tc1" )
        tc2 = Avatar()
        tc2.setId( "tc2" )
        self._track1.addCoordinator( tc1 )
        self._track1.addCoordinator( tc2 )
        self._track1.removeCoordinator( tc1 )
        self.assert_( tc1 not in self._track1.getCoordinatorList() )
        self.assert_( tc2 in self._track1.getCoordinatorList() )
        self.assert_( self._track1 not in self._conf.getCoordinatedTracks( tc1 ) )
        self.assert_( self._track1 in self._conf.getCoordinatedTracks( tc2 ) )
开发者ID:lukasnellen,项目名称:indico,代码行数:30,代码来源:testSciProgramme.py

示例2: testArchiveConferenceFile

 def testArchiveConferenceFile( self ):
     """Makes sure a file wich is attached to a conference gets stored in
         the right path: basePath/year/C0/0/test.txt
     """
     #first we create a dummy user which will be the conf creator
     from MaKaC.user import Avatar
     av = Avatar()
     #Now we create a dummy conference and set its id to 0
     from MaKaC.conference import Conference
     c = Conference( av )
     c.setId( "0" )
     #Now we create the material (id=0) and attach it to the conference
     from MaKaC.conference import Material
     m = Material()
     c.addMaterial( m )
     #Now we create a dummy file and attach it to the material
     filePath = os.path.join( os.getcwd(), "test.txt" )
     fh = open(filePath, "w")
     fh.write("hola")
     fh.close()
     from MaKaC.conference import LocalFile
     f = LocalFile()
     f.setFilePath( filePath )
     f.setFileName( "test.txt" )
     m.addResource( f )
开发者ID:ferhatelmas,项目名称:indico,代码行数:25,代码来源:fileRepository_test.py

示例3: TestSubmissionPrivileges

class TestSubmissionPrivileges(unittest.TestCase):
    """Tests different scenarios concerning the material submission privileges
    """

    def setUp( self ):
        self._creator=Avatar()
        self._creator.setId("creator")
        self._conf=Conference(self._creator)
        sd=datetime(2004, 01, 01, 10, 00, tzinfo=timezone("UTC"))
        ed=datetime(2004, 01, 05, 10, 00, tzinfo=timezone("UTC"))
        self._conf.setDates(sd,ed)

    def testBasic(self):
        c1=Contribution()
        self._conf.addContribution(c1)
        av1,av2=Avatar(),Avatar()
        av1.setId("1")
        av2.setId("2")
        self.assert_(not c1.canUserSubmit(av1))
        self.assert_(not c1.canUserSubmit(av2))
        self.assert_(len(c1.getSubmitterList())==0)
        c1.grantSubmission(av1)
        self.assert_(c1.canUserSubmit(av1))
        self.assert_(not c1.canUserSubmit(av2))
        self.assert_(len(c1.getSubmitterList())==1)
        self.assert_(av1 in c1.getSubmitterList())
        self.assert_(av2 not in c1.getSubmitterList())
        c1.revokeSubmission(av2)
        self.assert_(c1.canUserSubmit(av1))
        self.assert_(not c1.canUserSubmit(av2))
        self.assert_(len(c1.getSubmitterList())==1)
        self.assert_(av1 in c1.getSubmitterList())
        self.assert_(av2 not in c1.getSubmitterList())
        c1.revokeSubmission(av1)
        self.assert_(not c1.canUserSubmit(av1))
        self.assert_(not c1.canUserSubmit(av2))
        self.assert_(len(c1.getSubmitterList())==0)

    def testAccContrib(self):
        #tests that when a contribution comes from an accepted abstract the 
        #   abstract submitters are also granted with submission privileges 
        #   for the contribution
        av1=Avatar()
        av1.setId("1")
        av2=Avatar()
        av2.setId("2")
        abs=self._conf.getAbstractMgr().newAbstract(av1)
        abs.accept(self._creator,None,None)
        c=abs.getContribution()
        self.assert_(c.canUserSubmit(av1))
        self.assert_(not c.canUserSubmit(av2))
        c.grantSubmission(av2)
        self.assert_(c.canUserSubmit(av1))
        self.assert_(c.canUserSubmit(av2))
开发者ID:lukasnellen,项目名称:indico,代码行数:54,代码来源:testContributions.py

示例4: TestBasicManagement

class TestBasicManagement(unittest.TestCase):
    """Tests the basic contribution management functions
    """

    def setUp( self ):
        a = Avatar()
        a.setId("creator")
        self._categ = Category()
        self._conf = Conference( a )
        self._conf.setId('a')
        self._conf.setDates(datetime(2000, 01, 01, tzinfo=timezone("UTC")),datetime(2020, 01, 01, tzinfo=timezone("UTC")))
开发者ID:lukasnellen,项目名称:indico,代码行数:11,代码来源:testContributions.py

示例5: TestSchedule

class TestSchedule(unittest.TestCase):
    """Tests the schedule management functions
    """

    def setUp( self ):
        a = Avatar()
        a.setId("creator")
        self._conf=Conference(a)
        self._conf.setTimezone('UTC')
        sd=datetime(2004, 01, 01, 10, 00, tzinfo=timezone('UTC'))
        ed=datetime(2004, 01, 05, 10, 00, tzinfo=timezone('UTC'))
        self._conf.setDates(datetime(2000, 01, 01, tzinfo=timezone('UTC')),datetime(2020, 01, 01, tzinfo=timezone('UTC')))
开发者ID:lukasnellen,项目名称:indico,代码行数:12,代码来源:testConferences.py

示例6: setUp

 def setUp( self ):
     from MaKaC.user import Avatar
     a = Avatar()
     a.setId("creator")
     from MaKaC.conference import Conference
     self._conf = Conference( a )
     self._conf.setTimezone('UTC')
开发者ID:lukasnellen,项目名称:indico,代码行数:7,代码来源:testSessions.py

示例7: setUp

 def setUp( self ):
     self._creator=Avatar()
     self._creator.setId("creator")
     self._conf=Conference(self._creator)
     sd=datetime(2004, 01, 01, 10, 00, tzinfo=timezone("UTC"))
     ed=datetime(2004, 01, 05, 10, 00, tzinfo=timezone("UTC"))
     self._conf.setDates(sd,ed)
开发者ID:lukasnellen,项目名称:indico,代码行数:7,代码来源:testContributions.py

示例8: TestModifyConferenceDates

class TestModifyConferenceDates(unittest.TestCase):
    """Tests different scenarios which can occur when modifying conference start
        and end dates
    """
    def setUp(self):
        a = Avatar()
        a.setId("creator")
        self._conf=Conference(a)
        self._conf.setTimezone('UTC')
        sd=datetime(2004, 01, 01, 10, 00, tzinfo=timezone('UTC'))
        ed=datetime(2004, 01, 05, 10, 00, tzinfo=timezone('UTC'))
        self._conf.setDates(sd,ed)

    def testSessions(self):
        s1=Session()
        s1.setDates(datetime(2004, 01, 01, 10, 00, tzinfo=timezone('UTC')),datetime(2004, 01, 01, 12, 00, tzinfo=timezone('UTC')))
开发者ID:lukasnellen,项目名称:indico,代码行数:16,代码来源:testConferences.py

示例9: setUp

 def setUp( self ):
     from MaKaC.user import Avatar
     a = Avatar()
     a.setId("creator")
     from MaKaC.conference import Conference
     self._conf=Conference(a)
     self._conf.setTimezone('UTC')
     self._conf.setDates(datetime(2000,1,1,tzinfo=timezone('UTC')),datetime(2020,1,1,tzinfo=timezone('UTC')))
开发者ID:lukasnellen,项目名称:indico,代码行数:8,代码来源:testWebInterface.py

示例10: setUp

 def setUp(self):
     a = Avatar()
     a.setId("creator")
     self._conf=Conference(a)
     self._conf.setTimezone('UTC')
     sd=datetime(2004, 01, 01, 10, 00, tzinfo=timezone('UTC'))
     ed=datetime(2004, 01, 05, 10, 00, tzinfo=timezone('UTC'))
     self._conf.setDates(sd,ed)
开发者ID:lukasnellen,项目名称:indico,代码行数:8,代码来源:testConferences.py

示例11: setUp

 def setUp( self ):
     from MaKaC.user import Avatar
     cr = Avatar()
     cr.setId( "creator" )
     from MaKaC.conference import Conference, Track
     self._conf = Conference( cr )
     self._track1 = Track()
     self._track1.setId( "1" )
     self._conf.addTrack( self._track1 )
开发者ID:lukasnellen,项目名称:indico,代码行数:9,代码来源:testSciProgramme.py

示例12: setUp

 def setUp( self ):
     from MaKaC.user import Avatar
     av = Avatar()
     from MaKaC.conference import Conference
     self._conf = Conference( av )
     self._track1 = self._conf.newTrack()
     self._track2 = self._conf.newTrack()
     self._track3 = self._conf.newTrack()
     absMgr=self._conf.getAbstractMgr()
     self._contribTypeOral="oral"
     self._contribTypePoster="poster"
开发者ID:bubbas,项目名称:indico,代码行数:11,代码来源:review_test.py

示例13: setUp

 def setUp( self ):
     a = Avatar()
     a.setId("creator")
     self._conf = Conference( a )
     self._conf.setId('a')
     category=Category()
     category.setId('1')
     self._conf.addOwner(category)
     catDateIdx = indexes.IndexesHolder().getIndex('categoryDate')
     catDateIdx.indexConf(self._conf)
     self._conf.setTimezone('UTC')
开发者ID:VishrutMehta,项目名称:indico,代码行数:11,代码来源:schedule_test.py

示例14: TestContributionInclusion

class TestContributionInclusion( unittest.TestCase ):
    
    def setUp( self ):
        from MaKaC.user import Avatar
        cr = Avatar()
        cr.setId( "creator" )
        from MaKaC.conference import Conference, Track
        self._conf = Conference( cr )
        self._track1 = Track()
        self._track1.setId( "1" )
        self._conf.addTrack( self._track1 )

    def test( self ):
        from MaKaC.conference import Contribution
        contrib1 = Contribution()
        self._conf.addContribution( contrib1 )
        self._track1.addContribution( contrib1 )
        self.assert_( self._track1.hasContribution( contrib1 ) )
        self.assert_( contrib1.getTrack() == track1 )
        self._track1.removeContribution( contrib1 )
        self.assert_( not self._track1.hasContribution( contrib1 ) )
        self.assert_( contrib1.getTrack() == None )
开发者ID:lukasnellen,项目名称:indico,代码行数:22,代码来源:testSciProgramme.py

示例15: create_event

def create_event(category, event_type, data):
    from MaKaC.conference import Conference
    conf = Conference.new(category, creator=session.user, title=data.pop('title'), start_dt=data.pop('start_dt'),
                          end_dt=data.pop('end_dt'), timezone=data.pop('timezone'), event_type=event_type)
    event = conf.as_event
    theme = data.pop('theme', None)
    if theme is not None:
        layout_settings.set(event, 'timetable_theme', theme)
    event.populate_from_dict(data)
    db.session.flush()
    logger.info('Event %r created in %r by %r ', event, category, session.user)
    event.log(EventLogRealm.event, EventLogKind.positive, 'Event', 'Event created', session.user)
    return event
开发者ID:fph,项目名称:indico,代码行数:13,代码来源:operations.py


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