def get_timesheet_collection_for_context(ctx, entries_file=None):
    """
    Return a :class:`~taxi.timesheet.TimesheetCollection` object with the current timesheet(s). Since this depends on
    the settings (to get the entries files path, the number of previous files, etc) this uses the settings object from
    the current command context. If `entries_file` is set, this forces the path of the file to be used.
    """
    if not entries_file:
        entries_file = ctx.obj['settings'].get_entries_file_path(False)

    parser = TimesheetParser(
        date_format=ctx.obj['settings']['date_format'],
        add_date_to_bottom=ctx.obj['settings'].get_add_to_bottom(),
        flags_repr=ctx.obj['settings'].get_flags(),
    )

    return TimesheetCollection.load(entries_file, ctx.obj['settings']['nb_previous_files'], parser)
def get_timesheet_collection_for_context ( ctx , entries_file = None ) : if not entries_file : entries_file = ctx . obj [ 'settings' ] . get_entries_file_path ( False ) parser = TimesheetParser ( date_format = ctx . obj [ 'settings' ] [ 'date_format' ] , add_date_to_bottom = ctx . obj [ 'settings' ] . get_add_to_bottom ( ) , flags_repr = ctx . obj [ 'settings' ] . get_flags ( ) , ) return TimesheetCollection . load ( entries_file , ctx . obj [ 'settings' ] [ 'nb_previous_files' ] , parser )
Return a :class:`~taxi.timesheet.TimesheetCollection` object with the current timesheet(s). Since this depends on
    the settings (to get the entries files path, the number of previous files, etc) this uses the settings object from
    the current command context. If `entries_file` is set, this forces the path of the file to be used.