From d0276c7c8775d225f0d21a600934ec35304459bc Mon Sep 17 00:00:00 2001 From: clach04 Date: Sat, 2 Nov 2024 14:21:00 -0700 Subject: [PATCH] ptig - support dir/ls with no parameters Assumes root of (first) note directory. --- puren_tonbo/tools/ptig.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/puren_tonbo/tools/ptig.py b/puren_tonbo/tools/ptig.py index e04ebef..3ce736a 100755 --- a/puren_tonbo/tools/ptig.py +++ b/puren_tonbo/tools/ptig.py @@ -286,12 +286,14 @@ def do_ls(self, line=None): # TODO show file size and timestamps line = self.validate_result_id(line) if line is None: - return + #return + # assume current directory (for now, that means root directory) + line = '.' sub_dir = os.path.dirname(line) # similar open to opendir - but for directory listings, i.e. can NOT ls/dir a single file (future TODO?) print('DEBUG sub_dir %s' % sub_dir) note_encoding = self.pt_config['codec'] - note_root = self.paths_to_search[0] # TODO just pick the first one, ignore everthing else + note_root = self.paths_to_search[0] # FIXME handle multiple note dirs, read and new do. TODO just pick the first one, ignore everthing else notes = puren_tonbo.FileSystemNotes(note_root, note_encoding) # TODO handle; puren_tonbo.PurenTonboIO: outside of note tree root? no need, handled by validate_result_id() # FIXME/TODO results list with numbers?