Compare commits

..

No commits in common. "9ed70b317d1de794d20a2eac92cb98c4ad4e5c07" and "867686fe9856b4df746efe02095afdc7fbfb0a81" have entirely different histories.

7 changed files with 1 additions and 86 deletions

26
Jenkinsfile vendored
View File

@ -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
View File

@ -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.

View File

@ -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

View File

@ -1,3 +0,0 @@
[build-system]
build-backend = "setuptools.build_meta"
requires = ["setuptools", "wheel"]

View File

@ -31,7 +31,6 @@ def rename(
current: str,
become: str,
dry: bool,
keep_extension: bool,
):
replacement_dict = {}
with open(csv_path, "r") as csv_fd:
@ -55,8 +54,6 @@ def rename(
os.path.dirname(subitem_path),
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)}"')
if os.path.exists(objective):
logging.error(
@ -122,13 +119,6 @@ def main():
type=str,
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()
logging.basicConfig(
@ -136,9 +126,7 @@ def main():
level=args.verbosity.upper(),
)
candidates = find_all_candidates(args.input_dir, args.regex, args.recursive)
rename(
args.csv, candidates, args.current, args.become, args.dry, args.keep_extension
)
rename(args.csv, candidates, args.current, args.become, args.dry)
if __name__ == "__main__":

View File

@ -1,10 +0,0 @@
[metadata]
name = renamebycsv
version = 0.0.1
[options]
packages = renamebycsv
[options.entry_points]
console_scripts =
renamebycsv = renamebycsv.renamebycsv:main

View File

@ -1,2 +0,0 @@
from setuptools import setup
setup()