Projects/worblehat-old
Projects
/
worblehat-old
Archived
12
0
Fork 0

Implemented edit command.

This commit is contained in:
Øystein Ingmar Skartsæterhagen 2011-10-08 19:08:06 +00:00
parent 44553732ca
commit bd81dc4425
1 changed files with 7 additions and 2 deletions

View File

@ -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