예제 #1
0
 def post(self, title, text=''):
     arg = ' '.join(title)
     try:
         with open(arg, 'r'):
             post = Post.from_file(arg)
     except Exception:
         try:
             post = Post.from_slugish(arg)
             assert post is not None
         except Exception:
             post = Post.from_title(arg, text)
     return post
예제 #2
0
파일: stag.py 프로젝트: noah/stag
 def post(self, title, text=''):
     arg = ' '.join(title)
     try:
         with open(arg, 'r'):
             post = Post.from_file(arg)
     except Exception:
         try:
             post = Post.from_slugish(arg)
             assert post is not None
         except Exception:
             post = Post.from_title(arg, text)
     return post