From 81af7b1c1b7a6141e0ebdea4cd65f89ce3ca5a03 Mon Sep 17 00:00:00 2001 From: BrianPetkovsek <16124109+BrianPetkovsek@users.noreply.github.com> Date: Sun, 16 Jun 2019 17:32:41 -0400 Subject: [PATCH 1/5] Fix encoding problem --- bin/exceptions.py | 2 ++ bin/ffmpeg.py | 2 ++ bin/image_cleaner.py | 2 ++ bin/upscaler.py | 2 ++ bin/video2x.py | 2 ++ bin/video2x_setup.py | 2 ++ bin/waifu2x_caffe.py | 2 ++ bin/waifu2x_converter.py | 2 ++ 8 files changed, 16 insertions(+) diff --git a/bin/exceptions.py b/bin/exceptions.py index 685bf67..29dc428 100644 --- a/bin/exceptions.py +++ b/bin/exceptions.py @@ -1,5 +1,7 @@ #!/usr/bin/env python3 # -*- coding: future_fstrings -*- + + """ Name: Video2X Exceptions Dev: K4YT3X diff --git a/bin/ffmpeg.py b/bin/ffmpeg.py index 9213757..2a3fe9d 100644 --- a/bin/ffmpeg.py +++ b/bin/ffmpeg.py @@ -1,5 +1,7 @@ #!/usr/bin/env python3 # -*- coding: future_fstrings -*- + + """ Name: FFMPEG Class Author: K4YT3X diff --git a/bin/image_cleaner.py b/bin/image_cleaner.py index 76bb536..b42d471 100644 --- a/bin/image_cleaner.py +++ b/bin/image_cleaner.py @@ -1,5 +1,7 @@ #!/usr/bin/env python3 # -*- coding: future_fstrings -*- + + """ Name: Video2X Image Cleaner Author: BrianPetkovsek diff --git a/bin/upscaler.py b/bin/upscaler.py index 69fcb0c..e4e7e2f 100644 --- a/bin/upscaler.py +++ b/bin/upscaler.py @@ -1,5 +1,7 @@ #!/usr/bin/env python3 # -*- coding: future_fstrings -*- + + """ Name: Video2X Upscaler Author: K4YT3X diff --git a/bin/video2x.py b/bin/video2x.py index 3b82fba..6100996 100644 --- a/bin/video2x.py +++ b/bin/video2x.py @@ -1,5 +1,7 @@ #!/usr/bin/env python3 # -*- coding: future_fstrings -*- + + """ __ __ _ _ ___ __ __ diff --git a/bin/video2x_setup.py b/bin/video2x_setup.py index a9dd21d..a25fcd6 100644 --- a/bin/video2x_setup.py +++ b/bin/video2x_setup.py @@ -1,5 +1,7 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- + + """ Name: Video2X Setup Script Author: K4YT3X diff --git a/bin/waifu2x_caffe.py b/bin/waifu2x_caffe.py index 47d8654..37e7f68 100644 --- a/bin/waifu2x_caffe.py +++ b/bin/waifu2x_caffe.py @@ -1,5 +1,7 @@ #!/usr/bin/env python3 # -*- coding: future_fstrings -*- + + """ Name: Waifu2x Caffe Driver Author: K4YT3X diff --git a/bin/waifu2x_converter.py b/bin/waifu2x_converter.py index d5fd376..d3d5ae3 100644 --- a/bin/waifu2x_converter.py +++ b/bin/waifu2x_converter.py @@ -1,5 +1,7 @@ #!/usr/bin/env python3 # -*- coding: future_fstrings -*- + + """ Name: Waifu2x Converter CPP Driver Author: K4YT3X From d25857a1783b15b185444d38e15805d4c27d96ae Mon Sep 17 00:00:00 2001 From: BrianPetkovsek <16124109+BrianPetkovsek@users.noreply.github.com> Date: Mon, 17 Jun 2019 12:05:06 -0400 Subject: [PATCH 2/5] Added uninstall function to setup --- bin/video2x_setup.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/bin/video2x_setup.py b/bin/video2x_setup.py index a25fcd6..27f0935 100644 --- a/bin/video2x_setup.py +++ b/bin/video2x_setup.py @@ -89,6 +89,7 @@ class Video2xSetup: def _install_python_requirements(self): """ Read requirements.txt and return its content """ + pip_uninstall('requirements.txt') pip_install('requirements.txt') def _cleanup(self): @@ -203,12 +204,19 @@ def download(url, save_path, chunk_size=4096): def pip_install(file): """ Install python package via python pip module - + pip.main() is not available after pip 9.0.1, thus pip module is not used in this case. """ return subprocess.run([sys.executable, '-m', 'pip', 'install', '-U', '-r', file]).returncode +def pip_uninstall(file): + """ Uninstall python package via python pip module + + pip.main() is not available after pip 9.0.1, thus + pip module is not used in this case. + """ + return subprocess.run([sys.executable, '-m', 'pip', 'uninstall', '-r', file, '-y']).returncode if __name__ == '__main__': try: From 53f51928962e988e2da06dfcddaa6b2e5adca3ef Mon Sep 17 00:00:00 2001 From: BrianPetkovsek <16124109+BrianPetkovsek@users.noreply.github.com> Date: Mon, 17 Jun 2019 22:33:27 -0400 Subject: [PATCH 3/5] Revert "Fix encoding problem" This reverts commit 81af7b1c1b7a6141e0ebdea4cd65f89ce3ca5a03. --- bin/exceptions.py | 2 -- bin/ffmpeg.py | 2 -- bin/image_cleaner.py | 2 -- bin/upscaler.py | 2 -- bin/video2x.py | 2 -- bin/video2x_setup.py | 2 -- bin/waifu2x_caffe.py | 2 -- bin/waifu2x_converter.py | 2 -- 8 files changed, 16 deletions(-) diff --git a/bin/exceptions.py b/bin/exceptions.py index 29dc428..685bf67 100644 --- a/bin/exceptions.py +++ b/bin/exceptions.py @@ -1,7 +1,5 @@ #!/usr/bin/env python3 # -*- coding: future_fstrings -*- - - """ Name: Video2X Exceptions Dev: K4YT3X diff --git a/bin/ffmpeg.py b/bin/ffmpeg.py index 2a3fe9d..9213757 100644 --- a/bin/ffmpeg.py +++ b/bin/ffmpeg.py @@ -1,7 +1,5 @@ #!/usr/bin/env python3 # -*- coding: future_fstrings -*- - - """ Name: FFMPEG Class Author: K4YT3X diff --git a/bin/image_cleaner.py b/bin/image_cleaner.py index b42d471..76bb536 100644 --- a/bin/image_cleaner.py +++ b/bin/image_cleaner.py @@ -1,7 +1,5 @@ #!/usr/bin/env python3 # -*- coding: future_fstrings -*- - - """ Name: Video2X Image Cleaner Author: BrianPetkovsek diff --git a/bin/upscaler.py b/bin/upscaler.py index e4e7e2f..69fcb0c 100644 --- a/bin/upscaler.py +++ b/bin/upscaler.py @@ -1,7 +1,5 @@ #!/usr/bin/env python3 # -*- coding: future_fstrings -*- - - """ Name: Video2X Upscaler Author: K4YT3X diff --git a/bin/video2x.py b/bin/video2x.py index 6100996..3b82fba 100644 --- a/bin/video2x.py +++ b/bin/video2x.py @@ -1,7 +1,5 @@ #!/usr/bin/env python3 # -*- coding: future_fstrings -*- - - """ __ __ _ _ ___ __ __ diff --git a/bin/video2x_setup.py b/bin/video2x_setup.py index 27f0935..29b7716 100644 --- a/bin/video2x_setup.py +++ b/bin/video2x_setup.py @@ -1,7 +1,5 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- - - """ Name: Video2X Setup Script Author: K4YT3X diff --git a/bin/waifu2x_caffe.py b/bin/waifu2x_caffe.py index 37e7f68..47d8654 100644 --- a/bin/waifu2x_caffe.py +++ b/bin/waifu2x_caffe.py @@ -1,7 +1,5 @@ #!/usr/bin/env python3 # -*- coding: future_fstrings -*- - - """ Name: Waifu2x Caffe Driver Author: K4YT3X diff --git a/bin/waifu2x_converter.py b/bin/waifu2x_converter.py index d3d5ae3..d5fd376 100644 --- a/bin/waifu2x_converter.py +++ b/bin/waifu2x_converter.py @@ -1,7 +1,5 @@ #!/usr/bin/env python3 # -*- coding: future_fstrings -*- - - """ Name: Waifu2x Converter CPP Driver Author: K4YT3X From d4d485e1328631b2957c01e778b25e456e13fcdc Mon Sep 17 00:00:00 2001 From: BrianPetkovsek <16124109+BrianPetkovsek@users.noreply.github.com> Date: Mon, 17 Jun 2019 22:34:45 -0400 Subject: [PATCH 4/5] Revert "Added uninstall function to setup" This reverts commit d25857a1783b15b185444d38e15805d4c27d96ae. --- bin/video2x_setup.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/bin/video2x_setup.py b/bin/video2x_setup.py index 29b7716..a9dd21d 100644 --- a/bin/video2x_setup.py +++ b/bin/video2x_setup.py @@ -87,7 +87,6 @@ class Video2xSetup: def _install_python_requirements(self): """ Read requirements.txt and return its content """ - pip_uninstall('requirements.txt') pip_install('requirements.txt') def _cleanup(self): @@ -202,19 +201,12 @@ def download(url, save_path, chunk_size=4096): def pip_install(file): """ Install python package via python pip module - + pip.main() is not available after pip 9.0.1, thus pip module is not used in this case. """ return subprocess.run([sys.executable, '-m', 'pip', 'install', '-U', '-r', file]).returncode -def pip_uninstall(file): - """ Uninstall python package via python pip module - - pip.main() is not available after pip 9.0.1, thus - pip module is not used in this case. - """ - return subprocess.run([sys.executable, '-m', 'pip', 'uninstall', '-r', file, '-y']).returncode if __name__ == '__main__': try: From 8fe6fd400910d2de578d8caa2a3ac8fa33117fbc Mon Sep 17 00:00:00 2001 From: BrianPetkovsek <16124109+BrianPetkovsek@users.noreply.github.com> Date: Mon, 17 Jun 2019 22:37:04 -0400 Subject: [PATCH 5/5] Fix encoding problem --- bin/exceptions.py | 2 ++ bin/ffmpeg.py | 2 ++ bin/image_cleaner.py | 2 ++ bin/upscaler.py | 2 ++ bin/video2x.py | 2 ++ bin/video2x_setup.py | 2 ++ bin/waifu2x_caffe.py | 2 ++ bin/waifu2x_converter.py | 2 ++ 8 files changed, 16 insertions(+) diff --git a/bin/exceptions.py b/bin/exceptions.py index 685bf67..29dc428 100644 --- a/bin/exceptions.py +++ b/bin/exceptions.py @@ -1,5 +1,7 @@ #!/usr/bin/env python3 # -*- coding: future_fstrings -*- + + """ Name: Video2X Exceptions Dev: K4YT3X diff --git a/bin/ffmpeg.py b/bin/ffmpeg.py index 9213757..2a3fe9d 100644 --- a/bin/ffmpeg.py +++ b/bin/ffmpeg.py @@ -1,5 +1,7 @@ #!/usr/bin/env python3 # -*- coding: future_fstrings -*- + + """ Name: FFMPEG Class Author: K4YT3X diff --git a/bin/image_cleaner.py b/bin/image_cleaner.py index 76bb536..b42d471 100644 --- a/bin/image_cleaner.py +++ b/bin/image_cleaner.py @@ -1,5 +1,7 @@ #!/usr/bin/env python3 # -*- coding: future_fstrings -*- + + """ Name: Video2X Image Cleaner Author: BrianPetkovsek diff --git a/bin/upscaler.py b/bin/upscaler.py index 69fcb0c..e4e7e2f 100644 --- a/bin/upscaler.py +++ b/bin/upscaler.py @@ -1,5 +1,7 @@ #!/usr/bin/env python3 # -*- coding: future_fstrings -*- + + """ Name: Video2X Upscaler Author: K4YT3X diff --git a/bin/video2x.py b/bin/video2x.py index 3b82fba..6100996 100644 --- a/bin/video2x.py +++ b/bin/video2x.py @@ -1,5 +1,7 @@ #!/usr/bin/env python3 # -*- coding: future_fstrings -*- + + """ __ __ _ _ ___ __ __ diff --git a/bin/video2x_setup.py b/bin/video2x_setup.py index a9dd21d..a25fcd6 100644 --- a/bin/video2x_setup.py +++ b/bin/video2x_setup.py @@ -1,5 +1,7 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- + + """ Name: Video2X Setup Script Author: K4YT3X diff --git a/bin/waifu2x_caffe.py b/bin/waifu2x_caffe.py index 47d8654..37e7f68 100644 --- a/bin/waifu2x_caffe.py +++ b/bin/waifu2x_caffe.py @@ -1,5 +1,7 @@ #!/usr/bin/env python3 # -*- coding: future_fstrings -*- + + """ Name: Waifu2x Caffe Driver Author: K4YT3X diff --git a/bin/waifu2x_converter.py b/bin/waifu2x_converter.py index d5fd376..d3d5ae3 100644 --- a/bin/waifu2x_converter.py +++ b/bin/waifu2x_converter.py @@ -1,5 +1,7 @@ #!/usr/bin/env python3 # -*- coding: future_fstrings -*- + + """ Name: Waifu2x Converter CPP Driver Author: K4YT3X