Compare commits
No commits in common. "9ed70b317d1de794d20a2eac92cb98c4ad4e5c07" and "867686fe9856b4df746efe02095afdc7fbfb0a81" have entirely different histories.
9ed70b317d
...
867686fe98
26
Jenkinsfile
vendored
26
Jenkinsfile
vendored
@ -1,26 +0,0 @@
|
|||||||
pipeline {
|
|
||||||
agent any
|
|
||||||
stages {
|
|
||||||
stage("install") {
|
|
||||||
steps {
|
|
||||||
sh 'conda env update --file environment.yml'
|
|
||||||
sh 'echo "conda activate renamebycsv" >> ~/.bashrc'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
stage("build") {
|
|
||||||
steps {
|
|
||||||
sh "python -m build"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
stage("publish") {
|
|
||||||
when {
|
|
||||||
branch '**/master'
|
|
||||||
}
|
|
||||||
steps {
|
|
||||||
withCredentials([usernamePassword(credentialsId: 'rs-git-package-registry-ydeng', passwordVariable: 'PASS', usernameVariable: 'USER')]) {
|
|
||||||
sh "python -m twine upload --repository-url https://git.reslate.systems/api/packages/${USER}/pypi -u ${USER} -p ${PASS} --non-interactive --disable-progress-bar --verbose dist/*"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
21
LICENSE
21
LICENSE
@ -1,21 +0,0 @@
|
|||||||
MIT License
|
|
||||||
|
|
||||||
Copyright (c) [year] [fullname]
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
SOFTWARE.
|
|
@ -1,11 +0,0 @@
|
|||||||
name: renamebycsv
|
|
||||||
channels:
|
|
||||||
- anaconda
|
|
||||||
- conda-forge
|
|
||||||
dependencies:
|
|
||||||
- build=0.7.0
|
|
||||||
- pytest=7.2.2
|
|
||||||
- python=3.11.3
|
|
||||||
- setuptools=67.6.1
|
|
||||||
- twine=4.0.2
|
|
||||||
- cryptography=38.0.4
|
|
@ -1,3 +0,0 @@
|
|||||||
[build-system]
|
|
||||||
build-backend = "setuptools.build_meta"
|
|
||||||
requires = ["setuptools", "wheel"]
|
|
@ -31,7 +31,6 @@ def rename(
|
|||||||
current: str,
|
current: str,
|
||||||
become: str,
|
become: str,
|
||||||
dry: bool,
|
dry: bool,
|
||||||
keep_extension: bool,
|
|
||||||
):
|
):
|
||||||
replacement_dict = {}
|
replacement_dict = {}
|
||||||
with open(csv_path, "r") as csv_fd:
|
with open(csv_path, "r") as csv_fd:
|
||||||
@ -55,8 +54,6 @@ def rename(
|
|||||||
os.path.dirname(subitem_path),
|
os.path.dirname(subitem_path),
|
||||||
re.sub(match.re, replacement_dict[match.group(1)], subitem),
|
re.sub(match.re, replacement_dict[match.group(1)], subitem),
|
||||||
)
|
)
|
||||||
if keep_extension:
|
|
||||||
objective += os.path.splitext(subitem_path)[1]
|
|
||||||
logging.info(f'Will rename "{original}" to "{os.path.basename(objective)}"')
|
logging.info(f'Will rename "{original}" to "{os.path.basename(objective)}"')
|
||||||
if os.path.exists(objective):
|
if os.path.exists(objective):
|
||||||
logging.error(
|
logging.error(
|
||||||
@ -122,13 +119,6 @@ def main():
|
|||||||
type=str,
|
type=str,
|
||||||
default="INFO",
|
default="INFO",
|
||||||
)
|
)
|
||||||
argparser.add_argument(
|
|
||||||
"-k",
|
|
||||||
"--keep-extension",
|
|
||||||
help="Keeps the original file's extension by appending it to the end of the "
|
|
||||||
"name defined by the CSV.",
|
|
||||||
action="store_true",
|
|
||||||
)
|
|
||||||
|
|
||||||
args = argparser.parse_args()
|
args = argparser.parse_args()
|
||||||
logging.basicConfig(
|
logging.basicConfig(
|
||||||
@ -136,9 +126,7 @@ def main():
|
|||||||
level=args.verbosity.upper(),
|
level=args.verbosity.upper(),
|
||||||
)
|
)
|
||||||
candidates = find_all_candidates(args.input_dir, args.regex, args.recursive)
|
candidates = find_all_candidates(args.input_dir, args.regex, args.recursive)
|
||||||
rename(
|
rename(args.csv, candidates, args.current, args.become, args.dry)
|
||||||
args.csv, candidates, args.current, args.become, args.dry, args.keep_extension
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
10
setup.cfg
10
setup.cfg
@ -1,10 +0,0 @@
|
|||||||
[metadata]
|
|
||||||
name = renamebycsv
|
|
||||||
version = 0.0.1
|
|
||||||
|
|
||||||
[options]
|
|
||||||
packages = renamebycsv
|
|
||||||
|
|
||||||
[options.entry_points]
|
|
||||||
console_scripts =
|
|
||||||
renamebycsv = renamebycsv.renamebycsv:main
|
|
Loading…
x
Reference in New Issue
Block a user