From 4be37fbb2a85f82d57d2f16a64daa945589ed560 Mon Sep 17 00:00:00 2001 From: mstuttgart Date: Mon, 2 May 2016 03:31:33 -0300 Subject: [PATCH 01/14] Update README --- README.md | 8 ++++---- setup.py | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 53c0aedb..5beee9bd 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ Pynocchio Comic Reader ================== -[![Build Status](https://travis-ci.org/mstuttgart/pynocchio-comic-reader.svg?branch=master)](https://travis-ci.org/mstuttgart/pynocchio-comic-reader) -[![Coverage Status](https://coveralls.io/repos/github/mstuttgart/pynocchio-comic-reader/badge.svg?branch=master)](https://coveralls.io/github/mstuttgart/pynocchio-comic-reader?branch=master) -[![Code Health](https://landscape.io/github/mstuttgart/pynocchio-comic-reader/master/landscape.svg?style=flat)](https://landscape.io/github/mstuttgart/pynocchio-comic-reader/master) -[![Github All Releases](https://img.shields.io/github/downloads/mstuttgart/pynocchio-comic-reader/total.svg?maxAge=2592000?style=plastic)](https://github.com/mstuttgart/pynocchio-comic-reader/releases) +[![Build Status](https://travis-ci.org/mstuttgart/pynocchio-comic-reader.svg?branch=develop)](https://travis-ci.org/mstuttgart/pynocchio-comic-reader) +[![Coverage Status](https://coveralls.io/repos/github/mstuttgart/pynocchio-comic-reader/badge.svg?branch=develop)](https://coveralls.io/github/mstuttgart/pynocchio-comic-reader?branch=develop) +[![Code Health](https://landscape.io/github/mstuttgart/pynocchio-comic-reader/develop/landscape.svg?style=flat)](https://landscape.io/github/mstuttgart/pynocchio-comic-reader/develop) +[![Project Status](https://img.shields.io/badge/status-development-yellow.svg)](https://github.com/mstuttgart/pynocchio-comic-reader/tree/develop) [![AUR](https://img.shields.io/aur/license/yaourt.svg?maxAge=2592000?style=plastic)](https://pt.wikipedia.org/wiki/GNU_General_Public_License) Pynocchio is a image viewer specialized in manga/comic reading diff --git a/setup.py b/setup.py index 1ab0eede..2bf73ad9 100644 --- a/setup.py +++ b/setup.py @@ -104,7 +104,6 @@ def finalize_options(self): self.path) def run(self): - print "[INFO] Start compile ui files..." uic_folder = 'pynocchio/src/uic_files' @@ -142,7 +141,6 @@ def finalize_options(self): self.path) def run(self): - print "[INFO] Compile qrc files..." uic_folder = 'pynocchio/src/uic_files' @@ -177,6 +175,7 @@ def finalize_options(self): os.system('rm -rf %s' % self.folder) def run(self): + # TODO: Add upload launchpad command print "[INFO] Compile a deb package..." @@ -185,9 +184,10 @@ def run(self): os.system('cp -r pynocchio linux %s' % self.folder) os.system('cd %s && python setup.py --command-packages=stdeb.command ' 'sdist_dsc' % self.folder) - os.system('cd %s/deb_dist && dpkg-source -x %s_%s-1.dsc' % (self.folder, - package_name, - version)) + os.system( + 'cd %s/deb_dist && dpkg-source -x %s_%s-1.dsc' % (self.folder, + package_name, + version)) os.system('cd %s/deb_dist/%s-%s && debuild -S -sa' % (self.folder, package_name, version)) From b7ee699cacadddbb1dd1ec6a0ce14d7885c206fb Mon Sep 17 00:00:00 2001 From: mstuttgart Date: Mon, 2 May 2016 14:14:58 -0300 Subject: [PATCH 02/14] Update pynocchio.pro --- pynocchio.pro | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/pynocchio.pro b/pynocchio.pro index f544e82d..c5ee09ab 100644 --- a/pynocchio.pro +++ b/pynocchio.pro @@ -1,16 +1,16 @@ -SOURCES = src/lib/main_window_view.py \ -src/lib/bookmark_manager_dialog.py \ -src/lib/go_to_page_dialog.py \ -src/lib/preference_dialog.py \ -src/lib/uic_files/custom_widgets/status_bar.py +SOURCES = pynocchio/src/main_window_view.py \ +pynocchio/src/bookmark_manager_dialog.py \ +pynocchio/src/go_to_page_dialog.py \ +pynocchio/src/preference_dialog.py \ +pynocchio/src/uic_files/custom_widgets/status_bar.py -FORMS = resources/ui_files/about_dialog.ui \ -resources/ui_files/bookmark_manager_dialog.ui \ -resources/ui_files/go_to_page_dialog.ui \ -resources/ui_files/preference_dialog.ui \ -resources/ui_files/main_window_view.ui +FORMS = data/ui_files/about_dialog.ui \ +data/ui_files/bookmark_manager_dialog.ui \ +data/ui_files/go_to_page_dialog.ui \ +data/ui_files/preference_dialog.ui \ +data/ui_files/main_window_view.ui TRANSLATIONS = i18n/pynocchio_en_US.ts i18n/pynocchio_pt_BR.ts -RESOURCES += resources/main_window_view.qrc +RESOURCES += data/main_window_view.qrc From 42553d6f029fc9c4063f2e619cdcf37311fb7fae Mon Sep 17 00:00:00 2001 From: mstuttgart Date: Mon, 2 May 2016 14:47:28 -0300 Subject: [PATCH 03/14] Vaiable name adjust --- pynocchio/src/main_window_model.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/pynocchio/src/main_window_model.py b/pynocchio/src/main_window_model.py index 3b13143d..0f933d43 100644 --- a/pynocchio/src/main_window_model.py +++ b/pynocchio/src/main_window_model.py @@ -71,26 +71,26 @@ def load(self, filename, initial_page=0): image_extensions = ['.bmp', '.jpg', '.jpeg', '.gif', '.png', '.pbm', '.pgm', '.ppm', '.tiff', '.xbm', '.xpm', '.webp'] - ld = LoaderFactory.create_loader( + loader = LoaderFactory.create_loader( Utility.get_file_extension(filename), set(image_extensions)) - ld.progress.connect(self.load_progressbar_value) + loader.progress.connect(self.load_progressbar_value) try: - ld.load(filename) + loader.load(filename) except NoDataFindException as excp: # Caso nao exista nenhuma imagem, carregamos a imagem indicando # erro - from page import Page + from pynocchio.src.page import Page print excp.message q_file = QtCore.QFile(":/icons/notCover.png") q_file.open(QtCore.QIODevice.ReadOnly) - ld.data.append(Page(q_file.readAll(), 'exit_red_1.png', 0)) + loader.data.append(Page(q_file.readAll(), 'exit_red_1.png', 0)) self.comic = Comic(Utility.get_base_name(filename), Utility.get_dir_name(filename), initial_page) - self.comic.pages = ld.data + self.comic.pages = loader.data self.current_directory = Utility.get_dir_name(filename) self.path_file_filter.parse(filename) @@ -217,9 +217,9 @@ def save_settings(self): self.save_current_directory(self.current_directory) @staticmethod - def get_bookmark_list(n): + def get_bookmark_list(qty): BookmarkManager.connect() - bookmark_list = BookmarkManager.get_bookmarks(n) + bookmark_list = BookmarkManager.get_bookmarks(qty) BookmarkManager.close() return bookmark_list @@ -232,9 +232,9 @@ def is_bookmark(self): @staticmethod def get_bookmark_from_path(path): BookmarkManager.connect() - bk = BookmarkManager.get_bookmark_by_path(path) + bookmark = BookmarkManager.get_bookmark_by_path(path) BookmarkManager.close() - return bk + return bookmark def add_bookmark(self): if self.comic: From cf2980628f5e51116f1bff0b0abfd42194fd168b Mon Sep 17 00:00:00 2001 From: mstuttgart Date: Mon, 2 May 2016 15:03:17 -0300 Subject: [PATCH 04/14] [NEW] Added Launchpad upload option add compile .pro option in seyup.py --- i18n/pynocchio_en_US.ts | 230 ++++++++++++++++++++-------------------- i18n/pynocchio_pt_BR.ts | 230 ++++++++++++++++++++-------------------- setup.py | 39 ++++++- 3 files changed, 267 insertions(+), 232 deletions(-) diff --git a/i18n/pynocchio_en_US.ts b/i18n/pynocchio_en_US.ts index 6d44b97e..b3bf273b 100644 --- a/i18n/pynocchio_en_US.ts +++ b/i18n/pynocchio_en_US.ts @@ -8,42 +8,42 @@ About Pynocchio Reader - + About About - + GPLv3 GPLv3 - + License type: License type: - + (c) 2014 -2016 Michell Stuttgart (c) 2014 -2016 Michell Stuttgart - + Version: Version: - + Developer: Developer: - + Copyright: Copyright: - + Michell Stuttgart Michell Stuttgart @@ -53,7 +53,7 @@ 1.2.0 - + Pynocchio Comic Reader Pynocchio Comic Reader @@ -63,12 +63,12 @@ The Pynocchio Comic Reader is an comic and manga reader. - + License License - + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } @@ -751,37 +751,37 @@ p, li { white-space: pre-wrap; } - + Others Others - + <html><head/><body><p>Pynocchio use <a href="Free Icon Maker"><span style=" text-decoration: underline; color:#0000ff;">http://freeiconmaker.com</span></a> to build icon set. </p><p>Icons pack by <a href="https://github.com/opengraphix/elementary3-icon-theme"><span style=" text-decoration: underline; color:#0000ff;">Elementary Icon</span></a> theme.</p></body></html> - + Close Close - + About Pynocchio About Pynocchio - + 0.0.1 - + The Pynocchio is an comic and manga reader. The Pynocchio Comic Reader is an comic and manga reader. - + <a href=https://github.com/mstuttgart/pynocchio-comic-reader>Pynocchio Comic Reader</a> @@ -789,12 +789,12 @@ p, li { white-space: pre-wrap; } BookmarkManagerDialog - + Delete bookmarks Delete bookmarks - + This action will go delete you bookmarks! Preceed? This action will go delete you bookmarks! Preceed? @@ -802,27 +802,27 @@ p, li { white-space: pre-wrap; } Bookmark_Dialog - + Bookmark manager Bookmark Manager - + Page Preview Page Preview - + Remove Remove - + Cancel Cancel - + Load Load @@ -830,22 +830,22 @@ p, li { white-space: pre-wrap; } GoPageDialog - + Go to Page Go to Page - + Number of pages: Number of pages: - + Current page: Current page: - + Go to page: Go to page: @@ -853,47 +853,47 @@ p, li { white-space: pre-wrap; } MainWindowView - + open_comic_file Open Comic File - + all_supported_files (*.zip *.cbz *.rar *.cbr *.tar *.cbt);; zip_files (*.zip *.cbz);; rar_files (*.rar *.cbr);; tar_files (*.tar *.cbt);; all_files (*) All supported.files (*.zip *.cbz *.rar *.cbr *.tar *.cbt);; Zip.files (*.zip *.cbz);; Rar files (*.rar *.cbr);; Tar files (*.tar *.cbt);; All files (*) - + save_current_page Save current page - + images (*.png *.xpm *.jpeg *.jpg *.gif) Images (*.png *.xpm *.jpeg *.jpg *.gif) - + LoadComicsException - + InvalidTypeFileException - + Pynocchio Comic Reader Pynocchio Comic Reader - + The Best Comic Reader The Best Comic Reader - + &File &File @@ -903,22 +903,22 @@ p, li { white-space: pre-wrap; } &Recent files - + &View &View - + &Navegation &Navegation - + &Help &Help - + &Settings &Settings @@ -928,7 +928,7 @@ p, li { white-space: pre-wrap; } Language - + &Bookmarks &Bookmarks @@ -938,7 +938,7 @@ p, li { white-space: pre-wrap; } Recente bookmarks - + toolBar toolBar @@ -958,7 +958,7 @@ p, li { white-space: pre-wrap; } &Exit - + Ctrl+Q @@ -968,7 +968,7 @@ p, li { white-space: pre-wrap; } &Next page - + Right Right @@ -978,7 +978,7 @@ p, li { white-space: pre-wrap; } &Previous page - + Left Left @@ -988,7 +988,7 @@ p, li { white-space: pre-wrap; } &First page - + Ctrl+Left Ctrl+Left @@ -998,7 +998,7 @@ p, li { white-space: pre-wrap; } &Last page - + Ctrl+Right Ctrl+Right @@ -1008,7 +1008,7 @@ p, li { white-space: pre-wrap; } &Rotate left - + Ctrl+Shift+R Ctrl+Shift+R @@ -1018,7 +1018,7 @@ p, li { white-space: pre-wrap; } &Rotate right - + Ctrl+R Ctrl+R @@ -1028,7 +1028,7 @@ p, li { white-space: pre-wrap; } &Horizontal fit - + Ctrl+K Ctrl+K @@ -1038,7 +1038,7 @@ p, li { white-space: pre-wrap; } &Fullscreen - + F F @@ -1048,7 +1048,7 @@ p, li { white-space: pre-wrap; } &Go to page... - + Ctrl+G Ctrl+G @@ -1058,7 +1058,7 @@ p, li { white-space: pre-wrap; } &Original fit - + Ctrl+H Ctrl+H @@ -1088,27 +1088,27 @@ p, li { white-space: pre-wrap; } Open &Folder - + Next Comic Next Comic - + Ctrl+Shift+Right Ctrl+Shift+Right - + Previous Comic Previous Comic - + Ctrl+Shift+Left Ctrl+Shift+Left - + Preferences Preferences @@ -1118,7 +1118,7 @@ p, li { white-space: pre-wrap; } &Vertical fit - + Ctrl+J Ctrl+J @@ -1128,7 +1128,7 @@ p, li { white-space: pre-wrap; } &Best fit - + Ctrl+L Ctrl+L @@ -1138,12 +1138,12 @@ p, li { white-space: pre-wrap; } &Save image - + Save current image in disk. Save current image in disk. - + Ctrl+S Ctrl+S @@ -1153,157 +1153,157 @@ p, li { white-space: pre-wrap; } &Open File - + Ctrl+O Ctrl+O - + recent_file_1 - + recent_file_2 - + recent_file_3 - + recent_file_4 - + recent_file_5 - + recent_file_6 - + recent_file_7 - + recent_file_8 - + recent_file_9 - + recent_file_10 - + recent_bookmark_1 - + recent_bookmark_2 - + recent_bookmark_3 - + recent_bookmark_4 - + recent_bookmark_5 - + English English - + Portuguese Portuguese - + Show Toolbar Show Toolbar - + Horizontal fit Horizontal fit - + en_US - + About Pynocchio About Pynocchio - + About Qt About Qt - + Exit Exit - + Next page Next page - + Previous page Previous page - + First page First page - + Last page Last page - + Rotate left Rotate left - + Rotate right Rotate right - + Fullscreen Fullscreen @@ -1313,67 +1313,67 @@ p, li { white-space: pre-wrap; } Go to Page - + Original fit Original fit - + Show Statusbar Show Toolbar - + Add bookmark Add bookmark - + Remove bookmark Remove bookmark - + Open Folder Open Folder - + Vertical fit Vertical fit - + Best fit Best fit - + Save image Save image - + Open File Open File - + Recent files Recent files - + Go to page Go to Page - + Recente bookmarks Recente bookmarks - + Bookmark manager Bookmark Manager @@ -1381,17 +1381,17 @@ p, li { white-space: pre-wrap; } StatusBar - + Page: Page: - + Resolution: Resolution: - + Title: Title: @@ -1399,22 +1399,22 @@ p, li { white-space: pre-wrap; } config_dialog - + Pynocchio Preferences Pynocchio Preferences - + General General - + <html><head/><body><p>Background color: </p></body></html> - + Close Close diff --git a/i18n/pynocchio_pt_BR.ts b/i18n/pynocchio_pt_BR.ts index b6135f96..cb6126aa 100644 --- a/i18n/pynocchio_pt_BR.ts +++ b/i18n/pynocchio_pt_BR.ts @@ -8,12 +8,12 @@ Sobre Pynocchio Comic Reader - + About Sobre - + Close Fechar @@ -31,37 +31,37 @@ exclusivamente para leitura de arquivos .zip , cbr , rar projetado para leitura de revista em quadrinhos.</p><p>Lê arquivos nos formatos CBR, ZIP, CBZ, RAR e TAR.</p><p><a href="http://mstuttgart.github.io/pynocchio-comic-reader/"> <span style="text-decoration: underline; color:#0000ff;"> Pynocchio Comic Reader</span></a> é licenciado sob a GNU General Public License.</p><p>Copyright (C) 2014-2015 <a href="https://github.com/mstuttgart"> <span style="text-decoration: underline; color:#0000ff;"> Michell Stuttgart Faria</span></a></p><p>Pynocchio use <a href="file:///home/michell/Projetos/pynocchio-comic-reader/yacreader/files/Free%20Icon%20Maker"> <span style="text-decoration: underline; color:#0000ff;"> http://freeiconmaker.com</span></a> para construir o conjunto de ícones.</p><p>Pacote de ícones por Icons Sweets 2 e o pacote gratuito Streamline Icone Set .</p></p> - + GPLv3 - + License type: Tipo de licença: - + Version: Versão: - + Developer: Desenvolvedor: - + Copyright: - + Michell Stuttgart - + Pynocchio Comic Reader @@ -71,22 +71,22 @@ projetado para leitura de revista em quadrinhos.</p><p>Lê arquivos Pynocchio.Comic.Reader é um leitor de mangás e histórias em quadrinhos. - + License - + Others Outros - + (c) 2014 -2016 Michell Stuttgart - + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } @@ -769,27 +769,27 @@ p, li { white-space: pre-wrap; } - + <html><head/><body><p>Pynocchio use <a href="Free Icon Maker"><span style=" text-decoration: underline; color:#0000ff;">http://freeiconmaker.com</span></a> to build icon set. </p><p>Icons pack by <a href="https://github.com/opengraphix/elementary3-icon-theme"><span style=" text-decoration: underline; color:#0000ff;">Elementary Icon</span></a> theme.</p></body></html> - + About Pynocchio Sobre Pynocchio - + 0.0.1 - + The Pynocchio is an comic and manga reader. Pynocchio.Comic.Reader é um leitor de mangás e histórias em quadrinhos. - + <a href=https://github.com/mstuttgart/pynocchio-comic-reader>Pynocchio Comic Reader</a> @@ -797,12 +797,12 @@ p, li { white-space: pre-wrap; } BookmarkManagerDialog - + Delete bookmarks Deletar favoritos - + This action will go delete you bookmarks! Preceed? Esta ação irá deletar seus favoritos! Deseja continuar? @@ -845,7 +845,7 @@ p, li { white-space: pre-wrap; } Abrir - + Remove Remover @@ -860,22 +860,22 @@ p, li { white-space: pre-wrap; } Fechar - + Load Carregar - + Bookmark manager Gerenciar favoritos - + Page Preview Visualização - + Cancel Cancelar @@ -883,7 +883,7 @@ p, li { white-space: pre-wrap; } GoPageDialog - + Go to Page Ir para a página @@ -893,17 +893,17 @@ p, li { white-space: pre-wrap; } Visualização - + Number of pages: Número de páginas: - + Current page: Página atual: - + Go to page: Ir para a página: @@ -1139,12 +1139,12 @@ p, li { white-space: pre-wrap; } Sobre Pynocchio Comic Reader - + About Qt Sobre o Qt - + &File &Arquivo @@ -1154,27 +1154,27 @@ p, li { white-space: pre-wrap; } A&rquivos recentes - + &View &Visualizar - + &Navegation &Navegação - + &Help A&juda - + &Settings &Configuração - + &Bookmarks &Favoritos @@ -1269,22 +1269,22 @@ p, li { white-space: pre-wrap; } Gerenciar favoritos - + Next Comic Próximo quadrinho - + Previous Comic Quadrinho anterior - + Preferences Preferências - + The Best Comic Reader O melhor leitor de quadrinhos @@ -1319,7 +1319,7 @@ p, li { white-space: pre-wrap; } Salvar imagem - + Save current image in disk. Salvar imagem atual no disco. @@ -1329,37 +1329,37 @@ p, li { white-space: pre-wrap; } Abrir online - + open_comic_file Abrir quadrinho - + all_supported_files (*.zip *.cbz *.rar *.cbr *.tar *.cbt);; zip_files (*.zip *.cbz);; rar_files (*.rar *.cbr);; tar_files (*.tar *.cbt);; all_files (*) Todos os arquivosa suportadoss (*.zip *.cbz *.rar *.cbr *.tar *.cbt);; Arquivos zip (*.zip *.cbz);; Arquivos rar (*.rar *.cbr);; Arquivos tar (*.tar *.cbt);; Todos osarquivos (*) - + save_current_page Salvar página atual - + images (*.png *.xpm *.jpeg *.jpg *.gif) Imagens (*.png *.xpm *.jpeg *.jpg *.gif) - + LoadComicsException - + InvalidTypeFileException - + Pynocchio Comic Reader @@ -1369,87 +1369,87 @@ p, li { white-space: pre-wrap; } Idioma - + toolBar - + Ctrl+Q - + Right Right - + Left Left - + Ctrl+Left Ctrl+Left - + Ctrl+Right Ctrl+Right - + Ctrl+Shift+R - + Ctrl+R Ctrl+R - + Ctrl+K - + F F - + Ctrl+G Ctrl+G - + Ctrl+H Ctrl+H - + Ctrl+Shift+Right Ctrl+Shift+Right - + Ctrl+Shift+Left Ctrl+Shift+Left - + Ctrl+J Ctrl+J - + Ctrl+L Ctrl+L - + Ctrl+S Ctrl+S @@ -1459,152 +1459,152 @@ p, li { white-space: pre-wrap; } &Abrir Aquivo - + Ctrl+O Ctrl+O - + recent_file_1 - + recent_file_2 - + recent_file_3 - + recent_file_4 - + recent_file_5 - + recent_file_6 - + recent_file_7 - + recent_file_8 - + recent_file_9 - + recent_file_10 - + recent_bookmark_1 - + recent_bookmark_2 - + recent_bookmark_3 - + recent_bookmark_4 - + recent_bookmark_5 - + English Inglês - + Portuguese Português - + Show Toolbar Exibir barra de status - + Horizontal fit Ajuste horizontal - + en_US - + About Pynocchio Sobre Pynocchio - + Exit Sair - + Next page Próxima página - + Previous page Página anterior - + First page Primeira página - + Last page Última página - + Rotate left Rotacionar para esquerda - + Rotate right Rotacionar para direita - + Fullscreen Tela cheia @@ -1614,67 +1614,67 @@ p, li { white-space: pre-wrap; } Ir para a página - + Original fit Tamanho original - + Show Statusbar Exibir barra de status - + Add bookmark Adicionar aos favoritos - + Remove bookmark Remover dos favoritos - + Open Folder Abrir diretorio - + Vertical fit Ajuste vertical - + Best fit Melhor ajuste - + Save image Salvar imagem - + Open File Abrir Aquivo - + Recent files Arquivos recentes - + Go to page Ir para a página - + Recente bookmarks Favoritos recentes - + Bookmark manager Gerenciar favoritos @@ -1682,17 +1682,17 @@ p, li { white-space: pre-wrap; } StatusBar - + Page: Página: - + Resolution: Resolução: - + Title: Título: @@ -1705,7 +1705,7 @@ p, li { white-space: pre-wrap; } Preferências - + General Geral @@ -1740,17 +1740,17 @@ p, li { white-space: pre-wrap; } Exibir barra de status no modo tela cheia - + Close Fechar - + Pynocchio Preferences Pynocchio preferências - + <html><head/><body><p>Background color: </p></body></html> diff --git a/setup.py b/setup.py index 2bf73ad9..3ac1a69c 100644 --- a/setup.py +++ b/setup.py @@ -151,7 +151,33 @@ def run(self): print '[INFO] Compile %s file' % f[0] print '[INFO] rc files added in %s' % uic_folder - print '[INFO] Compile qrc files successfully!' + sys.exit() + + +class CompileProFileCommand(distutils.cmd.Command): + """ + A command to compile pro condig files. + """ + + description = "Compile PySide pro files" + + # The format is (long option, short option, description). + user_options = [ + ('path=', None, 'The path of pro files folder'), + ] + + def initialize_options(self): + self.path = 'pynocchio.pro' + + def finalize_options(self): + assert os.path.isfile(self.path), ('[INFO] %s not is valid file!' % + self.path) + assert os.path.exists(self.path), ('[INFO] File %s not exist!' % + self.path) + + def run(self): + print "[INFO] Compile pro files..." + os.system('pyside-lupdate -verbose %s' % self.path) sys.exit() @@ -165,17 +191,20 @@ class BuildDEBPackageCommand(distutils.cmd.Command): # The format is (long option, short option, description). user_options = [ ('folder=', None, 'The folder where deb package will be build'), + ('upload=', None, 'Upload package to launchpad'), ] def initialize_options(self): self.folder = 'dist' + self.upload = False def finalize_options(self): if os.path.isdir(self.folder) and os.path.lexists(self.folder): os.system('rm -rf %s' % self.folder) + assert self.upload in (True, False) + def run(self): - # TODO: Add upload launchpad command print "[INFO] Compile a deb package..." @@ -191,6 +220,11 @@ def run(self): os.system('cd %s/deb_dist/%s-%s && debuild -S -sa' % (self.folder, package_name, version)) + + if self.upload: + os.system('dput ppa:pynocchio-team/pynocchio-stable ' + '%s_%s-1_source.changes' % (package_name, version)) + sys.exit() @@ -212,6 +246,7 @@ def run(self): cmdclass={ 'compile_ui': CompileUiFileCommand, 'compile_qrc': CompileQrcFileCommand, + 'compile_pro': CompileProFileCommand, 'build_deb': BuildDEBPackageCommand, }, scripts=[ From bc2189358153491f0aa8b33e7fbb57db82034f80 Mon Sep 17 00:00:00 2001 From: mstuttgart Date: Mon, 2 May 2016 15:04:41 -0300 Subject: [PATCH 05/14] Script folder removed --- scripts/compile_ui.sh | 12 ------------ 1 file changed, 12 deletions(-) delete mode 100755 scripts/compile_ui.sh diff --git a/scripts/compile_ui.sh b/scripts/compile_ui.sh deleted file mode 100755 index 7fb8fd04..00000000 --- a/scripts/compile_ui.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash -cd .. - -pyside-rcc -verbose -o pynocchio/src/uic_files/main_window_view_rc.py data/main_window_view.qrc - -pyside-uic data/ui_files/main_window_view.ui -o pynocchio/src/uic_files/ui_main_window_view.py -pyside-uic data/ui_files/go_to_page_dialog.ui -o pynocchio/src/uic_files/ui_go_to_page_dialog.py -pyside-uic data/ui_files/about_dialog.ui -o pynocchio/src/uic_files/ui_about_dialog.py -pyside-uic data/ui_files/preference_dialog.ui -o pynocchio/src/uic_files/ui_preference_dialog.py -pyside-uic data/ui_files/bookmark_manager_dialog.ui -o pynocchio/src/uic_files/ui_bookmark_manager_dialog.py - -pyside-lupdate -verbose pynocchio.pro From 62cf9e753697c687ca4012acb37a76cc5c3fbf20 Mon Sep 17 00:00:00 2001 From: mstuttgart Date: Mon, 2 May 2016 15:38:01 -0300 Subject: [PATCH 06/14] Update README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5beee9bd..734ee0f5 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ Pynocchio Comic Reader [![Build Status](https://travis-ci.org/mstuttgart/pynocchio-comic-reader.svg?branch=develop)](https://travis-ci.org/mstuttgart/pynocchio-comic-reader) [![Coverage Status](https://coveralls.io/repos/github/mstuttgart/pynocchio-comic-reader/badge.svg?branch=develop)](https://coveralls.io/github/mstuttgart/pynocchio-comic-reader?branch=develop) [![Code Health](https://landscape.io/github/mstuttgart/pynocchio-comic-reader/develop/landscape.svg?style=flat)](https://landscape.io/github/mstuttgart/pynocchio-comic-reader/develop) -[![Project Status](https://img.shields.io/badge/status-development-yellow.svg)](https://github.com/mstuttgart/pynocchio-comic-reader/tree/develop) +[![GitHub release](https://img.shields.io/github/release/qubyte/rubidium.svg?maxAge=2592000?style=plastic)](https://github.com/pynocchio/pynocchio-comic-reader) [![AUR](https://img.shields.io/aur/license/yaourt.svg?maxAge=2592000?style=plastic)](https://pt.wikipedia.org/wiki/GNU_General_Public_License) Pynocchio is a image viewer specialized in manga/comic reading From ad75b3f77c7e29a7374127f1f42be9b1346e57a0 Mon Sep 17 00:00:00 2001 From: Michell Stuttgart Date: Mon, 2 May 2016 15:42:03 -0300 Subject: [PATCH 07/14] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 734ee0f5..2cc7bfba 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ Pynocchio Comic Reader [![Build Status](https://travis-ci.org/mstuttgart/pynocchio-comic-reader.svg?branch=develop)](https://travis-ci.org/mstuttgart/pynocchio-comic-reader) [![Coverage Status](https://coveralls.io/repos/github/mstuttgart/pynocchio-comic-reader/badge.svg?branch=develop)](https://coveralls.io/github/mstuttgart/pynocchio-comic-reader?branch=develop) [![Code Health](https://landscape.io/github/mstuttgart/pynocchio-comic-reader/develop/landscape.svg?style=flat)](https://landscape.io/github/mstuttgart/pynocchio-comic-reader/develop) -[![GitHub release](https://img.shields.io/github/release/qubyte/rubidium.svg?maxAge=2592000?style=plastic)](https://github.com/pynocchio/pynocchio-comic-reader) +[![GitHub release](https://img.shields.io/github/release/pynocchio/pynocchio-comic-reader.svg?maxAge=2592000?style=plastic)](https://github.com/pynocchio/pynocchio-comic-reader) [![AUR](https://img.shields.io/aur/license/yaourt.svg?maxAge=2592000?style=plastic)](https://pt.wikipedia.org/wiki/GNU_General_Public_License) Pynocchio is a image viewer specialized in manga/comic reading From a687a165929cdc0c56ff987855741e0f3f3e6bb5 Mon Sep 17 00:00:00 2001 From: mstuttgart Date: Tue, 3 May 2016 00:35:57 -0300 Subject: [PATCH 08/14] [FIX] Adjust in setup.py [FIX] Somplify structure of linux folder [FIX] main file renamed to pynocchio --- .../share => }/applications/pynocchio.desktop | 0 .../hicolor/128x128/apps/pynocchio.png | Bin .../hicolor/16x16/apps/pynocchio.png | Bin .../hicolor/256x256/apps/pynocchio.png | Bin .../hicolor/32x32/apps/pynocchio.png | Bin .../hicolor/48x48/apps/pynocchio.png | Bin .../share => }/pixmaps/pynocchio_icon.png | Bin pynocchio/__init__.py | 2 +- pynocchio/{main => pynocchio} | 0 setup.py | 68 ++++++++++++------ stdeb.cfg | 5 +- 11 files changed, 48 insertions(+), 27 deletions(-) rename linux/{usr/share => }/applications/pynocchio.desktop (100%) rename linux/{usr/share/icons => }/hicolor/128x128/apps/pynocchio.png (100%) rename linux/{usr/share/icons => }/hicolor/16x16/apps/pynocchio.png (100%) rename linux/{usr/share/icons => }/hicolor/256x256/apps/pynocchio.png (100%) rename linux/{usr/share/icons => }/hicolor/32x32/apps/pynocchio.png (100%) rename linux/{usr/share/icons => }/hicolor/48x48/apps/pynocchio.png (100%) rename linux/{usr/share => }/pixmaps/pynocchio_icon.png (100%) rename pynocchio/{main => pynocchio} (100%) diff --git a/linux/usr/share/applications/pynocchio.desktop b/linux/applications/pynocchio.desktop similarity index 100% rename from linux/usr/share/applications/pynocchio.desktop rename to linux/applications/pynocchio.desktop diff --git a/linux/usr/share/icons/hicolor/128x128/apps/pynocchio.png b/linux/hicolor/128x128/apps/pynocchio.png similarity index 100% rename from linux/usr/share/icons/hicolor/128x128/apps/pynocchio.png rename to linux/hicolor/128x128/apps/pynocchio.png diff --git a/linux/usr/share/icons/hicolor/16x16/apps/pynocchio.png b/linux/hicolor/16x16/apps/pynocchio.png similarity index 100% rename from linux/usr/share/icons/hicolor/16x16/apps/pynocchio.png rename to linux/hicolor/16x16/apps/pynocchio.png diff --git a/linux/usr/share/icons/hicolor/256x256/apps/pynocchio.png b/linux/hicolor/256x256/apps/pynocchio.png similarity index 100% rename from linux/usr/share/icons/hicolor/256x256/apps/pynocchio.png rename to linux/hicolor/256x256/apps/pynocchio.png diff --git a/linux/usr/share/icons/hicolor/32x32/apps/pynocchio.png b/linux/hicolor/32x32/apps/pynocchio.png similarity index 100% rename from linux/usr/share/icons/hicolor/32x32/apps/pynocchio.png rename to linux/hicolor/32x32/apps/pynocchio.png diff --git a/linux/usr/share/icons/hicolor/48x48/apps/pynocchio.png b/linux/hicolor/48x48/apps/pynocchio.png similarity index 100% rename from linux/usr/share/icons/hicolor/48x48/apps/pynocchio.png rename to linux/hicolor/48x48/apps/pynocchio.png diff --git a/linux/usr/share/pixmaps/pynocchio_icon.png b/linux/pixmaps/pynocchio_icon.png similarity index 100% rename from linux/usr/share/pixmaps/pynocchio_icon.png rename to linux/pixmaps/pynocchio_icon.png diff --git a/pynocchio/__init__.py b/pynocchio/__init__.py index 84849674..cacb4239 100644 --- a/pynocchio/__init__.py +++ b/pynocchio/__init__.py @@ -16,7 +16,7 @@ # with this program. If not, see . __title__ = 'Pynocchio Comic Reader' -__version__ = '0.0.1.5' +__version__ = '0.0.1' __author__ = 'Michell Stuttgart Faria' __license__ = 'GPL v3' __copyright__ = 'Copyright 2014-2016 Michell Stuttgart Faria' diff --git a/pynocchio/main b/pynocchio/pynocchio similarity index 100% rename from pynocchio/main rename to pynocchio/pynocchio diff --git a/setup.py b/setup.py index 3ac1a69c..d6f9850f 100644 --- a/setup.py +++ b/setup.py @@ -63,6 +63,7 @@ def get_regex_files(path, extension): package_name = 'pynocchio' version = get_version(package_name) +debian_version = '1' class CompileUiFileCommand(distutils.cmd.Command): @@ -192,17 +193,23 @@ class BuildDEBPackageCommand(distutils.cmd.Command): user_options = [ ('folder=', None, 'The folder where deb package will be build'), ('upload=', None, 'Upload package to launchpad'), + ('stable=', None, 'Upload package to launchpad stable ppa'), ] def initialize_options(self): self.folder = 'dist' - self.upload = False + self.upload = None + self.stable = None def finalize_options(self): if os.path.isdir(self.folder) and os.path.lexists(self.folder): os.system('rm -rf %s' % self.folder) - assert self.upload in (True, False) + if self.upload: + assert self.upload == 'True' + + if self.stable: + assert self.stable == 'True' def run(self): @@ -212,18 +219,32 @@ def run(self): os.system('cp -r stdeb.cfg setup.py %s' % self.folder) os.system('cp -r pynocchio linux %s' % self.folder) os.system('cd %s && python setup.py --command-packages=stdeb.command ' - 'sdist_dsc' % self.folder) + 'sdist_dsc --package %s' % (self.folder, package_name)) os.system( - 'cd %s/deb_dist && dpkg-source -x %s_%s-1.dsc' % (self.folder, - package_name, - version)) + 'cd %s/deb_dist && dpkg-source -x %s_%s-%s.dsc' % (self.folder, + package_name, + version, + debian_version)) os.system('cd %s/deb_dist/%s-%s && debuild -S -sa' % (self.folder, package_name, version)) - if self.upload: - os.system('dput ppa:pynocchio-team/pynocchio-stable ' - '%s_%s-1_source.changes' % (package_name, version)) + if self.upload and self.stable: + os.system('cd %s/deb_dist && dput ' + 'ppa:pynocchio-team/pynocchio-stable ' + '%s_%s-%s_source.changes' % (self.folder, + package_name, + version, + debian_version)) + elif self.upload and not self.stable: + os.system('cd %s/deb_dist && dput ' + 'ppa:pynocchio-team/pynocchio-dev ' + '%s_%s-%s_source.changes' % (self.folder, + package_name, + version, + debian_version)) + else: + print '[INFO] Local build.' sys.exit() @@ -250,29 +271,30 @@ def run(self): 'build_deb': BuildDEBPackageCommand, }, scripts=[ - 'pynocchio-comic-reader/pynocchio/main', + 'pynocchio/pynocchio', ], data_files=[ - ('/usr/share/applications', - ['linux/usr/share/applications/pynocchio.desktop']), - ('/usr/share/pixmaps', ['linux/usr/share/pixmaps/pynocchio_icon.png']), + ('/usr/share/applications', ['linux/applications/pynocchio.desktop']), + ('/usr/share/pixmaps', ['linux/pixmaps/pynocchio_icon.png']), ('/usr/share/pynocchio/locale/', [ 'pynocchio/locale/pynocchio_en_US.qm', 'pynocchio/locale/pynocchio_pt_BR.qm', ]), - ('/usr/share/icons/hicolor/16x16/apps', - ['linux/usr/share/icons/hicolor/16x16/apps/pynocchio.png']), - ('/usr/share/icons/hicolor/32x32/apps', - ['linux/usr/share/icons/hicolor/32x32/apps/pynocchio.png']), - ('/usr/share/icons/hicolor/48x48/apps', - ['linux/usr/share/icons/hicolor/48x48/apps/pynocchio.png']), - ('/usr/share/icons/hicolor/128x128/apps', - ['linux/usr/share/icons/hicolor/128x128/apps/pynocchio.png']), - ('/usr/share/icons/hicolor/256x256/apps', - ['linux/usr/share/icons/hicolor/256x256/apps/pynocchio.png']), + ('/usr/share/icons/hicolor/16x16/apps', ['linux/hicolor/16x16/apps/pynocchio.png']), + ('/usr/share/icons/hicolor/32x32/apps', ['linux/hicolor/32x32/apps/pynocchio.png']), + ('/usr/share/icons/hicolor/48x48/apps', ['linux/hicolor/48x48/apps/pynocchio.png']), + ('/usr/share/icons/hicolor/128x128/apps', ['linux/hicolor/128x128/apps/pynocchio.png']), + ('/usr/share/icons/hicolor/256x256/apps', ['linux/hicolor/256x256/apps/pynocchio.png']), ], install_requires=[ 'rarfile', 'peewee', ], + classifiers=[ + 'Development Status :: 5 - Production/Stable', + 'Intended Audience :: Users', + 'License :: OSI Approved :: GPLv3 License', + 'Operating System :: OS Independent', + 'Programming Language :: Python', + ], ) diff --git a/stdeb.cfg b/stdeb.cfg index b7b11991..17c98274 100644 --- a/stdeb.cfg +++ b/stdeb.cfg @@ -1,6 +1,5 @@ [DEFAULT] Suite: trusty Section: graphics -Depends: python-pyside (>= 1.2.1), python-rarfile (>= 2.7), python-peewee (>= 2.8.0), python-qt4-sql -Package: pynocchio -Standards-Version: 3.9.5 +Depends: python-pyside (>= 1.2.1), python-rarfile (>= 2.7.2-1), python-peewee (>= 2.8.0-1), python-qt4-sql + From 6f54f0e81b2bc086ea8673a476c945abf9aa1a22 Mon Sep 17 00:00:00 2001 From: mstuttgart Date: Mon, 2 May 2016 03:31:33 -0300 Subject: [PATCH 09/14] Update README --- README.md | 65 +++++++++++++++++++++++++++++++++++++++++++++++++------ setup.py | 10 ++++----- 2 files changed, 63 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 5f61f616..15f25b09 100644 --- a/README.md +++ b/README.md @@ -3,14 +3,16 @@ Pynocchio Comic Reader [![Build Status](https://travis-ci.org/mstuttgart/pynocchio-comic-reader.svg?branch=master)](https://travis-ci.org/mstuttgart/pynocchio-comic-reader) [![Coverage Status](https://coveralls.io/repos/github/mstuttgart/pynocchio-comic-reader/badge.svg?branch=master)](https://coveralls.io/github/mstuttgart/pynocchio-comic-reader?branch=master) [![Code Health](https://landscape.io/github/mstuttgart/pynocchio-comic-reader/master/landscape.svg?style=flat)](https://landscape.io/github/mstuttgart/pynocchio-comic-reader/master) +[![GitHub release](https://img.shields.io/github/release/pynocchio/pynocchio-comic-reader.svg?maxAge=2592000?style=plastic)](https://github.com/pynocchio/pynocchio-comic-reader) [![AUR](https://img.shields.io/aur/license/yaourt.svg?maxAge=2592000?style=plastic)](https://pt.wikipedia.org/wiki/GNU_General_Public_License) -Pynocchio is a image viewer specialized in manga/comic reading -developed on PySide API. +Pynocchio is a image viewer specialized in manga/comic reading developed on +PySide API. ![](https://lh3.googleusercontent.com/-p0TtjyX-GgM/VwwYhAAUjrI/AAAAAAAAF04/_JSom_IMmasZfnRn4EPhxKejjj_9aHzYwCCo/s1152-Ic42/snapshot11.png) -## Features +### Features + The current version is stable and we intend to improve it even more. * Support several view adjust modes using anti-aliasing. @@ -20,38 +22,87 @@ The current version is stable and we intend to improve it even more. ![](https://lh3.googleusercontent.com/-pedd53CIEtc/VwwYg1TpnoI/AAAAAAAAF04/gOJWtN5XZwYwQT_IBwYQEk-sYhqrw_owgCCo/s1152-Ic42/snapshot12.png) -## Contributing +### Install + +#### Ubuntu 14.04 and Linux Mint 17.3 (or later) + +* To install *stable* version, add this ppa: + +``` +sudo add-apt-repository ppa:pynocchio-team/pynocchio-stable +sudo apt-get update +sudo apt-get install pynocchio +``` + +* To install *unstable* version, add this ppa: + +``` +sudo add-apt-repository ppa:pynocchio-team/pynocchio-dev +sudo apt-get update +sudo apt-get install pynocchio +``` + +#### Windows version and others OS + +Coming soon! Please help me build packages to the others OS. + +### Contributing + If you'd like to contribute, please create a fork and issue pull requests! I am very open to newcomers, and will need all the help we can get to make the best comic reader available. +* To compile .ui files, use: + +``` +python setup.py compile_ui +``` + +* To compile .qrc files, please use: + +``` +python setup.py compile_qrc +``` + +* To compile .pro files, please use: + +``` +python setup.py compile_pro +``` + ### Dependences + Ludic Game Library makes use of other libraries to perform some of their routines: * To develop: * Python 2.7 * PySide and Qt tools (QtDesigner e QLinguist): + ``` -sudo apt-get install python-pyside pyside-tools qt4-designer qt4-linguist-tools qt4-dev-tools unrar +sudo apt-get install python-pyside pyside-tools qt4-designer qt4-linguist-tools python-qt4-sql unrar-free ``` + * rarfile and peewee: + ``` sudo pip install rarfile peewee ``` You need of Qt Designer to open and edit .ui view files. -Use de **compile_ui.sh** file (inside of `script` folder) to compile .ui -files of project and `pynocchio.pro` file. ### ToDo: + Please, see this [list](https://github.com/mstuttgart/pynocchio-comic-reader/issues/21) ### I found a bug! + Please report any and all bugs using the project issue tracker. Be as precise as possible so that the bug can be found easier. Thanks! ### Third party resources + Pynocchio use [Elementary Icon Theme](https://github.com/opengraphix/elementary3-icon-theme) icon set free pack. ## Credits + Copyright (C) 2014-2016 by Michell Stuttgart Faria diff --git a/setup.py b/setup.py index 1ab0eede..2bf73ad9 100644 --- a/setup.py +++ b/setup.py @@ -104,7 +104,6 @@ def finalize_options(self): self.path) def run(self): - print "[INFO] Start compile ui files..." uic_folder = 'pynocchio/src/uic_files' @@ -142,7 +141,6 @@ def finalize_options(self): self.path) def run(self): - print "[INFO] Compile qrc files..." uic_folder = 'pynocchio/src/uic_files' @@ -177,6 +175,7 @@ def finalize_options(self): os.system('rm -rf %s' % self.folder) def run(self): + # TODO: Add upload launchpad command print "[INFO] Compile a deb package..." @@ -185,9 +184,10 @@ def run(self): os.system('cp -r pynocchio linux %s' % self.folder) os.system('cd %s && python setup.py --command-packages=stdeb.command ' 'sdist_dsc' % self.folder) - os.system('cd %s/deb_dist && dpkg-source -x %s_%s-1.dsc' % (self.folder, - package_name, - version)) + os.system( + 'cd %s/deb_dist && dpkg-source -x %s_%s-1.dsc' % (self.folder, + package_name, + version)) os.system('cd %s/deb_dist/%s-%s && debuild -S -sa' % (self.folder, package_name, version)) From 6dec65d463fc6aee1d25bf5b6b8d7ce61d1c7267 Mon Sep 17 00:00:00 2001 From: mstuttgart Date: Mon, 2 May 2016 14:14:58 -0300 Subject: [PATCH 10/14] Update pynocchio.pro --- pynocchio.pro | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/pynocchio.pro b/pynocchio.pro index f544e82d..c5ee09ab 100644 --- a/pynocchio.pro +++ b/pynocchio.pro @@ -1,16 +1,16 @@ -SOURCES = src/lib/main_window_view.py \ -src/lib/bookmark_manager_dialog.py \ -src/lib/go_to_page_dialog.py \ -src/lib/preference_dialog.py \ -src/lib/uic_files/custom_widgets/status_bar.py +SOURCES = pynocchio/src/main_window_view.py \ +pynocchio/src/bookmark_manager_dialog.py \ +pynocchio/src/go_to_page_dialog.py \ +pynocchio/src/preference_dialog.py \ +pynocchio/src/uic_files/custom_widgets/status_bar.py -FORMS = resources/ui_files/about_dialog.ui \ -resources/ui_files/bookmark_manager_dialog.ui \ -resources/ui_files/go_to_page_dialog.ui \ -resources/ui_files/preference_dialog.ui \ -resources/ui_files/main_window_view.ui +FORMS = data/ui_files/about_dialog.ui \ +data/ui_files/bookmark_manager_dialog.ui \ +data/ui_files/go_to_page_dialog.ui \ +data/ui_files/preference_dialog.ui \ +data/ui_files/main_window_view.ui TRANSLATIONS = i18n/pynocchio_en_US.ts i18n/pynocchio_pt_BR.ts -RESOURCES += resources/main_window_view.qrc +RESOURCES += data/main_window_view.qrc From fdbdd0117c67e6e29e7c549f636f8b3b9a46f1e0 Mon Sep 17 00:00:00 2001 From: mstuttgart Date: Mon, 2 May 2016 14:47:28 -0300 Subject: [PATCH 11/14] Vaiable name adjust --- pynocchio/src/main_window_model.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/pynocchio/src/main_window_model.py b/pynocchio/src/main_window_model.py index 3b13143d..0f933d43 100644 --- a/pynocchio/src/main_window_model.py +++ b/pynocchio/src/main_window_model.py @@ -71,26 +71,26 @@ def load(self, filename, initial_page=0): image_extensions = ['.bmp', '.jpg', '.jpeg', '.gif', '.png', '.pbm', '.pgm', '.ppm', '.tiff', '.xbm', '.xpm', '.webp'] - ld = LoaderFactory.create_loader( + loader = LoaderFactory.create_loader( Utility.get_file_extension(filename), set(image_extensions)) - ld.progress.connect(self.load_progressbar_value) + loader.progress.connect(self.load_progressbar_value) try: - ld.load(filename) + loader.load(filename) except NoDataFindException as excp: # Caso nao exista nenhuma imagem, carregamos a imagem indicando # erro - from page import Page + from pynocchio.src.page import Page print excp.message q_file = QtCore.QFile(":/icons/notCover.png") q_file.open(QtCore.QIODevice.ReadOnly) - ld.data.append(Page(q_file.readAll(), 'exit_red_1.png', 0)) + loader.data.append(Page(q_file.readAll(), 'exit_red_1.png', 0)) self.comic = Comic(Utility.get_base_name(filename), Utility.get_dir_name(filename), initial_page) - self.comic.pages = ld.data + self.comic.pages = loader.data self.current_directory = Utility.get_dir_name(filename) self.path_file_filter.parse(filename) @@ -217,9 +217,9 @@ def save_settings(self): self.save_current_directory(self.current_directory) @staticmethod - def get_bookmark_list(n): + def get_bookmark_list(qty): BookmarkManager.connect() - bookmark_list = BookmarkManager.get_bookmarks(n) + bookmark_list = BookmarkManager.get_bookmarks(qty) BookmarkManager.close() return bookmark_list @@ -232,9 +232,9 @@ def is_bookmark(self): @staticmethod def get_bookmark_from_path(path): BookmarkManager.connect() - bk = BookmarkManager.get_bookmark_by_path(path) + bookmark = BookmarkManager.get_bookmark_by_path(path) BookmarkManager.close() - return bk + return bookmark def add_bookmark(self): if self.comic: From 51bd3faab2fc3d7644a1d9b8fba259b93ad77827 Mon Sep 17 00:00:00 2001 From: mstuttgart Date: Mon, 2 May 2016 15:03:17 -0300 Subject: [PATCH 12/14] [NEW] Added Launchpad upload option add compile .pro option in seyup.py --- i18n/pynocchio_en_US.ts | 230 ++++++++++++++++++++-------------------- i18n/pynocchio_pt_BR.ts | 230 ++++++++++++++++++++-------------------- setup.py | 39 ++++++- 3 files changed, 267 insertions(+), 232 deletions(-) diff --git a/i18n/pynocchio_en_US.ts b/i18n/pynocchio_en_US.ts index 6d44b97e..b3bf273b 100644 --- a/i18n/pynocchio_en_US.ts +++ b/i18n/pynocchio_en_US.ts @@ -8,42 +8,42 @@ About Pynocchio Reader - + About About - + GPLv3 GPLv3 - + License type: License type: - + (c) 2014 -2016 Michell Stuttgart (c) 2014 -2016 Michell Stuttgart - + Version: Version: - + Developer: Developer: - + Copyright: Copyright: - + Michell Stuttgart Michell Stuttgart @@ -53,7 +53,7 @@ 1.2.0 - + Pynocchio Comic Reader Pynocchio Comic Reader @@ -63,12 +63,12 @@ The Pynocchio Comic Reader is an comic and manga reader. - + License License - + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } @@ -751,37 +751,37 @@ p, li { white-space: pre-wrap; } - + Others Others - + <html><head/><body><p>Pynocchio use <a href="Free Icon Maker"><span style=" text-decoration: underline; color:#0000ff;">http://freeiconmaker.com</span></a> to build icon set. </p><p>Icons pack by <a href="https://github.com/opengraphix/elementary3-icon-theme"><span style=" text-decoration: underline; color:#0000ff;">Elementary Icon</span></a> theme.</p></body></html> - + Close Close - + About Pynocchio About Pynocchio - + 0.0.1 - + The Pynocchio is an comic and manga reader. The Pynocchio Comic Reader is an comic and manga reader. - + <a href=https://github.com/mstuttgart/pynocchio-comic-reader>Pynocchio Comic Reader</a> @@ -789,12 +789,12 @@ p, li { white-space: pre-wrap; } BookmarkManagerDialog - + Delete bookmarks Delete bookmarks - + This action will go delete you bookmarks! Preceed? This action will go delete you bookmarks! Preceed? @@ -802,27 +802,27 @@ p, li { white-space: pre-wrap; } Bookmark_Dialog - + Bookmark manager Bookmark Manager - + Page Preview Page Preview - + Remove Remove - + Cancel Cancel - + Load Load @@ -830,22 +830,22 @@ p, li { white-space: pre-wrap; } GoPageDialog - + Go to Page Go to Page - + Number of pages: Number of pages: - + Current page: Current page: - + Go to page: Go to page: @@ -853,47 +853,47 @@ p, li { white-space: pre-wrap; } MainWindowView - + open_comic_file Open Comic File - + all_supported_files (*.zip *.cbz *.rar *.cbr *.tar *.cbt);; zip_files (*.zip *.cbz);; rar_files (*.rar *.cbr);; tar_files (*.tar *.cbt);; all_files (*) All supported.files (*.zip *.cbz *.rar *.cbr *.tar *.cbt);; Zip.files (*.zip *.cbz);; Rar files (*.rar *.cbr);; Tar files (*.tar *.cbt);; All files (*) - + save_current_page Save current page - + images (*.png *.xpm *.jpeg *.jpg *.gif) Images (*.png *.xpm *.jpeg *.jpg *.gif) - + LoadComicsException - + InvalidTypeFileException - + Pynocchio Comic Reader Pynocchio Comic Reader - + The Best Comic Reader The Best Comic Reader - + &File &File @@ -903,22 +903,22 @@ p, li { white-space: pre-wrap; } &Recent files - + &View &View - + &Navegation &Navegation - + &Help &Help - + &Settings &Settings @@ -928,7 +928,7 @@ p, li { white-space: pre-wrap; } Language - + &Bookmarks &Bookmarks @@ -938,7 +938,7 @@ p, li { white-space: pre-wrap; } Recente bookmarks - + toolBar toolBar @@ -958,7 +958,7 @@ p, li { white-space: pre-wrap; } &Exit - + Ctrl+Q @@ -968,7 +968,7 @@ p, li { white-space: pre-wrap; } &Next page - + Right Right @@ -978,7 +978,7 @@ p, li { white-space: pre-wrap; } &Previous page - + Left Left @@ -988,7 +988,7 @@ p, li { white-space: pre-wrap; } &First page - + Ctrl+Left Ctrl+Left @@ -998,7 +998,7 @@ p, li { white-space: pre-wrap; } &Last page - + Ctrl+Right Ctrl+Right @@ -1008,7 +1008,7 @@ p, li { white-space: pre-wrap; } &Rotate left - + Ctrl+Shift+R Ctrl+Shift+R @@ -1018,7 +1018,7 @@ p, li { white-space: pre-wrap; } &Rotate right - + Ctrl+R Ctrl+R @@ -1028,7 +1028,7 @@ p, li { white-space: pre-wrap; } &Horizontal fit - + Ctrl+K Ctrl+K @@ -1038,7 +1038,7 @@ p, li { white-space: pre-wrap; } &Fullscreen - + F F @@ -1048,7 +1048,7 @@ p, li { white-space: pre-wrap; } &Go to page... - + Ctrl+G Ctrl+G @@ -1058,7 +1058,7 @@ p, li { white-space: pre-wrap; } &Original fit - + Ctrl+H Ctrl+H @@ -1088,27 +1088,27 @@ p, li { white-space: pre-wrap; } Open &Folder - + Next Comic Next Comic - + Ctrl+Shift+Right Ctrl+Shift+Right - + Previous Comic Previous Comic - + Ctrl+Shift+Left Ctrl+Shift+Left - + Preferences Preferences @@ -1118,7 +1118,7 @@ p, li { white-space: pre-wrap; } &Vertical fit - + Ctrl+J Ctrl+J @@ -1128,7 +1128,7 @@ p, li { white-space: pre-wrap; } &Best fit - + Ctrl+L Ctrl+L @@ -1138,12 +1138,12 @@ p, li { white-space: pre-wrap; } &Save image - + Save current image in disk. Save current image in disk. - + Ctrl+S Ctrl+S @@ -1153,157 +1153,157 @@ p, li { white-space: pre-wrap; } &Open File - + Ctrl+O Ctrl+O - + recent_file_1 - + recent_file_2 - + recent_file_3 - + recent_file_4 - + recent_file_5 - + recent_file_6 - + recent_file_7 - + recent_file_8 - + recent_file_9 - + recent_file_10 - + recent_bookmark_1 - + recent_bookmark_2 - + recent_bookmark_3 - + recent_bookmark_4 - + recent_bookmark_5 - + English English - + Portuguese Portuguese - + Show Toolbar Show Toolbar - + Horizontal fit Horizontal fit - + en_US - + About Pynocchio About Pynocchio - + About Qt About Qt - + Exit Exit - + Next page Next page - + Previous page Previous page - + First page First page - + Last page Last page - + Rotate left Rotate left - + Rotate right Rotate right - + Fullscreen Fullscreen @@ -1313,67 +1313,67 @@ p, li { white-space: pre-wrap; } Go to Page - + Original fit Original fit - + Show Statusbar Show Toolbar - + Add bookmark Add bookmark - + Remove bookmark Remove bookmark - + Open Folder Open Folder - + Vertical fit Vertical fit - + Best fit Best fit - + Save image Save image - + Open File Open File - + Recent files Recent files - + Go to page Go to Page - + Recente bookmarks Recente bookmarks - + Bookmark manager Bookmark Manager @@ -1381,17 +1381,17 @@ p, li { white-space: pre-wrap; } StatusBar - + Page: Page: - + Resolution: Resolution: - + Title: Title: @@ -1399,22 +1399,22 @@ p, li { white-space: pre-wrap; } config_dialog - + Pynocchio Preferences Pynocchio Preferences - + General General - + <html><head/><body><p>Background color: </p></body></html> - + Close Close diff --git a/i18n/pynocchio_pt_BR.ts b/i18n/pynocchio_pt_BR.ts index b6135f96..cb6126aa 100644 --- a/i18n/pynocchio_pt_BR.ts +++ b/i18n/pynocchio_pt_BR.ts @@ -8,12 +8,12 @@ Sobre Pynocchio Comic Reader - + About Sobre - + Close Fechar @@ -31,37 +31,37 @@ exclusivamente para leitura de arquivos .zip , cbr , rar projetado para leitura de revista em quadrinhos.</p><p>Lê arquivos nos formatos CBR, ZIP, CBZ, RAR e TAR.</p><p><a href="http://mstuttgart.github.io/pynocchio-comic-reader/"> <span style="text-decoration: underline; color:#0000ff;"> Pynocchio Comic Reader</span></a> é licenciado sob a GNU General Public License.</p><p>Copyright (C) 2014-2015 <a href="https://github.com/mstuttgart"> <span style="text-decoration: underline; color:#0000ff;"> Michell Stuttgart Faria</span></a></p><p>Pynocchio use <a href="file:///home/michell/Projetos/pynocchio-comic-reader/yacreader/files/Free%20Icon%20Maker"> <span style="text-decoration: underline; color:#0000ff;"> http://freeiconmaker.com</span></a> para construir o conjunto de ícones.</p><p>Pacote de ícones por Icons Sweets 2 e o pacote gratuito Streamline Icone Set .</p></p> - + GPLv3 - + License type: Tipo de licença: - + Version: Versão: - + Developer: Desenvolvedor: - + Copyright: - + Michell Stuttgart - + Pynocchio Comic Reader @@ -71,22 +71,22 @@ projetado para leitura de revista em quadrinhos.</p><p>Lê arquivos Pynocchio.Comic.Reader é um leitor de mangás e histórias em quadrinhos. - + License - + Others Outros - + (c) 2014 -2016 Michell Stuttgart - + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } @@ -769,27 +769,27 @@ p, li { white-space: pre-wrap; } - + <html><head/><body><p>Pynocchio use <a href="Free Icon Maker"><span style=" text-decoration: underline; color:#0000ff;">http://freeiconmaker.com</span></a> to build icon set. </p><p>Icons pack by <a href="https://github.com/opengraphix/elementary3-icon-theme"><span style=" text-decoration: underline; color:#0000ff;">Elementary Icon</span></a> theme.</p></body></html> - + About Pynocchio Sobre Pynocchio - + 0.0.1 - + The Pynocchio is an comic and manga reader. Pynocchio.Comic.Reader é um leitor de mangás e histórias em quadrinhos. - + <a href=https://github.com/mstuttgart/pynocchio-comic-reader>Pynocchio Comic Reader</a> @@ -797,12 +797,12 @@ p, li { white-space: pre-wrap; } BookmarkManagerDialog - + Delete bookmarks Deletar favoritos - + This action will go delete you bookmarks! Preceed? Esta ação irá deletar seus favoritos! Deseja continuar? @@ -845,7 +845,7 @@ p, li { white-space: pre-wrap; } Abrir - + Remove Remover @@ -860,22 +860,22 @@ p, li { white-space: pre-wrap; } Fechar - + Load Carregar - + Bookmark manager Gerenciar favoritos - + Page Preview Visualização - + Cancel Cancelar @@ -883,7 +883,7 @@ p, li { white-space: pre-wrap; } GoPageDialog - + Go to Page Ir para a página @@ -893,17 +893,17 @@ p, li { white-space: pre-wrap; } Visualização - + Number of pages: Número de páginas: - + Current page: Página atual: - + Go to page: Ir para a página: @@ -1139,12 +1139,12 @@ p, li { white-space: pre-wrap; } Sobre Pynocchio Comic Reader - + About Qt Sobre o Qt - + &File &Arquivo @@ -1154,27 +1154,27 @@ p, li { white-space: pre-wrap; } A&rquivos recentes - + &View &Visualizar - + &Navegation &Navegação - + &Help A&juda - + &Settings &Configuração - + &Bookmarks &Favoritos @@ -1269,22 +1269,22 @@ p, li { white-space: pre-wrap; } Gerenciar favoritos - + Next Comic Próximo quadrinho - + Previous Comic Quadrinho anterior - + Preferences Preferências - + The Best Comic Reader O melhor leitor de quadrinhos @@ -1319,7 +1319,7 @@ p, li { white-space: pre-wrap; } Salvar imagem - + Save current image in disk. Salvar imagem atual no disco. @@ -1329,37 +1329,37 @@ p, li { white-space: pre-wrap; } Abrir online - + open_comic_file Abrir quadrinho - + all_supported_files (*.zip *.cbz *.rar *.cbr *.tar *.cbt);; zip_files (*.zip *.cbz);; rar_files (*.rar *.cbr);; tar_files (*.tar *.cbt);; all_files (*) Todos os arquivosa suportadoss (*.zip *.cbz *.rar *.cbr *.tar *.cbt);; Arquivos zip (*.zip *.cbz);; Arquivos rar (*.rar *.cbr);; Arquivos tar (*.tar *.cbt);; Todos osarquivos (*) - + save_current_page Salvar página atual - + images (*.png *.xpm *.jpeg *.jpg *.gif) Imagens (*.png *.xpm *.jpeg *.jpg *.gif) - + LoadComicsException - + InvalidTypeFileException - + Pynocchio Comic Reader @@ -1369,87 +1369,87 @@ p, li { white-space: pre-wrap; } Idioma - + toolBar - + Ctrl+Q - + Right Right - + Left Left - + Ctrl+Left Ctrl+Left - + Ctrl+Right Ctrl+Right - + Ctrl+Shift+R - + Ctrl+R Ctrl+R - + Ctrl+K - + F F - + Ctrl+G Ctrl+G - + Ctrl+H Ctrl+H - + Ctrl+Shift+Right Ctrl+Shift+Right - + Ctrl+Shift+Left Ctrl+Shift+Left - + Ctrl+J Ctrl+J - + Ctrl+L Ctrl+L - + Ctrl+S Ctrl+S @@ -1459,152 +1459,152 @@ p, li { white-space: pre-wrap; } &Abrir Aquivo - + Ctrl+O Ctrl+O - + recent_file_1 - + recent_file_2 - + recent_file_3 - + recent_file_4 - + recent_file_5 - + recent_file_6 - + recent_file_7 - + recent_file_8 - + recent_file_9 - + recent_file_10 - + recent_bookmark_1 - + recent_bookmark_2 - + recent_bookmark_3 - + recent_bookmark_4 - + recent_bookmark_5 - + English Inglês - + Portuguese Português - + Show Toolbar Exibir barra de status - + Horizontal fit Ajuste horizontal - + en_US - + About Pynocchio Sobre Pynocchio - + Exit Sair - + Next page Próxima página - + Previous page Página anterior - + First page Primeira página - + Last page Última página - + Rotate left Rotacionar para esquerda - + Rotate right Rotacionar para direita - + Fullscreen Tela cheia @@ -1614,67 +1614,67 @@ p, li { white-space: pre-wrap; } Ir para a página - + Original fit Tamanho original - + Show Statusbar Exibir barra de status - + Add bookmark Adicionar aos favoritos - + Remove bookmark Remover dos favoritos - + Open Folder Abrir diretorio - + Vertical fit Ajuste vertical - + Best fit Melhor ajuste - + Save image Salvar imagem - + Open File Abrir Aquivo - + Recent files Arquivos recentes - + Go to page Ir para a página - + Recente bookmarks Favoritos recentes - + Bookmark manager Gerenciar favoritos @@ -1682,17 +1682,17 @@ p, li { white-space: pre-wrap; } StatusBar - + Page: Página: - + Resolution: Resolução: - + Title: Título: @@ -1705,7 +1705,7 @@ p, li { white-space: pre-wrap; } Preferências - + General Geral @@ -1740,17 +1740,17 @@ p, li { white-space: pre-wrap; } Exibir barra de status no modo tela cheia - + Close Fechar - + Pynocchio Preferences Pynocchio preferências - + <html><head/><body><p>Background color: </p></body></html> diff --git a/setup.py b/setup.py index 2bf73ad9..3ac1a69c 100644 --- a/setup.py +++ b/setup.py @@ -151,7 +151,33 @@ def run(self): print '[INFO] Compile %s file' % f[0] print '[INFO] rc files added in %s' % uic_folder - print '[INFO] Compile qrc files successfully!' + sys.exit() + + +class CompileProFileCommand(distutils.cmd.Command): + """ + A command to compile pro condig files. + """ + + description = "Compile PySide pro files" + + # The format is (long option, short option, description). + user_options = [ + ('path=', None, 'The path of pro files folder'), + ] + + def initialize_options(self): + self.path = 'pynocchio.pro' + + def finalize_options(self): + assert os.path.isfile(self.path), ('[INFO] %s not is valid file!' % + self.path) + assert os.path.exists(self.path), ('[INFO] File %s not exist!' % + self.path) + + def run(self): + print "[INFO] Compile pro files..." + os.system('pyside-lupdate -verbose %s' % self.path) sys.exit() @@ -165,17 +191,20 @@ class BuildDEBPackageCommand(distutils.cmd.Command): # The format is (long option, short option, description). user_options = [ ('folder=', None, 'The folder where deb package will be build'), + ('upload=', None, 'Upload package to launchpad'), ] def initialize_options(self): self.folder = 'dist' + self.upload = False def finalize_options(self): if os.path.isdir(self.folder) and os.path.lexists(self.folder): os.system('rm -rf %s' % self.folder) + assert self.upload in (True, False) + def run(self): - # TODO: Add upload launchpad command print "[INFO] Compile a deb package..." @@ -191,6 +220,11 @@ def run(self): os.system('cd %s/deb_dist/%s-%s && debuild -S -sa' % (self.folder, package_name, version)) + + if self.upload: + os.system('dput ppa:pynocchio-team/pynocchio-stable ' + '%s_%s-1_source.changes' % (package_name, version)) + sys.exit() @@ -212,6 +246,7 @@ def run(self): cmdclass={ 'compile_ui': CompileUiFileCommand, 'compile_qrc': CompileQrcFileCommand, + 'compile_pro': CompileProFileCommand, 'build_deb': BuildDEBPackageCommand, }, scripts=[ From 936f4ef071416674f79d440bfe04e578dde5c767 Mon Sep 17 00:00:00 2001 From: mstuttgart Date: Mon, 2 May 2016 15:04:41 -0300 Subject: [PATCH 13/14] Script folder removed --- scripts/compile_ui.sh | 12 ------------ 1 file changed, 12 deletions(-) delete mode 100755 scripts/compile_ui.sh diff --git a/scripts/compile_ui.sh b/scripts/compile_ui.sh deleted file mode 100755 index 7fb8fd04..00000000 --- a/scripts/compile_ui.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash -cd .. - -pyside-rcc -verbose -o pynocchio/src/uic_files/main_window_view_rc.py data/main_window_view.qrc - -pyside-uic data/ui_files/main_window_view.ui -o pynocchio/src/uic_files/ui_main_window_view.py -pyside-uic data/ui_files/go_to_page_dialog.ui -o pynocchio/src/uic_files/ui_go_to_page_dialog.py -pyside-uic data/ui_files/about_dialog.ui -o pynocchio/src/uic_files/ui_about_dialog.py -pyside-uic data/ui_files/preference_dialog.ui -o pynocchio/src/uic_files/ui_preference_dialog.py -pyside-uic data/ui_files/bookmark_manager_dialog.ui -o pynocchio/src/uic_files/ui_bookmark_manager_dialog.py - -pyside-lupdate -verbose pynocchio.pro From 43ac8ccb7e63a9bea5d34118d3d7ba226593e349 Mon Sep 17 00:00:00 2001 From: mstuttgart Date: Tue, 3 May 2016 00:35:57 -0300 Subject: [PATCH 14/14] [FIX] Adjust in setup.py [FIX] Somplify structure of linux folder [FIX] main file renamed to pynocchio --- .../share => }/applications/pynocchio.desktop | 0 .../hicolor/128x128/apps/pynocchio.png | Bin .../hicolor/16x16/apps/pynocchio.png | Bin .../hicolor/256x256/apps/pynocchio.png | Bin .../hicolor/32x32/apps/pynocchio.png | Bin .../hicolor/48x48/apps/pynocchio.png | Bin .../share => }/pixmaps/pynocchio_icon.png | Bin pynocchio/__init__.py | 2 +- pynocchio/{main => pynocchio} | 0 setup.py | 68 ++++++++++++------ stdeb.cfg | 5 +- 11 files changed, 48 insertions(+), 27 deletions(-) rename linux/{usr/share => }/applications/pynocchio.desktop (100%) rename linux/{usr/share/icons => }/hicolor/128x128/apps/pynocchio.png (100%) rename linux/{usr/share/icons => }/hicolor/16x16/apps/pynocchio.png (100%) rename linux/{usr/share/icons => }/hicolor/256x256/apps/pynocchio.png (100%) rename linux/{usr/share/icons => }/hicolor/32x32/apps/pynocchio.png (100%) rename linux/{usr/share/icons => }/hicolor/48x48/apps/pynocchio.png (100%) rename linux/{usr/share => }/pixmaps/pynocchio_icon.png (100%) rename pynocchio/{main => pynocchio} (100%) diff --git a/linux/usr/share/applications/pynocchio.desktop b/linux/applications/pynocchio.desktop similarity index 100% rename from linux/usr/share/applications/pynocchio.desktop rename to linux/applications/pynocchio.desktop diff --git a/linux/usr/share/icons/hicolor/128x128/apps/pynocchio.png b/linux/hicolor/128x128/apps/pynocchio.png similarity index 100% rename from linux/usr/share/icons/hicolor/128x128/apps/pynocchio.png rename to linux/hicolor/128x128/apps/pynocchio.png diff --git a/linux/usr/share/icons/hicolor/16x16/apps/pynocchio.png b/linux/hicolor/16x16/apps/pynocchio.png similarity index 100% rename from linux/usr/share/icons/hicolor/16x16/apps/pynocchio.png rename to linux/hicolor/16x16/apps/pynocchio.png diff --git a/linux/usr/share/icons/hicolor/256x256/apps/pynocchio.png b/linux/hicolor/256x256/apps/pynocchio.png similarity index 100% rename from linux/usr/share/icons/hicolor/256x256/apps/pynocchio.png rename to linux/hicolor/256x256/apps/pynocchio.png diff --git a/linux/usr/share/icons/hicolor/32x32/apps/pynocchio.png b/linux/hicolor/32x32/apps/pynocchio.png similarity index 100% rename from linux/usr/share/icons/hicolor/32x32/apps/pynocchio.png rename to linux/hicolor/32x32/apps/pynocchio.png diff --git a/linux/usr/share/icons/hicolor/48x48/apps/pynocchio.png b/linux/hicolor/48x48/apps/pynocchio.png similarity index 100% rename from linux/usr/share/icons/hicolor/48x48/apps/pynocchio.png rename to linux/hicolor/48x48/apps/pynocchio.png diff --git a/linux/usr/share/pixmaps/pynocchio_icon.png b/linux/pixmaps/pynocchio_icon.png similarity index 100% rename from linux/usr/share/pixmaps/pynocchio_icon.png rename to linux/pixmaps/pynocchio_icon.png diff --git a/pynocchio/__init__.py b/pynocchio/__init__.py index 84849674..cacb4239 100644 --- a/pynocchio/__init__.py +++ b/pynocchio/__init__.py @@ -16,7 +16,7 @@ # with this program. If not, see . __title__ = 'Pynocchio Comic Reader' -__version__ = '0.0.1.5' +__version__ = '0.0.1' __author__ = 'Michell Stuttgart Faria' __license__ = 'GPL v3' __copyright__ = 'Copyright 2014-2016 Michell Stuttgart Faria' diff --git a/pynocchio/main b/pynocchio/pynocchio similarity index 100% rename from pynocchio/main rename to pynocchio/pynocchio diff --git a/setup.py b/setup.py index 3ac1a69c..d6f9850f 100644 --- a/setup.py +++ b/setup.py @@ -63,6 +63,7 @@ def get_regex_files(path, extension): package_name = 'pynocchio' version = get_version(package_name) +debian_version = '1' class CompileUiFileCommand(distutils.cmd.Command): @@ -192,17 +193,23 @@ class BuildDEBPackageCommand(distutils.cmd.Command): user_options = [ ('folder=', None, 'The folder where deb package will be build'), ('upload=', None, 'Upload package to launchpad'), + ('stable=', None, 'Upload package to launchpad stable ppa'), ] def initialize_options(self): self.folder = 'dist' - self.upload = False + self.upload = None + self.stable = None def finalize_options(self): if os.path.isdir(self.folder) and os.path.lexists(self.folder): os.system('rm -rf %s' % self.folder) - assert self.upload in (True, False) + if self.upload: + assert self.upload == 'True' + + if self.stable: + assert self.stable == 'True' def run(self): @@ -212,18 +219,32 @@ def run(self): os.system('cp -r stdeb.cfg setup.py %s' % self.folder) os.system('cp -r pynocchio linux %s' % self.folder) os.system('cd %s && python setup.py --command-packages=stdeb.command ' - 'sdist_dsc' % self.folder) + 'sdist_dsc --package %s' % (self.folder, package_name)) os.system( - 'cd %s/deb_dist && dpkg-source -x %s_%s-1.dsc' % (self.folder, - package_name, - version)) + 'cd %s/deb_dist && dpkg-source -x %s_%s-%s.dsc' % (self.folder, + package_name, + version, + debian_version)) os.system('cd %s/deb_dist/%s-%s && debuild -S -sa' % (self.folder, package_name, version)) - if self.upload: - os.system('dput ppa:pynocchio-team/pynocchio-stable ' - '%s_%s-1_source.changes' % (package_name, version)) + if self.upload and self.stable: + os.system('cd %s/deb_dist && dput ' + 'ppa:pynocchio-team/pynocchio-stable ' + '%s_%s-%s_source.changes' % (self.folder, + package_name, + version, + debian_version)) + elif self.upload and not self.stable: + os.system('cd %s/deb_dist && dput ' + 'ppa:pynocchio-team/pynocchio-dev ' + '%s_%s-%s_source.changes' % (self.folder, + package_name, + version, + debian_version)) + else: + print '[INFO] Local build.' sys.exit() @@ -250,29 +271,30 @@ def run(self): 'build_deb': BuildDEBPackageCommand, }, scripts=[ - 'pynocchio-comic-reader/pynocchio/main', + 'pynocchio/pynocchio', ], data_files=[ - ('/usr/share/applications', - ['linux/usr/share/applications/pynocchio.desktop']), - ('/usr/share/pixmaps', ['linux/usr/share/pixmaps/pynocchio_icon.png']), + ('/usr/share/applications', ['linux/applications/pynocchio.desktop']), + ('/usr/share/pixmaps', ['linux/pixmaps/pynocchio_icon.png']), ('/usr/share/pynocchio/locale/', [ 'pynocchio/locale/pynocchio_en_US.qm', 'pynocchio/locale/pynocchio_pt_BR.qm', ]), - ('/usr/share/icons/hicolor/16x16/apps', - ['linux/usr/share/icons/hicolor/16x16/apps/pynocchio.png']), - ('/usr/share/icons/hicolor/32x32/apps', - ['linux/usr/share/icons/hicolor/32x32/apps/pynocchio.png']), - ('/usr/share/icons/hicolor/48x48/apps', - ['linux/usr/share/icons/hicolor/48x48/apps/pynocchio.png']), - ('/usr/share/icons/hicolor/128x128/apps', - ['linux/usr/share/icons/hicolor/128x128/apps/pynocchio.png']), - ('/usr/share/icons/hicolor/256x256/apps', - ['linux/usr/share/icons/hicolor/256x256/apps/pynocchio.png']), + ('/usr/share/icons/hicolor/16x16/apps', ['linux/hicolor/16x16/apps/pynocchio.png']), + ('/usr/share/icons/hicolor/32x32/apps', ['linux/hicolor/32x32/apps/pynocchio.png']), + ('/usr/share/icons/hicolor/48x48/apps', ['linux/hicolor/48x48/apps/pynocchio.png']), + ('/usr/share/icons/hicolor/128x128/apps', ['linux/hicolor/128x128/apps/pynocchio.png']), + ('/usr/share/icons/hicolor/256x256/apps', ['linux/hicolor/256x256/apps/pynocchio.png']), ], install_requires=[ 'rarfile', 'peewee', ], + classifiers=[ + 'Development Status :: 5 - Production/Stable', + 'Intended Audience :: Users', + 'License :: OSI Approved :: GPLv3 License', + 'Operating System :: OS Independent', + 'Programming Language :: Python', + ], ) diff --git a/stdeb.cfg b/stdeb.cfg index b7b11991..17c98274 100644 --- a/stdeb.cfg +++ b/stdeb.cfg @@ -1,6 +1,5 @@ [DEFAULT] Suite: trusty Section: graphics -Depends: python-pyside (>= 1.2.1), python-rarfile (>= 2.7), python-peewee (>= 2.8.0), python-qt4-sql -Package: pynocchio -Standards-Version: 3.9.5 +Depends: python-pyside (>= 1.2.1), python-rarfile (>= 2.7.2-1), python-peewee (>= 2.8.0-1), python-qt4-sql +