pygnulib/GLFileSystem.py


Log

Author Commit Date CI Message
Pádraig Brady 7b089321 2025-01-01T09:24:36 maint: run 'make update-copyright'
Collin Funk 7a99ec18 2024-06-15T05:42:18 gnulib-tool.py: Revert previous change. * pygnulib/constants.py (joinpath): Restore function and remove unused local variable. (relativize, symlink_relative, as_link_value_at_dest, hardlink): Use it. * pygnulib/GLConfig.py (resetAutoconfFile): Likewise. * pygnulib/GLEmiter.py (lib_Makefile_am, tests_Makefile_am): Likewise. * pygnulib/GLFileSystem.py (lookup, shouldLink, tmpfilename, add) (update, add_or_update, super_update): Likewise. * pygnulib/GLImport.py (__init__, relative_to_currdir) (_done_dir_, _update_ignorelist_, prepare, execute): Likewise. * pygnulib/GLInfo.py (version): Likewise. * pygnulib/GLMakefileTable.py (parent): Likewise. * pygnulib/GLModuleSystem.py (exists, find, getFiles) (getAutomakeSnippet_Unconditional): Likewise. * pygnulib/GLTestDir.py (_patch_test_driver, execute): Likewise. * pygnulib/main.py (main): Likewise.
Collin Funk 790206bf 2024-06-14T21:55:48 gnulib-tool.py: Simplify joining paths. * pygnulib/constants.py (joinpath): Remove function. It is equivalent to os.path.normpath(os.path.join(...)) where the os.path.normpath is typically not needed. (relativize, symlink_relative, as_link_value_at_dest, hardlink): Use os.path.join instead of joinpath. * pygnulib/GLConfig.py (resetAutoconfFile): Likewise. * pygnulib/GLEmiter.py (lib_Makefile_am, tests_Makefile_am): Likewise. * pygnulib/GLFileSystem.py (lookup, shouldLink, tmpfilename, add) (update, add_or_update, super_update): Likewise. * pygnulib/GLInfo.py (version): Likewise. * pygnulib/GLMakefileTable.py (parent): Likewise. * pygnulib/GLTestDir.py (_patch_test_driver, execute): Likewise. * pygnulib/main.py (main): Likewise. * pygnulib/GLModuleSystem.py (exists, find, getFiles): Likewise. * pygnulib/GLImport.py (__init__, relative_to_currdir) (_done_dir_, _update_ignorelist_, prepare, execute): Likewise. (getAutomakeSnippet_Unconditional): Likewise. Add a comment about not using os.path.normpath() to protect a Make variable.
Collin Funk adc6d632 2024-05-01T21:26:34 gnulib-tool.py: Quote file names passed to 'patch'. * pygnulib/GLTestDir.py (_patch_test_driver): Import shlex and cleanup unused imports. Use shlex.quote() on the file names passed to 'patch'. * pygnulib/GLFileSystem.py (GLFileSystem.lookup): Likewise. Perform redirection using sp.call() arguments instead of using the shell.
Collin Funk 20061b49 2024-04-29T22:20:31 gnulib-tool.py: Add type hints to classes. * pygnulib/*.py: Add type hints for all instance and class variables. * pygnulib/GLMakefileTable.py (GLMakefileTable.__getitem__): Fix return type hint since the dictionary has str values.
Collin Funk 379b3a02 2024-04-23T11:28:19 gnulib-tool.py: Make better use of imports. * pygnulib/*.py: Import functions from constants.py directly instead of assigning them to module-specific variable. Keep the module prefix for standard library functions.
Collin Funk 544b6f6e 2024-04-19T23:42:24 gnulib-tool.py: Remove duplicate per-module definitions. * pygnulib/constants.py: Remove duplicate __authors__, __license__, and __copyright__ definitions. * pygnulib/GLInfo.py: Use the value of __authors__ and __copyright__ from __init__.py for output. * pygnulib/*.py: Remove unused references to the constant.py definitions.
Collin Funk f67b0b14 2024-04-13T18:51:06 gnulib-tool.py: Don't use mutable default arguments. * pygnulib/GLFileSystem.py (GLFileAssistant.__init__): Set the default argument for 'transformers' to None. If it is None then set it to an empty dictionary in the body.
Bruno Haible 3258dcae 2024-04-13T12:55:44 gnulib-tool.py: Stop using codecs.open. * pygnulib/*.py: To open a file, consistently use open(..., mode='[rwa]', newline='\n', encoding='utf-8').
Collin Funk f41781a9 2024-04-08T16:37:48 gnulib-tool.py: Use single-quotes for strings. * pygnulib/*.py: Change double-quoted strings to use single-quotes unless doing so would require adding backslashes.
Collin Funk 965b5c72 2024-04-08T16:08:50 gnulib-tool.py: Prefer 'list.append(item)' over 'list += [item]'. * pygnulib/*.py: Change occurrences '+= [item]' to use '.append(item)' where item is a single element added to the list. See discussion here: <https://lists.gnu.org/archive/html/bug-gnulib/2024-04/msg00091.html>
Collin Funk f2a22fc7 2024-04-07T18:55:50 gnulib-tool.py: Remove an unused and incorrect function. * pygnulib/GLFileSystem.py (GLFileAssistant.removeFile): Remove this unused function. The correct method of removing an element from a list is to use the remove() function, not pop() which takes an index.
Collin Funk a4b2df9d 2024-04-04T15:29:50 gnulib-tool.py: Ignore 'use-dict-literal' warnings. * pygnulib/.pylintrc: Don't emit warning messages suggesting that 'dict()' be converted to '{}'. This literal can be mistaken for sets, see discussion here: <https://lists.gnu.org/archive/html/bug-gnulib/2024-04/msg00054.html> * pygnulib/main.py: Document this convention in coding style section. * pygnulib/GLFileSystem.py (GLFileAssistant.__init__): Convert an occurrence of '{}' to 'dict()'.
Collin Funk 6b97d904 2024-04-04T14:56:12 gnulib-tool.py: Fix pylint 'raise-missing-from' warnings. * pygnulib/*.py: Use explicit exception chaining so that stack trace messages do not seem like bugs. See examples in: <https://lists.gnu.org/archive/html/bug-gnulib/2024-04/msg00056.html>
Collin Funk 51e46581 2024-04-03T02:56:42 gnulib-tool.py: Modernize class declarations to Python 3. * pygnulib/GLConfig.py: Remove the explicit object inheritance from class declarations. This is previously required in Python 2. * pygnulib/GLEmiter.py: Likewise. * pygnulib/GLFileSystem.py: Likewise. * pygnulib/GLImport.py: Likewise. * pygnulib/GLInfo.py: Likewise. * pygnulib/GLMakefileTable.py: Likewise. * pygnulib/GLModuleSystem.py: Likewise. * pygnulib/GLTestDir.py: Likewise.
Collin Funk 519a00ed 2024-04-02T11:35:51 gnulib-tool.py: Use [] instead of list() to initialize empty lists. * pygnulib/*.py: Change occurrences of list() to [].
Bruno Haible 52a5f9e3 2024-04-02T13:42:53 gnulib-tool: Remove unused variables. * pygnulib/GLConfig.py: Remove unused variables. * pygnulib/GLEmiter.py: Likewise. * pygnulib/GLFileSystem.py: Likewise. * pygnulib/GLImport.py: Likewise. * pygnulib/GLInfo.py: Likewise. * pygnulib/GLModuleSystem.py: Likewise. * pygnulib/GLTestDir.py: Likewise. * pygnulib/main.py: Likewise. * gnulib-tool.sh (func_emit_tests_Makefile_am): Remove unused variable perhapsLT.
Bruno Haible e3274bb2 2024-04-02T01:18:59 gnulib-tool.py: Remove unused imports. * pygnulib/GLFileSystem.py: Remove unused imports. * pygnulib/GLEmiter.py: Likewise. (GLEmiter.autoconfSnippets): Fix type assertion message.
Bruno Haible bf2f5662 2024-04-01T21:28:23 gnulib-tool.py: Simplify imports. * pygnulib/enums.py: New file, extracted from pygnulib/GLFileSystem.py. * pygnulib/classes.py: Remove file. * pygnulib/GLFileSystem.py: Remove class CopyAction. Update imports. * pygnulib/GLTestDir.py: Update imports. * pygnulib/GLConfig.py: Update imports and remove 'classes.' prefix. * pygnulib/main.py: Likewise.
Bruno Haible 142fec3c 2024-03-28T03:21:52 gnulib-tool.py: Fix breakage that I introduced with Collin's last patch. * pygnulib/GLFileSystem.py (GLFileAssistant.add_or_update): Correct the open calls.
Collin Funk d6d189fd 2024-03-27T17:39:58 gnulib-tool.py: Inline 'sed' invocations used on library files. * pygnulib/GLFileSystem.py (GLFileAssistant.__init__): Update type hints and docstrings to reflect changes necessary for using re.sub() instead of 'sed'. (GLFileAssistant.add_or_update): Use re.sub() instead of invoking 'sed'. * pygnulib/GLImport.py (GLImport.prepare): Update transformation variables to reflect changes to GLFileAssistant.
Collin Funk 148b623a 2024-03-27T00:56:29 gnulib-tool.py: Add type hints to all functions. * pygnulib/*.py: Add type hints and remove duplicate function signatures from docstrings.
Collin Funk d64fd23b 2024-03-17T10:03:54 gnulib-tool.py: Follow gnulib-tool changes, part 62. Follow gnulib-tool change 2020-02-22 Bruno Haible <bruno@clisp.org> gnulib-tool: Ensure copied files are writable. * pygnulib/constants.py (ensure_writable): New function. Make sure files are writable. (symlink_relative, hardlink): Use it. * pygnulib/GLFileSystem.py (GLFileSystem.lookup) (GLFileAssistant.add_or_update): Likewise. * pygnulib/GLTestDir.py (GLTestDir.execute): Likewise. * pygnulib/main.py (main): Likewise.
Collin Funk dc222376 2024-03-16T20:43:00 gnulib-tool.py: Don't try to remove files that don't exist. * pygnulib/GLFileSystem.py (GLFileSystem.add_or_update): Check if the temporary file exists before trying to remove it.
Collin Funk cb626876 2024-03-15T19:58:27 gnulib-tool.py: Follow gnulib-tool changes, part 58. Follow gnulib-tool change 2017-05-21 Bruno Haible <bruno@clisp.org> gnulib-tool: Add options to create hard links. * pygnulib/GLConfig.py (GLConfig.__init__): Add 'copymode' and 'lcopymode' to the parameter list. Initialize them. (GLConfig.default): Don't use symbolic or hard links by default. (GLConfig.checkCopyMode, GLConfig.setCopyMode, GLConfig.resetCopyMode): New functions to modify and check the method for copying non --local-dir files. (GLConfig.checkLCopyMode, GLConfig.setLCopyMode) (GLConfig.resetLCopyMode): New functions to modify and check the method for copying --local-dir files. (GLConfig.checkSymbolic, GLConfig.resetSymbolic, GLConfig.setSymbolic) (GLConfig.checkLSymbolic, GLConfig.resetLSymbolic) (GLConfig.setLSymbolic): Remove unused functions. The functionality of these are now implemented in the *CopyMode() and *LCopyMode() variants. * pygnulib/GLFileSystem.py (CopyAction.Hardlink): New Enum value to describe hard links. (GLFileSystem.shouldLink): Check if hard links should be used. (GLFileAssistant.add, GLFileAssistant.update): Try to hard link if enabled. Copy the file if linking fails. (GLFileAssistant.add_or_update): Remove temporary files unconditionally. * pygnulib/GLInfo.py (GLInfo.usage): Document new options in the usage message. * pygnulib/GLTestDir.py (GLTestDir.execute): Try to hard link if enabled. Copy the file if linking fails. * pygnulib/classes.py: Importy the CopyAction Enum. * pygnulib/constants.py (hardlink): New function based on symlink_relative. * pygnulib/main.py (main): Add new options --hardlink and --local-hardlink. Invoke 'git update-index --refresh' to mitigate the effects of the hard links on git.
Simon Josefsson 5b92dd0a 2024-01-01T10:31:48 maint: run 'make update-copyright'
Simon Josefsson 32a72f45 2023-01-01T01:14:21 maint: run 'make update-copyright'
Bruno Haible ad534101 2022-08-05T23:15:39 gnulib-tool.py: Refactor --makefile-name option. * gnulib-tool.py (main): Rename variable 'makefile' to 'makefile_name'. * pygnulib/GLConfig.py: Rename attribute 'makefile' to 'makefile_name'. * pygnulib/GLMakefileTable.py: Update. * pygnulib/GLEmiter.py: Likewise. * pygnulib/GLImport.py: Likewise. * pygnulib/GLFileSystem.py (GLFileAssistant): Remove unused assignment.
Bruno Haible 45b39787 2022-08-05T17:13:20 gnulib-tool.py: Fix 'Unused import' warnings. * gnulib-tool.py: Remove unused imports. * pygnulib/*.py: Likewise.
Bruno Haible eb194fa7 2022-08-05T15:15:16 gnulib-tool.py: Fix 'Undefined variable' errors. * pygnulib/constants.py: Import codecs. * pygnulib/GLConfig.py (GLConfig.setLibName): Fix local variable reference. * pygnulib/GLFileSystem.py (GLFileSystem.lookup, GLFileAssistant.update): Fix local variable references. * pygnulib/GLEmiter.py (GLEmiter.po_POTFILES_in): Fix reference. * pygnulib/GLTestDir.py (GLMegaTestDir.execute): Define missing local variables.
Bruno Haible 362f779b 2022-08-04T21:53:51 gnulib-tool.py: Coding style: Revisit line breaks. * gnulib-tool.py: Avoid line breaks at arbitrary points inside expressions. Use line breaks to clarify [... for ...] iterations. * pygnulib/*.py: Likewise.
Bruno Haible 2a33db96 2022-08-04T18:26:08 gnulib-tool.py: Use mainstream/GNU coding style. * gnulib-tool.py: Break lines before the % operator, not after. * pygnulib/*.py: Likewise. Avoid line breaks when the resulting lines are not too long.
Bruno Haible ed7b3d9b 2022-08-03T14:27:51 gnulib-tool.py: Avoid errors when writing to a VFAT file system, part 2. * pygnulib/constants.py (movefile): New function. * pygnulib/*.py: Use it instead of shutil.
Bruno Haible dbc9a4b3 2022-08-03T11:27:21 gnulib-tool.py: Avoid errors when writing to a VFAT file system. * pygnulib/constants.py (copyfile, copyfile2): New functions. * gnulib-tool.py: Use them instead of shutil. * pygnulib/*.py: Likewise.
Bruno Haible 6bdf668e 2022-07-31T18:39:19 gnulib-tool.py: Follow gnulib-tool changes, part 19. Follow gnulib-tool changes 2015-12-09 Pavel Raiskup <praiskup@redhat.com> gnulib-tool: allow multiple --local-dir usage 2019-02-14 Bruno Haible <bruno@clisp.org> gnulib-tool: Improve handling of multiple --local-dir options. * gnulib-tool (func_reconstruct_cached_dir): When the argument is absolute, return it unmodified. (func_compute_relative_local_gnulib_path): Renamed from func_count_relative_local_gnulib_path. Add comment. * gnulib-tool.py: Accept multiple --local-dir options and collect the values into localpath. * pygnulib/GLConfig.py: Take a localpath argument instead of a localdir argument. (getLocalDir, setLocalDir, resetLocalDir): Remove methods. (getLocalPath, setLocalPath, resetLocalPath): New methods. * pygnulib/GLFileSystem.py (CopyAction): New class. (GLFileSystem.lookup): Consider all dirs in localpath. (GLFileSystem.shouldLink): New method. (GLFileAssistant): Use shouldLink. * pygnulib/GLModuleSystem.py (GLModuleSystem.exists): Iterate over all dirs in localpath. (GLModuleSystem.list): Likewise. * pygnulib/GLEmiter.py: Update. * pygnulib/GLImport.py (GLImport.__init__): Put the argument of gl_LOCAL_DIR into localpath, not localdir. (GLImport.actioncmd): Consider all dirs in localpath. (GLImport.relative_to_destdir, GLImport.relative_to_currdir): New methods. (GLImport.gnulib_cache): Combine all dirs in localpath. Use self.relative_to_destdir. * pygnulib/GLTestDir.py (GLTestDir.execute): Use shouldLink.
Bruno Haible dd7b332f 2022-07-30T13:51:36 gnulib-tool.py: Clean up imports. * gnulib-tool.py: Remove unused constants. * pygnulib/*.py: Likewise.
Bruno Haible 0a624ee7 2022-07-30T13:29:26 gnulib-tool.py: Assume Python 3. * gnulib-tool.py: Don't allow 'bytes' as an alternative to 'str'. * pygnulib/*.py: Likewise.
Bruno Haible d2abfb90 2022-07-30T11:45:36 gnulib-tool.py: Assume Python 3. * gnulib-tool.py: Don't set PYTHON3, string. Use str instead of string. * pygnulib/*.py: Likewise.
Bruno Haible 5d39cdb4 2022-07-30T10:44:02 gnulib-tool.py: Modernize coding style. * pygnulib/*.py: Remove parentheses around raise value expressions.
Bruno Haible 0bc144f9 2022-07-29T18:45:33 gnulib-tool.py: Modernize coding style. * pygnulib/*.py: Remove parentheses around return value expressions.
Bruno Haible 3e44e3bb 2022-07-29T16:41:28 gnulib-tool.py: Modernize the file headers. * pygnulib/*.py: Remove '#!/usr/bin/python' (not needed) and 'encoding: UTF-8' lines (default in Python 3). Add copyright notice.
Bruno Haible 07a187be 2017-09-09T14:40:10 gnulib-tool.py: follow gnulib-tool changes, part 14 Follow gnulib-tool change 2015-08-20 Daiki Ueno <ueno@gnu.org> gnulib-tool: don't transform binary files with sed
Bruno Haible e321e9c3 2017-09-09T10:25:09 gnulib-tool.py: follow gnulib-tool changes, part 12 Follow gnulib-tool change 2015-02-03 Pádraig Brady <P@draigBrady.com> gnulib-tool: fix handling of patch(1) diagnostics
Bruno Haible f0e4c4b6 2017-09-09T00:32:50 gnulib-tool.py: follow gnulib-tool changes, part 3 Follow gnulib-tool change 2012-08-26 Bruno Haible <bruno@clisp.org> gnulib-tool: Remove no-op option --no-changelog. * pygnulib/constants.py: Remove FILES dictionary. * pygnulib/*: Update.
Dmitry Selyutin 21c52a82 2017-09-08T18:34:58 [pygnulib] autopep8 (fixing indentation, style, etc.)
Dmitry Selyutin 3df66605 2017-09-05T10:04:18 gnulib-tool.py: fix errors on building wget2; use UTF-8 in subprocess
Dmitry Selyutin 02a1f93e 2017-08-20T11:17:58 [pygnulib] initial merge (including some small bug fixes)