def build_requirements(docs_path, package_name=u'mezzanine'):
 mezz_string = u'Mezzanine=='
 project_path = os.path.join(docs_path, u'..')
 requirements_file = os.path.join(project_path, package_name, u'project_template', u'requirements.txt')
 with open(requirements_file, u'r') as f:
  requirements = f.readlines()
 with open(requirements_file, u'w') as f:
  f.write((u'Mezzanine==%s\n' % __version__))
  for requirement in requirements:
   if (requirement.strip() and (not requirement.startswith(mezz_string))):
    f.write(requirement)

def build_requirements ( docs_path , package_name = u'mezzanine' ) : mezz_string = u'Mezzanine==' project_path = os . path . join ( docs_path , u'..' ) requirements_file = os . path . join ( project_path , package_name , u'project_template' , u'requirements.txt' ) with open ( requirements_file , u'r' ) as f : requirements = f . readlines ( ) with open ( requirements_file , u'w' ) as f : f . write ( ( u'Mezzanine==%s\n' % __version__ ) ) for requirement in requirements : if ( requirement . strip ( ) and ( not requirement . startswith ( mezz_string ) ) ) : f . write ( requirement )
updates the requirements file with mezzanines version number .