Skip to content

Commit

Permalink
fix a name bug
Browse files Browse the repository at this point in the history
  • Loading branch information
maplebeats committed Apr 27, 2012
1 parent 23660c1 commit 643004a
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions newpost.py
Expand Up @@ -4,7 +4,7 @@
import re
import platform

format = "textile"
format = ".textile"
if platform.system()=='Linux':
editor = "gedit"
dir = "/home/maplebeats/works/maplebeats.github.com/_posts/"
Expand All @@ -24,15 +24,15 @@ def __init__(self,filetitle,posttitle,summary):

def filename(self):
filetime = time.localtime()
return self.filetitle + '-%s-%s-%s'%(filetime[:3]) + '.' + format
return '%s-%s-%s-'%filetime[:3] + self.filetitle + format

def filehead(self):
head = "---\nyaout: post\ntitle: %s\nsummary: %s\n---"%(self.posttile,self.summary)
head = "---\nlayout: post\ntitle: %s\nsummary: %s\n---"%(self.posttile,self.summary)
return head

def fileend(self):
posttime = time.asctime()
return '*(data)Posted on %s by "maplebeats":http://maplebeats.com/me*'%posttime
return 'p(data). Posted on %s by "maplebeats":http://maplebeats.com/me'%posttime

class Post:

Expand Down Expand Up @@ -64,9 +64,9 @@ def code(self):

class push:

def __init__(self,title):
def __init__(self,filename,title):
if input('push?(yes/y)').lower() == ('yes' or 'y'):
os.system(r'cd %s;git add .;git commit -a -m \"%s %s\";git push'%(gitdir,time.asctime(),title))
os.system(r'cd %s;git add %s;git commit -a -m \"%s %s\";git push'%(gitdir,filename,time.asctime(),title))
else:
sys.exit()

Expand All @@ -80,6 +80,6 @@ def __init__(self,title):
tran = Transition()
content = tran.postimg(content)
with open(dir + lable.filename(),'w') as f:
f.write('%s\n%s\n%s'%(lable.filehead(),content,lable.fileend()))
push(title)
f.write('%s\n%s\n\n%s'%(lable.filehead(),content,lable.fileend()))
push(lable.filename,title)

0 comments on commit 643004a

Please sign in to comment.