Merge branch 'master' into peter
This commit is contained in:
commit
0774a4cdd7
1 changed files with 2 additions and 28 deletions
30
newfol
30
newfol
|
|
@ -513,26 +513,6 @@ class SearchRecordView(RecordView):
|
|||
self._setup_db_field()
|
||||
return ret
|
||||
|
||||
def display_results_in_editor(recs, selected):
|
||||
dbd = DatabaseData()
|
||||
items = []
|
||||
for rec in recs:
|
||||
recvals = []
|
||||
for i in range(len(selected)):
|
||||
if i == 0 and selected[i]:
|
||||
recvals.append(rec.table)
|
||||
elif selected[i] == True:
|
||||
recvals.append(rec.fields[i-1])
|
||||
items.append(filemanip.Record(recvals))
|
||||
if dbd.edoptions["blank-lines"]:
|
||||
items.append(filemanip.Record([]))
|
||||
tempdir = tempfile.TemporaryDirectory()
|
||||
tempname = tempdir.name + "/view"
|
||||
vault = filemanip.FileStorage('csv', tempname)
|
||||
vault.store(items)
|
||||
os.chmod(tempname, 0o400)
|
||||
subprocess.call(["sensible-editor", tempname])
|
||||
|
||||
class DisplayTemplateRecordView(RecordView):
|
||||
def __init__(self, table, records):
|
||||
super().__init__("Search")
|
||||
|
|
@ -904,10 +884,11 @@ class MenuView(ListView):
|
|||
text = self.listbox.get_focus()[0].original_widget.get_text()[0]
|
||||
command = self.OPTIONS[text]
|
||||
if command == "browse-all":
|
||||
if type_.startswith("next"):
|
||||
if type_ == "select" or type_.startswith("next"):
|
||||
ccview = CompleteContentsListView()
|
||||
ccview.set_render_type(type_)
|
||||
ccview.render(self.loop)
|
||||
return
|
||||
self.loop.unhandled_input(command)
|
||||
def _rerender_listview(self):
|
||||
pass
|
||||
|
|
@ -1098,13 +1079,6 @@ def ensure_db_dir(path):
|
|||
with open(path + "/version", "w") as fp:
|
||||
print(str(int(DatabaseVersion.preferred())), file=fp)
|
||||
|
||||
def get_database_version(path):
|
||||
vfile = path + "/version"
|
||||
if not os.path.exists(vfile):
|
||||
return DatabaseVersion()
|
||||
with open(vfile, "r") as fp:
|
||||
return DatabaseVersion(fp.readline()[:-1])
|
||||
|
||||
def print_version(db):
|
||||
print("newfol " + __version__)
|
||||
if db is None:
|
||||
|
|
|
|||
Loading…
Reference in a new issue