You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 30, 2023. It is now read-only.
Writes over the file with filepath "location" making replacements for lines matching the regex pattern: 'from\s+sage(|[.](arith|categories|combinat|ext|graphs(|[.]decompositions)|interfaces|libs|matrix|misc|numerical(|[.]backends)|rings|sets))[.]all\s+import'
355
+
Replace ``import`` statements in the file with filepath "location".
356
356
357
357
INPUT:
358
358
359
-
- ``location`` -- a file path file_to_change = 'schemes/elliptic_curves/ell_rational_field.py'
360
-
location = cwd + file_to_change
359
+
- ``location`` -- a file path
361
360
- ``package_regex`` -- (default: :obj:`default_package_regex`) a regular expression matching
362
361
the ``sage.PAC.KAGE.all`` package names from which we do not want to import.
363
362
- ``verbose`` -- if True, issue print statements when interesting examples are found
Writes over the files in src/sage matching the regex pattern fileRegex making replacements to all lines in such files
400
-
which match the regex pattern: 'from\s+sage(|[.](arith|categories|combinat|ext|graphs(|[.]decompositions)|interfaces|libs|matrix|misc|numerical(|[.]backends)|rings|sets))[.]all\s+import'
398
+
Replace ``import`` statements in the files in directory ``dir`` matching the regex pattern ``file_regex``.
401
399
402
400
INPUTS:
403
401
404
-
- ``fileRegex`` -- a regular expression locating strings containing certain module.all import statements. The suggested value is ``fileRegex = r'.*[.](py|pyx|pxi)$'``.
402
+
- ``dir`` -- a directory path
403
+
- ``file_regex`` -- a regular expression matching the file names to process
405
404
- ``package_regex`` -- (default: :obj:`default_package_regex`) a regular expression matching
406
405
the ``sage.PAC.KAGE.all`` package names from which we do not want to import.
407
-
- ``verbose`` -- a parameter which if used will issue print statements when interesting examples are found
406
+
- ``verbose`` -- if True, print statements when interesting examples are found
408
407
409
408
EXAMPLES::
410
409
411
410
sage: from sage.misc.replace_dot_all import *
412
-
sage: os.chdir(sage.env.SAGE_SRC + '/sage') # change to sage directory
413
-
sage: dir = os.getcwd() # Get the current working directory
0 commit comments