Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/Users/$USER/anaconda/bin/python
- import sys
- # Current tasks
- #
- # Gather the documents in order for us to create the vplan
- # Block specs
- class Resource:
- 'Simple resource class'
- def __init__( self, first='', last='', user='' ):
- self.first=first
- self.last=last
- self.user=user
- class TaskManager:
- 'Simple task manager to allow tracking of tasks'
- def __init__( self, name='', desc='', parent=None ):
- self.name=name
- self.desc=desc
- self.parent=parent
- self.subtasks={}
- self.resources=[]
- self.effort=0
- def __str__( self ):
- return( self.name )
- def create_subtask( self, name='', desc='', **kwargs ):
- self.subtasks[name] = TaskManager( name=name, desc=desc, parent=self, **kwargs )
- def depth( self ):
- if self.parent:
- return( self.parent.depth()+1 )
- else:
- return( 0 )
- def info( self, **kwargs ):
- s="%s%s: %s\n" % ( " "*self.depth(), self.name, self.desc )
- for name, task in self.subtasks.items():
- s+=task.info( **kwargs )
- return( s )
- if __name__ == '__main__':
- #if len(sys.argv) > 1:
- # main(int(sys.argv[1]))
- lam=TaskManager( name='lamarr', desc='Customer digital cim based on ant' )
- lam.create_subtask( name='vplan', desc='Verification plan to assure successful implementation of design intent' )
- print( lam.info( ) )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement