Implemented edit command.
This commit is contained in:
parent
44553732ca
commit
bd81dc4425
|
@ -7,6 +7,8 @@ import pgdb
|
|||
from fileformat import read_actionlist, write_actionlist
|
||||
from util import *
|
||||
|
||||
file_encoding = 'utf8'
|
||||
|
||||
# connection = pgdb.connect(database='oysteini_pbb2',
|
||||
# user='oysteini_pbb',
|
||||
# password='lio5Aide',
|
||||
|
@ -213,7 +215,7 @@ def show(connection, ids, commit_format=False, tmp_file=False):
|
|||
else:
|
||||
output = '\n'.join(objects)
|
||||
if tmp_file:
|
||||
filename = write_tmpfile('.'.join(ids), output)
|
||||
filename = write_tmpfile('.'.join(ids), output, file_encoding)
|
||||
print filename
|
||||
return filename
|
||||
else:
|
||||
|
@ -321,7 +323,10 @@ def commit(connection, filename=None):
|
|||
commit_actions(connection, actions)
|
||||
|
||||
def edit(connection, ids):
|
||||
pass
|
||||
filename = show(connection, ids, commit_format=True, tmp_file=True)
|
||||
print filename
|
||||
run_editor(filename)
|
||||
commit(connection, filename)
|
||||
|
||||
def map_cmd(connection, shelfname=None, category=None):
|
||||
pass
|
||||
|
|
Reference in New Issue