Skip to content

Commit

Permalink
ptig - support dir/ls with no parameters
Browse files Browse the repository at this point in the history
Assumes root of (first) note directory.
  • Loading branch information
clach04 committed Nov 2, 2024
1 parent ceca164 commit d0276c7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions puren_tonbo/tools/ptig.py
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down

0 comments on commit d0276c7

Please sign in to comment.