bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
From: Collin Funk <collin.funk1@gmail.com>
To: Bruno Haible <bruno@clisp.org>, bug-gnulib@gnu.org
Subject: Re: Refactoring rewrite_filename functions
Date: Tue, 16 Apr 2024 19:08:10 -0700	[thread overview]
Message-ID: <6bd41271-7bb6-4fab-9f6d-f44830a5328d@gmail.com> (raw)
In-Reply-To: <26909173.d79VK8dOqj@nimes>

On 4/16/24 6:35 PM, Bruno Haible wrote:
> This does not make sense. GLConfig is meant to hold settings and configuration,
> nothing more.
> 
> I see the home of this function more in GLFileSystem.py. Maybe in class
> GLFileAssistant, maybe in a new class in that same file.

Hmm, thanks for the advice. At the moment I think GLFileAssistant
makes sense. Since it performs transformations on the files based on
their categories, transforming the path names seems somewhat in its
domain.

This will require some code reordering first though. The
GLFileAssistant used by GLImport is not defined until
GLImport.execute(). The file name transformations are done in
GLImport.prepare(). This function also returns the transformers used
by GLFileAssistant.__init__().

I think the correct solution there is to define the GLFileAssistant in
GLImport.__init__() with it's default arguments and then set them
later. I've been meaning to do this anyways because I find defining
things outside of __init__ makes things harder to follow. This was
also a reason I had in the back of my head when fixing the default
arguments here:

    https://lists.gnu.org/archive/html/bug-gnulib/2024-04/msg00228.html

> 'tests=lib/' should not occur in the scope of mode == 'copy-file'.
> But this string is an indicator inside gnulib-tool; users of gnulib-tool
> should not be allowed to pass it.

Okay I see. I'll leave it as-is now since it works and I rather not do
accidental replacements. :)

Collin


  reply	other threads:[~2024-04-17  2:08 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-15  1:23 gnulib-tool.py: Remove a redundant function Collin Funk
2024-04-15  2:20 ` Collin Funk
2024-04-15 14:58   ` Bruno Haible
2024-04-15 15:24     ` Collin Funk
2024-04-16 15:09       ` Bruno Haible
2024-04-16 16:23         ` Collin Funk
2024-04-17  1:12         ` Refactoring rewrite_filename functions Collin Funk
2024-04-17  1:35           ` Bruno Haible
2024-04-17  2:08             ` Collin Funk [this message]
2024-04-17 14:03               ` Bruno Haible
2024-04-15 11:47 ` gnulib-tool.py: Remove a redundant function Bruno Haible
2024-04-15 14:07   ` Collin Funk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://lists.gnu.org/mailman/listinfo/bug-gnulib

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6bd41271-7bb6-4fab-9f6d-f44830a5328d@gmail.com \
    --to=collin.funk1@gmail.com \
    --cc=bruno@clisp.org \
    --cc=bug-gnulib@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).