def get_pep_page(pep_number, commit=True):
 pep_path = os.path.join(settings.PEP_REPO_PATH, 'pep-{}.html'.format(pep_number))
 if (not os.path.exists(pep_path)):
  print "PEP Path '{}' does not exist, skipping".format(pep_path)
 pep_content = convert_pep_page(pep_number, open(pep_path).read())
 (pep_page, _) = Page.objects.get_or_create(path=pep_url(pep_number))
 pep_page.title = pep_content['title']
 pep_page.content = pep_content['content']
 pep_page.content_markup_type = 'html'
 pep_page.template_name = PEP_TEMPLATE
 if commit:
  pep_page.save()
 return pep_page

def get_pep_page ( pep_number , commit = True ) : pep_path = os . path . join ( settings . PEP_REPO_PATH , 'pep-{}.html' . format ( pep_number ) ) if ( not os . path . exists ( pep_path ) ) : print "PEP Path '{}' does not exist, skipping" . format ( pep_path ) pep_content = convert_pep_page ( pep_number , open ( pep_path ) . read ( ) ) ( pep_page , _ ) = Page . objects . get_or_create ( path = pep_url ( pep_number ) ) pep_page . title = pep_content [ 'title' ] pep_page . content = pep_content [ 'content' ] pep_page . content_markup_type = 'html' pep_page . template_name = PEP_TEMPLATE if commit : pep_page . save ( ) return pep_page
given a pep_number retrieve original pep source text .