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 fileformat import read_actionlist, write_actionlist
|
||||||
from util import *
|
from util import *
|
||||||
|
|
||||||
|
file_encoding = 'utf8'
|
||||||
|
|
||||||
# connection = pgdb.connect(database='oysteini_pbb2',
|
# connection = pgdb.connect(database='oysteini_pbb2',
|
||||||
# user='oysteini_pbb',
|
# user='oysteini_pbb',
|
||||||
# password='lio5Aide',
|
# password='lio5Aide',
|
||||||
|
@ -213,7 +215,7 @@ def show(connection, ids, commit_format=False, tmp_file=False):
|
||||||
else:
|
else:
|
||||||
output = '\n'.join(objects)
|
output = '\n'.join(objects)
|
||||||
if tmp_file:
|
if tmp_file:
|
||||||
filename = write_tmpfile('.'.join(ids), output)
|
filename = write_tmpfile('.'.join(ids), output, file_encoding)
|
||||||
print filename
|
print filename
|
||||||
return filename
|
return filename
|
||||||
else:
|
else:
|
||||||
|
@ -321,7 +323,10 @@ def commit(connection, filename=None):
|
||||||
commit_actions(connection, actions)
|
commit_actions(connection, actions)
|
||||||
|
|
||||||
def edit(connection, ids):
|
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):
|
def map_cmd(connection, shelfname=None, category=None):
|
||||||
pass
|
pass
|
||||||
|
|
Reference in New Issue