pax_global_header00006660000000000000000000000064147360055000014512gustar00rootroot0000000000000052 comment=2b9601c067bd6b7cc68d94f00f152930f7c64f06 confy-0.8.0/000077500000000000000000000000001473600550000126355ustar00rootroot00000000000000confy-0.8.0/.buildconfig000066400000000000000000000003571473600550000151300ustar00rootroot00000000000000[default] name=Default runtime=host toolchain=default config-opts= run-opts= prefix=/home/fabio/.cache/gnome-builder/install/confy/host app-id= postbuild= prebuild= default=true [default.environment] [default.runtime_environment] LANG=C confy-0.8.0/.editorconfig000066400000000000000000000001321473600550000153060ustar00rootroot00000000000000[*.py] indent_style = space indent_size = 4 [*.blp] indent_style = space indent_size = 2 confy-0.8.0/.gitignore000066400000000000000000000034021473600550000146240ustar00rootroot00000000000000 # Created by https://www.gitignore.io/api/ninja,python # Edit at https://www.gitignore.io/?templates=ninja,python ### Ninja ### .ninja_deps .ninja_log ### Python ### # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] *$py.class # C extensions *.so # Distribution / packaging .Python build/ develop-eggs/ dist/ downloads/ eggs/ .eggs/ lib/ lib64/ parts/ sdist/ var/ wheels/ pip-wheel-metadata/ share/python-wheels/ *.egg-info/ .installed.cfg *.egg MANIFEST # PyInstaller # Usually these files are written by a python script from a template # before PyInstaller builds the exe, so as to inject date/other infos into it. *.manifest *.spec # Installer logs pip-log.txt pip-delete-this-directory.txt # Unit test / coverage reports htmlcov/ .tox/ .nox/ .coverage .coverage.* .cache nosetests.xml coverage.xml *.cover .hypothesis/ .pytest_cache/ # Translations *.mo *.pot # Scrapy stuff: .scrapy # Sphinx documentation docs/_build/ # PyBuilder target/ # pyenv .python-version # pipenv # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. # However, in case of collaboration, if having platform-specific dependencies or dependencies # having no cross-platform support, pipenv may install dependencies that don't work, or not # install all needed dependencies. #Pipfile.lock # celery beat schedule file celerybeat-schedule # SageMath parsed files *.sage.py # Spyder project settings .spyderproject .spyproject # Rope project settings .ropeproject # Mr Developer .mr.developer.cfg .project .pydevproject # mkdocs documentation /site # mypy .mypy_cache/ .dmypy.json dmypy.json # Pyre type checker .pyre/ # End of https://www.gitignore.io/api/ninja,python work/ *~ .flatpak-builder/ .*env subprojects/blueprint-compilerconfy-0.8.0/CHANGELOG000066400000000000000000000072771473600550000140640ustar00rootroot00000000000000# CHANGELOG ## [0.8.0] - 2025-01-03 ## Add - Show recent opened conferences in star page - Store more speakers details, if available - Show speakers avatars - Let user choose talks grouping in talks list ## Fixed - Pentabarf parsing - Start/end date parsing - Icon selection logic for links ## Changed - Flatpak: bump to GNOME Runtime 47 - Flatpak: updated dependecies - Updated Event edit dialog to use Adwaita dialog window (Michael Evans) - Rework main window navigation using Adwaita views ## [0.7.1] - 2024-01-23 ## Add - German translation, thanks to Sebastian Crane ## Fixed - Fix Meson build scripts (Sebastian) - Fix day format in Swedish translation (Luna) - Update README (Sebastian) - Try to fix appinfo metadata issues noted by flathub.org checks ## Changed - Flatpak: bump to GNOME Runtime 45 - Remove blueprint meson subproject. Blueprint is now a build requirement. - Bigger default window size in settings ## [0.7.0] - 2023-07-25 ## Changed - Ported to Gtk4/libadwaita - Reviseted user interaction, dialogs and shortcuts ## Add - Copy talk detail into clipboard as plaintext from menu or shortcut ## Fixed - Correct day for events that are after UTC midnight (edward) ## [0.6.5] - 2023-06-01 ### Add - French tranlsation, thanks to Irénée Thirion - Swedish translation, thanks to Luna Jernberg ### Fixed - Fix Pentabarf date parsing ### Changed - Flatpak: bump to GNOME Runtime 44 ## [0.6.4] - 2022-08-17 ### Add - Convert markdown links to html hyperlinks - Don't track visited links in labels - Make labels selectable - Margin in loading widget: no more loadbar touching screen edges in mobile ### Changed - Event text justified to left - Use symbolic icon in search placeholder ## [0.6.3] - 2021-12-29 ### Add - Metainfo data about inputs support and screen size requirements ## [0.6.2] - 2021-11-10 ### Fixed - Better icons appearence in sidebar - Squared "Star" buttons ### Changed - Round corners in lists - Use app icon in empty starred page ## [0.6.1] - 2021-07-18 ### Add - Support for adaptive filter in Phosh app drawer ### Fixed - Event progressbar handle events with zero duration (devrtz) (fix ~fabrixxm/confy#18) ### Changed - Store events datetimes as UTC in db, display in current timezone. ## [0.6.0] - 2021-06-12 ### Added - Full-text search in shedule view (fix ~fabrixxm/confy#11) - Full-text search in starred view (fix ~fabrixxm/confy#12) ### Fixed - Add page stack to starred view (fix ~fabrixxm/confy#13) - Move Search Bar revealer out of overlay (fix ~fabrixxm/confy#10) ### Changed - Modify primary menu to better fit GNOME guidelines (seabass) - Move 'star event' button to end of event widget (seabass) ## [0.5.5] - 2020-04-06 ### Added - Open urls with default application per file type, if possible ## [0.5.4] - 20201-02-18 ### Fixed - Use correct file for appstream metadata - Remove more unsupported markup tags from strings - Fix "next up" query and notification ### Changed - Updated flatpack to GNOME Runtime 3.38 ## [0.5.3] - 2021-01-28 ### Added - Event progress indicator in event list row widget ### Fixed - Fix overlapping events query (don't return event ending/starting on same exact time) ## [0.5.2] - 2021-01-17 ### Added - Search in conferences list - Global shortcuts - Shortcuts window ### Changed - Install python module in python's site-lib dir - Fix metadata install path - Fix flatpak manifest: add python deps ## [0.5.1] - 2020-12-30 ### Added - Allow edit user-added conference metadata - Allow remove user-added conferences - Show editing dialog after adding a custom url - Clear cache from preferences dialog ### Changed - Set a maximum size for conferece logo in main page ### Fixed - Small fixes to UI - Support "baseurl" property in pentabarf - Fix XML entities stripping confy-0.8.0/COPYING000066400000000000000000001045141473600550000136750ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . confy-0.8.0/README.md000066400000000000000000000022021473600550000141100ustar00rootroot00000000000000 # Confy Conferences schedule viewer for GNOME Navigate Conference schedules, mark favourite talks Built with Python, GTK4 and Libadwaita - [Home Page](https://confy.kirgroup.net) - [Project Page](https://sr.ht/~fabrixxm/Confy) - [Patches and discussions](https://lists.sr.ht/~fabrixxm/confy-dev) - [Tickets](https://todo.sr.ht/~fabrixxm/confy) ## Packages [![Packaging status](https://repology.org/badge/vertical-allrepos/confy.svg)](https://repology.org/project/confy/versions) ## Build Requirements - GTK4 - Libadwaita - Python3 - python-gobjects - python-icalendar - meson and ninja - blueprint-compiler (tested with version 0.8.1 and 0.10.0) ### Build with Gnome Builder Use "Clone repository..." from Open window, press "Run" ### Build from command line git clone https://git.sr.ht/~fabrixxm/confy cd confy meson setup . _build ninja -C _build ninja -C _build install ## Issues and Patches Send issues to [~fabrixxm/confy@todo.sr.ht](https://todo.sr.ht/~fabrixxm/confy) Send patches to [~fabrixxm/confy-dev@lists.sr.ht](https://lists.sr.ht/~fabrixxm/confy-dev) confy-0.8.0/data/000077500000000000000000000000001473600550000135465ustar00rootroot00000000000000confy-0.8.0/data/data.gresource.xml000066400000000000000000000004671473600550000172050ustar00rootroot00000000000000 icons/scalable/apps/net.kirgroup.confy.svg icons/symbolic/apps/net.kirgroup.confy-symbolic.svg confy-0.8.0/data/icons/000077500000000000000000000000001473600550000146615ustar00rootroot00000000000000confy-0.8.0/data/icons/net.kirgroup.confy.Source.svg000066400000000000000000005572641473600550000224300ustar00rootroot00000000000000 Adwaita Icon Template image/svg+xml GNOME Design Team Adwaita Icon Template battery is full and there is no a/c connected. confy-0.8.0/data/icons/scalable/000077500000000000000000000000001473600550000164275ustar00rootroot00000000000000confy-0.8.0/data/icons/scalable/apps/000077500000000000000000000000001473600550000173725ustar00rootroot00000000000000confy-0.8.0/data/icons/scalable/apps/net.kirgroup.confy.svg000066400000000000000000000211351473600550000236610ustar00rootroot00000000000000 confy-0.8.0/data/icons/symbolic/000077500000000000000000000000001473600550000165025ustar00rootroot00000000000000confy-0.8.0/data/icons/symbolic/apps/000077500000000000000000000000001473600550000174455ustar00rootroot00000000000000confy-0.8.0/data/icons/symbolic/apps/net.kirgroup.confy-symbolic.svg000066400000000000000000000020741473600550000255540ustar00rootroot00000000000000 confy-0.8.0/data/meson.build000066400000000000000000000032131473600550000157070ustar00rootroot00000000000000pkgdatadir = join_paths(get_option('prefix'), get_option('datadir'), meson.project_name()) iconsdir = join_paths(get_option('datadir'), 'icons', 'hicolor') foreach size: ['scalable', 'symbolic'] install_subdir('icons/' + size, install_dir: iconsdir) endforeach gnome = import('gnome') gnome.compile_resources('confy.data', 'data.gresource.xml', gresource_bundle: true, install: true, install_dir: pkgdatadir, ) desktop_file = i18n.merge_file( input: 'net.kirgroup.confy.desktop.in', output: 'net.kirgroup.confy.desktop', type: 'desktop', po_dir: '../po', install: true, install_dir: join_paths(get_option('datadir'), 'applications') ) desktop_utils = find_program('desktop-file-validate', required: false) if desktop_utils.found() test('Validate desktop file', desktop_utils, args: [desktop_file] ) endif metainfo_file = i18n.merge_file( input: 'net.kirgroup.confy.metainfo.xml.in', output: 'net.kirgroup.confy.metainfo.xml', type: 'xml', po_dir: join_paths (meson.project_source_root(), 'po'), install: true, install_dir: join_paths (get_option ('datadir'), 'metainfo') ) appstream_cli = find_program('appstream-util', required: false) if appstream_cli.found() test('Validate appstream file', appstream_cli, args: ['validate', '--nonet', metainfo_file] ) endif install_data('net.kirgroup.confy.gschema.xml', install_dir: join_paths(get_option('datadir'), 'glib-2.0/schemas') ) compile_schemas = find_program('glib-compile-schemas', required: false) if compile_schemas.found() test('Validate schema file', compile_schemas, args: ['--strict', '--dry-run', meson.current_source_dir()] ) endif confy-0.8.0/data/net.kirgroup.confy.Devel.svg000066400000000000000000000457341473600550000211060ustar00rootroot00000000000000 confy-0.8.0/data/net.kirgroup.confy.desktop.in000066400000000000000000000003171473600550000213130ustar00rootroot00000000000000[Desktop Entry] Name=Confy Exec=confy Terminal=false Type=Application Categories=Utility;GTK; StartupNotify=true Icon=net.kirgroup.confy Keywords=Conference;Organize; X-Purism-FormFactor=Workstation;Mobile; confy-0.8.0/data/net.kirgroup.confy.gschema.xml000066400000000000000000000014221473600550000214410ustar00rootroot00000000000000 2 Events list cache duration App will auto-update cache (if possible) when it's older than setting. 2 Event info cache duration App will auto-update cache (if possible) when it's older than setting. 600 600 confy-0.8.0/data/net.kirgroup.confy.metainfo.xml.in000066400000000000000000000117321473600550000222460ustar00rootroot00000000000000 net.kirgroup.confy Confy Fabio Comuni ~fabrixxm/confy-dev@lists.sr.ht Conference schedules viewer

Confy lets you browse conference schedules.

Browse talks by day, track or room. Select the talks you are interested in and receive notification when they are about to start. View when two or more talks you are interested in overlap.

net.kirgroup.confy.desktop CC-BY-4.0 GPL-3.0-or-later https://confy.kirgroup.net https://todo.sr.ht/~fabrixxm/confy https://confy.kirgroup.net/appdata/confy1.png Confy start view with recently opened conferences https://confy.kirgroup.net/appdata/confy2.png Starred talks https://confy.kirgroup.net/appdata/confy3.png Talk details in mobile size mobile pointing keyboard touch 360

Show recent opened conferences in star page

Show speakers details and avatars, if available

User-selectable talks groupping in lists

Updated schedules parser

Updated UI

German translation, thanks to Sebastian Crane

Fix day format in Swedish translation

Update README

Fix Meson build scripts

Flatpak: bump to GNOME Runtime 45

Updated to Gtk4/libadwaita

Reviseted user interaction, dialogs and shortcuts

Copy talk detail into clipboard as plaintext from menu or shortcut

Fix events that are after UTC midnight

French tranlsation, thanks to Irénée Thirion

Swedish translation, thanks to Luna Jernberg

Fix Pentabarf date parsing

Flatpak: bump Gnome Runtime to verion 44

Convert markdown links to html hyperlinks

Don't track visited links in labels

Make labels selectable

Margin in loading widget: no more loadbar touching screen edges in mobile

Event text justified to left

Use symbolic icon in search placeholder

Update metainfo data with input support and display requirement.

Update appearance to better conform to Gnome

Fix event progressbar for events with zero duration

Display events talks datetimes in current timezone

Declare support for mobile devices in metadata

Search talks in schedule and starred view

Better page navigation in starred view

Varius enhancement to UI to better fit GNOME guidelines

Open urls with default application per file type, if possible.

Fix "next up" query and notification.

Fix text rendering issues with unsupported markup tags.

Add event progress indicator.

Fix overlapping events definition: exclude events ending/starting on same exact time.

confy-0.8.0/meson.build000066400000000000000000000007461473600550000150060ustar00rootroot00000000000000project('confy', version: '0.8.0', meson_version: '>= 0.63.0', default_options: [ 'warning_level=2', ], ) i18n = import('i18n') gnome = import('gnome') blueprint_compiler = find_program('blueprint-compiler') message('blueprint-compiler version @0@'.format(blueprint_compiler.version())) subdir('data') subdir('src') subdir('po') gnome.post_install( glib_compile_schemas: true, gtk_update_icon_cache: true, update_desktop_database: true, ) confy-0.8.0/meson_options.txt000066400000000000000000000000621473600550000162700ustar00rootroot00000000000000#option('devel', type : 'boolean', value : false) confy-0.8.0/mypy.ini000066400000000000000000000000261473600550000143320ustar00rootroot00000000000000[mypy] exclude = work confy-0.8.0/net.kirgroup.confy.json000066400000000000000000000022301473600550000172710ustar00rootroot00000000000000{ "app-id": "net.kirgroup.confy", "runtime": "org.gnome.Platform", "runtime-version": "47", "sdk": "org.gnome.Sdk", "command": "confy", "finish-args": [ "--share=network", "--share=ipc", "--socket=fallback-x11", "--socket=wayland", "--device=dri", "--talk-name=org.freedesktop.Notifications" ], "modules": [ { "name": "blueprint", "buildsystem": "meson", "cleanup": [ "*" ], "sources": [{ "type": "archive", "url": "https://gitlab.gnome.org/jwestman/blueprint-compiler/-/archive/v0.14.0/blueprint-compiler-v0.14.0.tar.gz", "sha256": "05faf3810cb76d4e2d2382c6a7e6c8096af27e144e2260635c97f6a173d67234" }] }, "python3-icalendar.json", { "name" : "confy", "builddir" : true, "buildsystem" : "meson", "sources" : [ { "type" : "dir", "path" : "." } ], "config-opts" : [] } ] } confy-0.8.0/po/000077500000000000000000000000001473600550000132535ustar00rootroot00000000000000confy-0.8.0/po/LINGUAS000066400000000000000000000000151473600550000142740ustar00rootroot00000000000000de fr it sv confy-0.8.0/po/POTFILES000066400000000000000000000023461473600550000144300ustar00rootroot00000000000000src/models.py src/openwindow.blp src/widgets/searchbaroverlay.blp src/widgets/loaderpage.blp src/widgets/starbutton.py src/widgets/__init__.py src/widgets/starbutton.blp src/widgets/eventactionrow.py src/widgets/author.py src/widgets/datepickerrow.py src/widgets/loaderpage.py src/widgets/navbar.py src/widgets/inputdialog.py src/widgets/searchbaroverlay.py src/widgets/weblinkactionrow.py src/widgets/togglesidebarbutton.py src/widgets/loadingoverlay.py src/widgets/eventeditdialog.blp src/widgets/eventeditdialog.py src/__init__.py src/local.py src/pages/__init__.py src/pages/events.blp src/pages/info.py src/pages/info.blp src/pages/list.blp src/pages/details.py src/pages/list.py src/pages/events.py src/pages/details.blp src/settings.py src/preferences.py src/confy.in src/config.py.in src/shortcuts.blp src/main.py src/migrations/003_person_details.py src/migrations/001_event_person_unique.py src/migrations/002_full_text_search.py src/migrations/000_initial.py src/networkconnectionmonitor.py src/utils.py src/openwindow.py src/fetcher.py src/mainwindow.py src/remotes/__init__.py src/remotes/ics.py src/remotes/exceptions.py src/remotes/pentabarf.py src/mainwindow.blp data/net.kirgroup.confy.desktop.in data/net.kirgroup.confy.metainfo.xml.in confy-0.8.0/po/de.po000066400000000000000000000370601473600550000142110ustar00rootroot00000000000000# German translations for confy package. # Copyright (C) 2020-2022 Fabio Comuni, et al. # This file is distributed under the same license as the confy package. # Sebastian Crane , 2024. # msgid "" msgstr "" "Project-Id-Version: confy\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2025-01-02 20:19+0100\n" "PO-Revision-Date: 2024-01-23 22:14+0000\n" "Last-Translator: Sebastian Crane \n" "Language-Team: German <~fabrixxm/confy-dev@lists.sr.ht>\n" "Language: de\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1)\n" "X-Generator: Gtranslator 42.0\n" #: src/openwindow.blp:15 msgid "Events" msgstr "Veranstaltungen" #: src/openwindow.blp:20 src/openwindow.blp:126 src/shortcuts.blp:55 msgid "Add event from URL" msgstr "Mittels URL Veranstaltung hinzufügen" #: src/openwindow.blp:27 src/openwindow.blp:56 src/shortcuts.blp:47 msgid "Find event" msgstr "Nach Veranstaltung suchen" #: src/openwindow.blp:41 msgid "Refresh events list" msgstr "Veranstaltungsliste aktualisieren" #: src/openwindow.blp:51 src/openwindow.blp:132 msgid "Edit events" msgstr "Veranstaltungen bearbeiten" #: src/openwindow.blp:62 msgid "Done" msgstr "" #: src/openwindow.blp:76 msgid "No events yet" msgstr "Noch keine Veranstaltungen" #: src/openwindow.blp:77 msgid "Add an event with the add button in title bar." msgstr "" "Fügen Sie eine Veranstaltung mittels dem „Hinzufügen“ Knofp in der " "Hauptleiste hinzu." #: src/openwindow.blp:83 src/pages/events.blp:70 msgid "No matches" msgstr "Keine Ergebnisse" #: src/openwindow.blp:98 msgid "Coming up" msgstr "Folgend" #: src/openwindow.blp:108 msgid "Past" msgstr "Früher" #: src/openwindow.blp:128 msgid "Refresh list" msgstr "Liste aktualisieren" #: src/openwindow.blp:130 msgid "Search" msgstr "Suchen" #. separator ? #: src/openwindow.blp:136 src/shortcuts.blp:13 src/mainwindow.blp:140 msgid "Preferences" msgstr "Einstellungen" #: src/openwindow.blp:138 src/shortcuts.blp:17 src/mainwindow.blp:145 msgid "Keyboard Shortcuts" msgstr "Tastenkombinationen" #: src/openwindow.blp:140 src/mainwindow.blp:150 msgid "About Confy" msgstr "Über Confy" #: src/widgets/loaderpage.blp:9 msgid "Loading..." msgstr "Gerade laden..." #: src/widgets/loaderpage.blp:21 src/widgets/inputdialog.py:32 #: src/widgets/eventeditdialog.blp:17 src/openwindow.py:113 msgid "Cancel" msgstr "Abbrechen" #: src/widgets/inputdialog.py:29 msgid "Add Event from URL" msgstr "Mittels URL Veranstaltung hinzufügen" #: src/widgets/inputdialog.py:30 msgid "" "Enter URL to event schedule to add it to the list.\n" "Confy supports events in Pentabarf (.xml) or iCal (.ics) format." msgstr "" "URL des Veranstaltungszeitplans eingeben, um die Liste es hinzuzufügen.\n" "Confy unterstützt Zeitpläne, die in Pentabarf (.xml) oder iCal (.ics) Format " "sind." #: src/widgets/inputdialog.py:33 msgid "Add" msgstr "Hinzufügen" #: src/widgets/loadingoverlay.py:38 src/widgets/loadingoverlay.py:43 msgid "Loading…" msgstr "Gerade laden…" #: src/widgets/loadingoverlay.py:45 msgid "cancel" msgstr "abbrechen" #: src/widgets/eventeditdialog.blp:8 msgid "Edit event" msgstr "Veranstaltung bearbeiten" #: src/widgets/eventeditdialog.blp:25 msgid "Save" msgstr "" #: src/widgets/eventeditdialog.blp:41 msgid "URL" msgstr "URL" #: src/widgets/eventeditdialog.blp:47 msgid "Title" msgstr "Titel" #: src/widgets/eventeditdialog.blp:52 msgid "Start" msgstr "Anfang" #: src/widgets/eventeditdialog.blp:56 msgid "End" msgstr "Ende" #: src/widgets/eventeditdialog.blp:60 msgid "Icon URL" msgstr "Icon URL" #: src/widgets/eventeditdialog.blp:70 src/openwindow.py:114 msgid "Delete" msgstr "Löschen" #: src/local.py:164 msgid "Device disconnected and no cached data available." msgstr "Gerät ist nicht verbunden und Cache ist nicht vorhanden." #. edit existing obj #: src/local.py:300 src/openwindow.py:166 msgid "Event already in list" msgstr "Veranstaltung ist bereits in der Liste" #: src/pages/events.blp:60 src/pages/list.blp:41 msgid "Nothing starred yet" msgstr "Noch nichts gespeichert" #: src/pages/events.blp:61 src/pages/list.blp:42 msgid "Star a talk to be notified when it's about to start." msgstr "" "Speichern Sie eine Vortrag, damit, wenn sie gleich anfängt, Sie mitteilen " "werden." #: src/pages/events.blp:82 msgid "Group by" msgstr "" #: src/pages/events.blp:84 msgid "Date" msgstr "" #: src/pages/events.blp:89 #, fuzzy msgid "Track" msgstr "Spuren" #: src/pages/events.blp:94 #, fuzzy msgid "Room" msgstr "Zimmer" #: src/pages/events.blp:99 msgid "No group" msgstr "" #: src/pages/events.py:152 msgid "Talks on {}" msgstr "Vorträge am {}" #: src/pages/events.py:165 msgid "{} Track" msgstr "Spur {}" #: src/pages/events.py:172 msgid "No Room" msgstr "Keinen Zimmer" #: src/pages/events.py:174 msgid "Room {}" msgstr "Zimmer {}" #: src/pages/events.py:182 src/mainwindow.py:49 msgid "Starred" msgstr "Gespeichert" #: src/pages/events.py:189 msgid "Search Talks" msgstr "Vorträge durchsuchen" #: src/pages/details.blp:100 msgid "Conflicts with" msgstr "Überschneidet sich mit" #: src/pages/details.blp:133 msgid "Links" msgstr "Hyperlinks" #: src/pages/details.blp:150 msgid "Copy to clipboard" msgstr "In Zwischenablage kopieren" #: src/preferences.py:50 msgid "Events list cache duration" msgstr "Cache-Lebensdauer der Veranstaltungsliste" #: src/preferences.py:51 msgid "Try to update list cache when it's older than this." msgstr "" "Den Cache der Veranstaltungsliste zu aktualisieren versuchen, immer wenn er " "älter als dies ist." #: src/preferences.py:56 msgid "Events info cache duration" msgstr "Cache-Lebensdauer der Veranstaltungsinformation" #: src/preferences.py:57 msgid "Try to update event cache when it's older than this." msgstr "" "Den Cache der Veranstaltungsinformation zu aktualisieren versuchen, immer " "wenn er älter als dies ist." #: src/preferences.py:66 msgid "Clear" msgstr "Löschen" #: src/preferences.py:70 msgid "Cached data" msgstr "Cachedaten" #: src/preferences.py:87 msgid "Confy has {} of cached data" msgstr "Confy hat {} Cachedaten" #: src/config.py.in:7 msgid "%A %B %d, %Y" msgstr " %A %d. %B %Y" #: src/shortcuts.blp:9 msgid "Application" msgstr "Applikation" #: src/shortcuts.blp:21 msgid "Close" msgstr "Schließen" #: src/shortcuts.blp:26 msgid "Event Window" msgstr "Veranstaltungssicht" #: src/shortcuts.blp:30 src/shortcuts.blp:43 src/mainwindow.blp:66 #: src/mainwindow.blp:135 msgid "Open Event" msgstr "Öffne Veranstaltung" #: src/shortcuts.blp:34 msgid "Find talk" msgstr "Vortrag suchen" #: src/shortcuts.blp:38 msgid "Copy talk details to clipboard" msgstr "Details des Vortrages in Zwischenablage kopieren" #: src/shortcuts.blp:51 msgid "Reload events list" msgstr "Veranstaltungsliste aktualisieren" #. Translators: about dialog text; this string should be replaced by a text crediting yourselves and your translation team, or should be left empty. Do not translate literally! #: src/main.py:141 msgid "translator-credits" msgstr "Sebastian Crane " #: src/main.py:142 data/net.kirgroup.confy.metainfo.xml.in:7 msgid "Conference schedules viewer" msgstr "Veranstaltungszeitplansichtprogramm" #: src/openwindow.py:54 src/openwindow.py:95 src/openwindow.py:200 msgid "" "Error loading events list:\n" "{}" msgstr "" "Fehler beim Herunterladen der Veranstaltungsliste:\n" "{}" #: src/openwindow.py:92 msgid "Events list updated" msgstr "Veranstaltungsliste ist aktualisiert worden" #: src/openwindow.py:111 msgid "Delete event \"{}\"?" msgstr "Veranstaltung \"{}\" löschen?" #: src/openwindow.py:112 msgid "Event will be removed from event list and related data will be deleted" msgstr "" "Veranstaltung wird von der Veranstaltungsliste entfernt werden und verwandte " "Daten werden löschen werden." #: src/openwindow.py:148 msgid "New event: {}" msgstr "Neue Veranstaltung: {}" #: src/openwindow.py:151 src/openwindow.py:173 msgid "Error: {}" msgstr "Fehler: {}" #: src/mainwindow.py:45 msgid "Event info" msgstr "Veranstaltungsinformation" #: src/mainwindow.py:46 msgid "Days" msgstr "Tage" #: src/mainwindow.py:47 msgid "Tracks" msgstr "Spuren" #: src/mainwindow.py:48 msgid "Rooms" msgstr "Zimmer" #: src/mainwindow.py:318 msgid "Next up: {}" msgstr "" #: src/mainwindow.py:319 msgid "at {} in {}" msgstr "" #: src/mainwindow.py:330 #, fuzzy msgid "Error loading event" msgstr "" "Fehler beim Herunterladen der Veranstaltungsliste:\n" "{}" #: src/mainwindow.py:333 msgid "Ok" msgstr "OK" #: src/mainwindow.py:384 #, fuzzy msgid "Event details copied to the clipboard" msgstr "Details des Vortrages in Zwischenablage kopieren" #: src/remotes/__init__.py:36 msgid "Unknown schedule format" msgstr "Unbekannt Zeitplansformat" #: src/remotes/pentabarf.py:55 msgid "Invalid pentabarf format" msgstr "Ungültiges Pentabarf-Format" #: src/mainwindow.blp:36 msgid "Open an Event to start" msgstr "Öffnen Sie eine Veranstaltung, um zu beginnen." #: src/mainwindow.blp:131 #, fuzzy msgid "Recent Events" msgstr "Öffne Veranstaltung" #: data/net.kirgroup.confy.desktop.in:2 #: data/net.kirgroup.confy.metainfo.xml.in:4 msgid "Confy" msgstr "Confy" #: data/net.kirgroup.confy.desktop.in:9 msgid "Conference;Organize;" msgstr "Tagung;Konferenz,organisieren;" #: data/net.kirgroup.confy.metainfo.xml.in:5 msgid "Fabio Comuni" msgstr "Fabio Comuni" #: data/net.kirgroup.confy.metainfo.xml.in:9 msgid "Confy lets you browse conference schedules." msgstr "Confy lässt Sie Veranstaltungszeitpläne blättern." #: data/net.kirgroup.confy.metainfo.xml.in:12 msgid "" "Browse talks by day, track or room. Select the talks you are interested in " "and receive notification when they are about to start. View when two or more " "talks you are interested in overlap." msgstr "" "Blättern Sie Vorträge nach Tag, Spur oder Zimmer. Wählen Sie die Vorträge, " "die Sie interessieren, und wenn sie gleich anfangen, bekommen Sie " "Nachrichten. Sehen, wenn zwei oder mehr Vorträge, die Sie interessieren, " "sich überschneiden." #: data/net.kirgroup.confy.metainfo.xml.in:51 msgid "German translation, thanks to Sebastian Crane" msgstr "Deutsches Übersetzen dank Sebastian Crane" #: data/net.kirgroup.confy.metainfo.xml.in:52 msgid "Fix day format in Swedish translation" msgstr "Datumsformat im Schwedischem Übersetzen beheben" #: data/net.kirgroup.confy.metainfo.xml.in:53 msgid "Update README" msgstr "README aktualisieren" #: data/net.kirgroup.confy.metainfo.xml.in:54 msgid "Fix Meson build scripts" msgstr "Meson-Erstellungsskripts beheben" #: data/net.kirgroup.confy.metainfo.xml.in:55 msgid "Flatpak: bump to GNOME Runtime 45" msgstr "Flatpak: Gnome Runtime zu Version 45 aktualisieren" #: data/net.kirgroup.confy.metainfo.xml.in:60 msgid "Updated to Gtk4/libadwaita" msgstr "Zu GTK4/Libadwaita aktualisieren" #: data/net.kirgroup.confy.metainfo.xml.in:61 msgid "Reviseted user interaction, dialogs and shortcuts" msgstr "Benutzerschnittstelle, Dialoge und Tastenkombinationen revidieren" #: data/net.kirgroup.confy.metainfo.xml.in:62 msgid "Copy talk detail into clipboard as plaintext from menu or shortcut" msgstr "" "Details des Vortrages in Zwischenablage mit Menü oder Tastenkombination als " "nur Text kopieren" #: data/net.kirgroup.confy.metainfo.xml.in:63 msgid "Fix events that are after UTC midnight" msgstr "" "Den Tag, dass für Vorträge, die nach Mitternacht in UTC stattfinden, zeigen " "wird, berichtigen" #: data/net.kirgroup.confy.metainfo.xml.in:68 msgid "French tranlsation, thanks to Irénée Thirion" msgstr "Französisches Übersetzen dank Irénée Thirion" #: data/net.kirgroup.confy.metainfo.xml.in:69 msgid "Swedish translation, thanks to Luna Jernberg" msgstr "Schwedisches Übersetzen dank Luna Jernberg" #: data/net.kirgroup.confy.metainfo.xml.in:70 msgid "Fix Pentabarf date parsing" msgstr "Pentabarf-Datunsanalysieren beheben" #: data/net.kirgroup.confy.metainfo.xml.in:71 msgid "Flatpak: bump Gnome Runtime to verion 44" msgstr "Flatpak: Gnome Runtime zu Version 44 aktualisieren" #: data/net.kirgroup.confy.metainfo.xml.in:76 msgid "Convert markdown links to html hyperlinks" msgstr "Markdown-Links in HTML-Hyperlinks verwandeln" #: data/net.kirgroup.confy.metainfo.xml.in:77 msgid "Don't track visited links in labels" msgstr "Besuchend Links in Beschriftungen nicht aufzeichnen" #: data/net.kirgroup.confy.metainfo.xml.in:78 msgid "Make labels selectable" msgstr "Beschriftungen auswählbar machen" #: data/net.kirgroup.confy.metainfo.xml.in:79 msgid "" "Margin in loading widget: no more loadbar touching screen edges in mobile" msgstr "" "Weißraum auf Laden-Anzeige hinzufügen, um Ladebalken Ränder des Bildschirmes " "nicht anzufassen, wenn auf Handy-Bildschirmen" #: data/net.kirgroup.confy.metainfo.xml.in:80 msgid "Event text justified to left" msgstr "Vortragstext linksbündig machen" #: data/net.kirgroup.confy.metainfo.xml.in:81 msgid "Use symbolic icon in search placeholder" msgstr "Symbol am Suchplatzhalter verwenden" #: data/net.kirgroup.confy.metainfo.xml.in:86 msgid "Update metainfo data with input support and display requirement." msgstr "" "Metainfo-Daten ändern, damit sie Input-Unterstützen und Bildschirm-" "Anforderung angeben." #: data/net.kirgroup.confy.metainfo.xml.in:91 msgid "Update appearance to better conform to Gnome" msgstr "Aussehen ändern, um zu GNOME besser zu passen" #: data/net.kirgroup.confy.metainfo.xml.in:96 msgid "Fix event progressbar for events with zero duration" msgstr "Fortschrittsanzeige für Vorträge, die keine Dauer haben, beheben" #: data/net.kirgroup.confy.metainfo.xml.in:97 msgid "Display events talks datetimes in current timezone" msgstr "" "Daten der Vorträge der Veranstaltungen in der derzeitigen Zeitzone anzeigen" #: data/net.kirgroup.confy.metainfo.xml.in:98 msgid "Declare support for mobile devices in metadata" msgstr "In Metadaten Unterstützen für Mobilgeräte angeben" #: data/net.kirgroup.confy.metainfo.xml.in:103 msgid "Search talks in schedule and starred view" msgstr "In Zeitplan und Gespeichert-Sicht Vorträge suchen" #: data/net.kirgroup.confy.metainfo.xml.in:104 msgid "Better page navigation in starred view" msgstr "Navigation in Gespeichert-Sicht verbessern" #: data/net.kirgroup.confy.metainfo.xml.in:105 msgid "Varius enhancement to UI to better fit GNOME guidelines" msgstr "Vielfältige Verbesserungen der grafischen Benutzeroberfläche machen" #: data/net.kirgroup.confy.metainfo.xml.in:110 msgid "Open urls with default application per file type, if possible." msgstr "Mit Standardapplikation pro Dateiformat URLs öffnen, wenn möglich." #: data/net.kirgroup.confy.metainfo.xml.in:115 msgid "Fix \"next up\" query and notification." msgstr "„Kommend“ Abfrage und Nachricht beheben" #: data/net.kirgroup.confy.metainfo.xml.in:116 msgid "Fix text rendering issues with unsupported markup tags." msgstr "" "Probleme, die Text-Rasterung mit nicht unterstützten Auszeichnungssprache-" "Tags betreffen, beheben." #: data/net.kirgroup.confy.metainfo.xml.in:121 msgid "Add event progress indicator." msgstr "Vortrag-Fortschrittsanzeige hinzufügen." #: data/net.kirgroup.confy.metainfo.xml.in:122 msgid "" "Fix overlapping events definition: exclude events ending/starting on same " "exact time." msgstr "" "Auslegung von überschneidenden Vorträgen beheben: Vorträge, die zur selben " "Zeit aufhören oder anfangen, ausschließen." #~ msgid "" #~ "App will auto-update cache (if possible) when it's older than setting." #~ msgstr "" #~ "Applikation wird den Cache automatisch aktualisiert (wenn möglich), wenn " #~ "älter als die Einstellung ist." #~ msgid "Event info cache duration" #~ msgstr "Cache-Lebensdauer der Veranstaltungsinformation" confy-0.8.0/po/fr.po000066400000000000000000000413611473600550000142270ustar00rootroot00000000000000# Italian translations for confy package. # Copyright (C) 2020-2022 Fabio Comuni, et al. # This file is distributed under the same license as the confy package. # Irénée Thirion , 2022. # msgid "" msgstr "" "Project-Id-Version: confy\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2025-01-02 20:19+0100\n" "PO-Revision-Date: 2022-09-19 20:32+0200\n" "Last-Translator: Irénée Thirion \n" "Language-Team: ~fabrixxm/confy-dev@lists.sr.ht\n" "Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" "X-Generator: Poedit 3.1.1\n" #: src/openwindow.blp:15 #, fuzzy msgid "Events" msgstr "Trouver un événement" #: src/openwindow.blp:20 src/openwindow.blp:126 src/shortcuts.blp:55 #, fuzzy msgid "Add event from URL" msgstr "Ajouter un événement depuis une URL" #: src/openwindow.blp:27 src/openwindow.blp:56 src/shortcuts.blp:47 msgid "Find event" msgstr "Trouver un événement" #: src/openwindow.blp:41 msgid "Refresh events list" msgstr "Rafraîchir la liste des événements" #: src/openwindow.blp:51 src/openwindow.blp:132 #, fuzzy msgid "Edit events" msgstr "Trouver un événement" #: src/openwindow.blp:62 msgid "Done" msgstr "" #: src/openwindow.blp:76 #, fuzzy msgid "No events yet" msgstr "Pas encore de conférences." #: src/openwindow.blp:77 #, fuzzy msgid "Add an event with the add button in title bar." msgstr "" "Ajoutez une conférence avec le bouton ajouter dans la barre supérieure." #: src/openwindow.blp:83 src/pages/events.blp:70 #, fuzzy msgid "No matches" msgstr "Aucune correspondance trouvée" #: src/openwindow.blp:98 msgid "Coming up" msgstr "À venir" #: src/openwindow.blp:108 msgid "Past" msgstr "Passé" #: src/openwindow.blp:128 #, fuzzy msgid "Refresh list" msgstr "Rafraîchir la liste des événements" #: src/openwindow.blp:130 #, fuzzy msgid "Search" msgstr "Conférences étoilées" #. separator ? #: src/openwindow.blp:136 src/shortcuts.blp:13 src/mainwindow.blp:140 msgid "Preferences" msgstr "Préférences" #: src/openwindow.blp:138 src/shortcuts.blp:17 src/mainwindow.blp:145 #, fuzzy msgid "Keyboard Shortcuts" msgstr "Raccourcis clavier" #: src/openwindow.blp:140 src/mainwindow.blp:150 #, fuzzy msgid "About Confy" msgstr "À propos de {}" #: src/widgets/loaderpage.blp:9 #, fuzzy msgid "Loading..." msgstr "Chargement…" #: src/widgets/loaderpage.blp:21 src/widgets/inputdialog.py:32 #: src/widgets/eventeditdialog.blp:17 src/openwindow.py:113 msgid "Cancel" msgstr "Annuler" #: src/widgets/inputdialog.py:29 #, fuzzy msgid "Add Event from URL" msgstr "Ajouter un événement depuis une URL" #: src/widgets/inputdialog.py:30 msgid "" "Enter URL to event schedule to add it to the list.\n" "Confy supports events in Pentabarf (.xml) or iCal (.ics) format." msgstr "" #: src/widgets/inputdialog.py:33 msgid "Add" msgstr "" #: src/widgets/loadingoverlay.py:38 src/widgets/loadingoverlay.py:43 msgid "Loading…" msgstr "Chargement…" #: src/widgets/loadingoverlay.py:45 #, fuzzy msgid "cancel" msgstr "Annuler" #: src/widgets/eventeditdialog.blp:8 #, fuzzy msgid "Edit event" msgstr "Trouver un événement" #: src/widgets/eventeditdialog.blp:25 msgid "Save" msgstr "" #: src/widgets/eventeditdialog.blp:41 msgid "URL" msgstr "URL" #: src/widgets/eventeditdialog.blp:47 msgid "Title" msgstr "Titre" #: src/widgets/eventeditdialog.blp:52 msgid "Start" msgstr "Début" #: src/widgets/eventeditdialog.blp:56 msgid "End" msgstr "Fin" #: src/widgets/eventeditdialog.blp:60 msgid "Icon URL" msgstr "URL d’icône" #: src/widgets/eventeditdialog.blp:70 src/openwindow.py:114 msgid "Delete" msgstr "Supprimer" #: src/local.py:164 msgid "Device disconnected and no cached data available." msgstr "Appareil déconnecté et aucune donnée en cache disponible." #. edit existing obj #: src/local.py:300 src/openwindow.py:166 msgid "Event already in list" msgstr "Événement déjà dans la liste" #: src/pages/events.blp:60 src/pages/list.blp:41 msgid "Nothing starred yet" msgstr "" #: src/pages/events.blp:61 src/pages/list.blp:42 msgid "Star a talk to be notified when it's about to start." msgstr "" #: src/pages/events.blp:82 msgid "Group by" msgstr "" #: src/pages/events.blp:84 msgid "Date" msgstr "" #: src/pages/events.blp:89 #, fuzzy msgid "Track" msgstr "Thèmes" #: src/pages/events.blp:94 #, fuzzy msgid "Room" msgstr "Salles" #: src/pages/events.blp:99 msgid "No group" msgstr "" #: src/pages/events.py:152 msgid "Talks on {}" msgstr "Conférences sur {}" #: src/pages/events.py:165 msgid "{} Track" msgstr "Thème {}" #: src/pages/events.py:172 msgid "No Room" msgstr "Aucune salle" #: src/pages/events.py:174 msgid "Room {}" msgstr "Salle {}" #: src/pages/events.py:182 src/mainwindow.py:49 msgid "Starred" msgstr "Étoilé" #: src/pages/events.py:189 #, fuzzy msgid "Search Talks" msgstr "Conférences étoilées" #: src/pages/details.blp:100 #, fuzzy msgid "Conflicts with" msgstr "Conflits avec" #: src/pages/details.blp:133 msgid "Links" msgstr "" #: src/pages/details.blp:150 msgid "Copy to clipboard" msgstr "" #: src/preferences.py:50 msgid "Events list cache duration" msgstr "Durée de la mise en cache de la liste d’événements" #: src/preferences.py:51 #, fuzzy msgid "Try to update list cache when it's older than this." msgstr "" "L’application mettra automatiquement à jour le cache (si possible) lorsqu'il " "sera plus ancien que cela." #: src/preferences.py:56 msgid "Events info cache duration" msgstr "Durée de la mise en cache des informations d’événements" #: src/preferences.py:57 #, fuzzy msgid "Try to update event cache when it's older than this." msgstr "" "L’application mettra automatiquement à jour le cache (si possible) lorsqu'il " "sera plus ancien que cela." #: src/preferences.py:66 msgid "Clear" msgstr "Nettoyer" #: src/preferences.py:70 msgid "Cached data" msgstr "Données en cache" #: src/preferences.py:87 msgid "Confy has {} of cached data" msgstr "Confy a {} de données en cache" #: src/config.py.in:7 msgid "%A %B %d, %Y" msgstr "" #: src/shortcuts.blp:9 msgid "Application" msgstr "" #: src/shortcuts.blp:21 msgid "Close" msgstr "" #: src/shortcuts.blp:26 #, fuzzy msgid "Event Window" msgstr "Modifier les informations" #: src/shortcuts.blp:30 src/shortcuts.blp:43 src/mainwindow.blp:66 #: src/mainwindow.blp:135 #, fuzzy msgid "Open Event" msgstr "Trouver un événement" #: src/shortcuts.blp:34 msgid "Find talk" msgstr "Trouver une conférence" #: src/shortcuts.blp:38 msgid "Copy talk details to clipboard" msgstr "" #: src/shortcuts.blp:51 #, fuzzy msgid "Reload events list" msgstr "Retourner à la liste des événements" #. Translators: about dialog text; this string should be replaced by a text crediting yourselves and your translation team, or should be left empty. Do not translate literally! #: src/main.py:141 msgid "translator-credits" msgstr "Irénée Thirion " #: src/main.py:142 data/net.kirgroup.confy.metainfo.xml.in:7 msgid "Conference schedules viewer" msgstr "Visionneuse de programmes de conférences" #: src/openwindow.py:54 src/openwindow.py:95 src/openwindow.py:200 msgid "" "Error loading events list:\n" "{}" msgstr "" "Erreur lors du chargement de la liste des événements :\n" "{}" #: src/openwindow.py:92 msgid "Events list updated" msgstr "Liste des événements mise à jour" #: src/openwindow.py:111 #, fuzzy msgid "Delete event \"{}\"?" msgstr "" "Événement supprimé :\n" "{}" #: src/openwindow.py:112 msgid "Event will be removed from event list and related data will be deleted" msgstr "" #: src/openwindow.py:148 #, fuzzy msgid "New event: {}" msgstr "" "Nouvel événement :\n" "{}" #: src/openwindow.py:151 src/openwindow.py:173 #, fuzzy msgid "Error: {}" msgstr "" "Erreur :\n" "{}" #: src/mainwindow.py:45 #, fuzzy msgid "Event info" msgstr "Modifier les informations" #: src/mainwindow.py:46 msgid "Days" msgstr "Jours" #: src/mainwindow.py:47 msgid "Tracks" msgstr "Thèmes" #: src/mainwindow.py:48 msgid "Rooms" msgstr "Salles" #: src/mainwindow.py:318 msgid "Next up: {}" msgstr "Suivant : {}" #: src/mainwindow.py:319 msgid "at {} in {}" msgstr "à {} dans {}" #: src/mainwindow.py:330 msgid "Error loading event" msgstr "Erreur lors du chargement de l’événement" #: src/mainwindow.py:333 msgid "Ok" msgstr "OK" #: src/mainwindow.py:384 msgid "Event details copied to the clipboard" msgstr "" #: src/remotes/__init__.py:36 msgid "Unknown schedule format" msgstr "Format de programme invalide" #: src/remotes/pentabarf.py:55 msgid "Invalid pentabarf format" msgstr "Format pentabarf invalide" #: src/mainwindow.blp:36 #, fuzzy msgid "Open an Event to start" msgstr "Trouver un événement" #: src/mainwindow.blp:131 #, fuzzy msgid "Recent Events" msgstr "Trouver un événement" #: data/net.kirgroup.confy.desktop.in:2 #: data/net.kirgroup.confy.metainfo.xml.in:4 msgid "Confy" msgstr "Confy" #: data/net.kirgroup.confy.desktop.in:9 msgid "Conference;Organize;" msgstr "Conférence;Organiser;planning;séminaire;rencontre;" #: data/net.kirgroup.confy.metainfo.xml.in:5 msgid "Fabio Comuni" msgstr "Fabio Comuni" #: data/net.kirgroup.confy.metainfo.xml.in:9 msgid "Confy lets you browse conference schedules." msgstr "Confy vous permet de parcourir des programmes de conférences." #: data/net.kirgroup.confy.metainfo.xml.in:12 msgid "" "Browse talks by day, track or room. Select the talks you are interested in " "and receive notification when they are about to start. View when two or more " "talks you are interested in overlap." msgstr "" "Parcourez les conférences par jour, thème ou salle. Sélectionnez les " "conférences qui vous intéressent et recevez une notification lorsqu’elles " "sont sur le point de commencer. Visualisez quand deux ou plusieurs " "conférences qui vous intéressent se chevauchent." #: data/net.kirgroup.confy.metainfo.xml.in:51 msgid "German translation, thanks to Sebastian Crane" msgstr "" #: data/net.kirgroup.confy.metainfo.xml.in:52 msgid "Fix day format in Swedish translation" msgstr "" #: data/net.kirgroup.confy.metainfo.xml.in:53 msgid "Update README" msgstr "" #: data/net.kirgroup.confy.metainfo.xml.in:54 msgid "Fix Meson build scripts" msgstr "" #: data/net.kirgroup.confy.metainfo.xml.in:55 msgid "Flatpak: bump to GNOME Runtime 45" msgstr "" #: data/net.kirgroup.confy.metainfo.xml.in:60 msgid "Updated to Gtk4/libadwaita" msgstr "" #: data/net.kirgroup.confy.metainfo.xml.in:61 msgid "Reviseted user interaction, dialogs and shortcuts" msgstr "" #: data/net.kirgroup.confy.metainfo.xml.in:62 msgid "Copy talk detail into clipboard as plaintext from menu or shortcut" msgstr "" #: data/net.kirgroup.confy.metainfo.xml.in:63 msgid "Fix events that are after UTC midnight" msgstr "" #: data/net.kirgroup.confy.metainfo.xml.in:68 msgid "French tranlsation, thanks to Irénée Thirion" msgstr "" #: data/net.kirgroup.confy.metainfo.xml.in:69 msgid "Swedish translation, thanks to Luna Jernberg" msgstr "" #: data/net.kirgroup.confy.metainfo.xml.in:70 msgid "Fix Pentabarf date parsing" msgstr "" #: data/net.kirgroup.confy.metainfo.xml.in:71 msgid "Flatpak: bump Gnome Runtime to verion 44" msgstr "" #: data/net.kirgroup.confy.metainfo.xml.in:76 msgid "Convert markdown links to html hyperlinks" msgstr "" #: data/net.kirgroup.confy.metainfo.xml.in:77 msgid "Don't track visited links in labels" msgstr "" #: data/net.kirgroup.confy.metainfo.xml.in:78 msgid "Make labels selectable" msgstr "" #: data/net.kirgroup.confy.metainfo.xml.in:79 msgid "" "Margin in loading widget: no more loadbar touching screen edges in mobile" msgstr "" #: data/net.kirgroup.confy.metainfo.xml.in:80 msgid "Event text justified to left" msgstr "" #: data/net.kirgroup.confy.metainfo.xml.in:81 msgid "Use symbolic icon in search placeholder" msgstr "" #: data/net.kirgroup.confy.metainfo.xml.in:86 msgid "Update metainfo data with input support and display requirement." msgstr "" "Mise à jour des métadonnées avec le support d’entrée et les exigences " "d’affichage." #: data/net.kirgroup.confy.metainfo.xml.in:91 msgid "Update appearance to better conform to Gnome" msgstr "Mise à jour de l’interface pour mieux correspondre à Gnome" #: data/net.kirgroup.confy.metainfo.xml.in:96 msgid "Fix event progressbar for events with zero duration" msgstr "" "Correction de la barre de progression des événements pour les événements de " "durée nulle" #: data/net.kirgroup.confy.metainfo.xml.in:97 msgid "Display events talks datetimes in current timezone" msgstr "" "Affichage des dates des conférences sur les événements dans le fuseau " "horaire actuel" #: data/net.kirgroup.confy.metainfo.xml.in:98 msgid "Declare support for mobile devices in metadata" msgstr "" "Déclaration de la prise en charge des appareils mobiles dans les métadonnées" #: data/net.kirgroup.confy.metainfo.xml.in:103 msgid "Search talks in schedule and starred view" msgstr "" "Recherche des conférences dans le calendrier et vue des conférences marquées " "d’une étoile" #: data/net.kirgroup.confy.metainfo.xml.in:104 msgid "Better page navigation in starred view" msgstr "" "Meilleure navigation dans la page dans la vue des événements marqués d’une " "étoile" #: data/net.kirgroup.confy.metainfo.xml.in:105 msgid "Varius enhancement to UI to better fit GNOME guidelines" msgstr "" "Diverses améliorations à l’interface pour mieux correspondre aux directives " "de GNOME" #: data/net.kirgroup.confy.metainfo.xml.in:110 msgid "Open urls with default application per file type, if possible." msgstr "" "Ouverture des liens avec l’application par défaut par type de fichier, quand " "c'est possible." #: data/net.kirgroup.confy.metainfo.xml.in:115 msgid "Fix \"next up\" query and notification." msgstr "Correction de la requête et de la notification « prochain »." #: data/net.kirgroup.confy.metainfo.xml.in:116 msgid "Fix text rendering issues with unsupported markup tags." msgstr "" "Correction des problèmes de rendu de textes avec des balises markup non " "prises en charge." #: data/net.kirgroup.confy.metainfo.xml.in:121 msgid "Add event progress indicator." msgstr "Ajout d’un indicateur de la progression de l’événement." #: data/net.kirgroup.confy.metainfo.xml.in:122 msgid "" "Fix overlapping events definition: exclude events ending/starting on same " "exact time." msgstr "" "Correction de la définition d’événements se chevauchant : sont exclus les " "événements qui finissent et commencent au même moment." #~ msgid "" #~ "App will auto-update cache (if possible) when it's older than setting." #~ msgstr "" #~ "L’application mettra automatiquement le cache à jour (si possible) " #~ "lorsqu’il sera plus ancien que le paramètre défini." #~ msgid "Event info cache duration" #~ msgstr "Durée de la mise en cache des informations d’événements" #, fuzzy #~ msgid "Open Conference" #~ msgstr "Modifier la conférence" #~ msgid "Show window menu" #~ msgstr "Afficher le fenêtre du menu" #~ msgid "Go back" #~ msgstr "Retourner en arrière" #~ msgid "Schedule" #~ msgstr "Programme" #~ msgid "Map" #~ msgstr "Carte" #~ msgid "" #~ "Updated event:\n" #~ "{}" #~ msgstr "" #~ "Événement mis à jour :\n" #~ "{}" #~ msgid "Event schedule updated" #~ msgstr "Programme de l’événement mis à jour" #~ msgid "cache updated" #~ msgstr "cache mis à jour" #~ msgid "Room: {}" #~ msgstr "Salle : {}" #~ msgid "Track: {}" #~ msgstr "Thème : {}" #~ msgid "Links" #~ msgstr "Liens" #~ msgid "You don't have any starred talk yet." #~ msgstr "Vous n’avez pas encore de conférences marquées d’une étoile." #~ msgid "" #~ "Click on the star button to add a talk to this list and to be reminded " #~ "when they are about to start." #~ msgstr "" #~ "Cliquez sur le bouton étoile pour ajouter une conférence à cette liste et " #~ "être notifié lorsqu’elle sera sur le point de commencer." #~ msgid "{}" #~ msgstr "{}" #~ msgid "Loading…" #~ msgstr "Chargement…" #~ msgid "Schedule URL" #~ msgstr "URL du programme" #~ msgid "%b %a %d %Y" #~ msgstr "%b %a %d %Y" #~ msgid "No cache" #~ msgstr "Pas de cache" #~ msgid "One hour" #~ msgstr "Une heure" #~ msgid "One day" #~ msgstr "Un jour" #~ msgid "One week" #~ msgstr "Une semaine" #~ msgid "Quit" #~ msgstr "Quitter" #~ msgid "" #~ "Confy lets you organise your visit - select talks to be reminded of (with " #~ "warnings in case of conflicts)." #~ msgstr "" #~ "Confy vous permet d’organiser votre visite - sélectionnez les conférences " #~ "dont vous voulez vous rappeler (avec des avertissements en cas de " #~ "conflits)" #~ msgid "Conference schedule viewer" #~ msgstr "Visionneuse de programmes de conférence" #~ msgid "Conferences schedule viewer" #~ msgstr "Visionneuse de programmes de conférences" confy-0.8.0/po/it.po000066400000000000000000000356261473600550000142430ustar00rootroot00000000000000# Italian translations for confy package. # Copyright (C) 2020-2022 Fabio Comuni, et al. # This file is distributed under the same license as the confy package. # Fabio Comuni , 2020-2025. # msgid "" msgstr "" "Project-Id-Version: confy\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2025-01-02 20:19+0100\n" "PO-Revision-Date: 2025-01-02 20:19+0100\n" "Last-Translator: Fabio Comuni \n" "Language-Team: Italian <~fabrixxm/confy-dev@lists.sr.ht>\n" "Language: it\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1)\n" "X-Generator: Gtranslator 47.1\n" #: src/openwindow.blp:15 msgid "Events" msgstr "Eventi" #: src/openwindow.blp:20 src/openwindow.blp:126 src/shortcuts.blp:55 msgid "Add event from URL" msgstr "Aggiungi evento da URL" #: src/openwindow.blp:27 src/openwindow.blp:56 src/shortcuts.blp:47 msgid "Find event" msgstr "Trova evento" #: src/openwindow.blp:41 msgid "Refresh events list" msgstr "Aggiorna lista eventi" #: src/openwindow.blp:51 src/openwindow.blp:132 msgid "Edit events" msgstr "Modifica eventi" #: src/openwindow.blp:62 msgid "Done" msgstr "Fatto" #: src/openwindow.blp:76 msgid "No events yet" msgstr "Ancora nessun evento" #: src/openwindow.blp:77 msgid "Add an event with the add button in title bar." msgstr "Aggiungi un evento con il bottone \"Aggiungi\" nella barra del titolo." #: src/openwindow.blp:83 src/pages/events.blp:70 msgid "No matches" msgstr "Nessuna corrispondenza" #: src/openwindow.blp:98 msgid "Coming up" msgstr "In arrivo" #: src/openwindow.blp:108 msgid "Past" msgstr "Passate" #: src/openwindow.blp:128 msgid "Refresh list" msgstr "Aggiorna lista" #: src/openwindow.blp:130 msgid "Search" msgstr "Cerca" #. separator ? #: src/openwindow.blp:136 src/shortcuts.blp:13 src/mainwindow.blp:140 msgid "Preferences" msgstr "Preferenze" #: src/openwindow.blp:138 src/shortcuts.blp:17 src/mainwindow.blp:145 msgid "Keyboard Shortcuts" msgstr "Scorciatoie da tastiera" #: src/openwindow.blp:140 src/mainwindow.blp:150 msgid "About Confy" msgstr "Informazioni su Confy" #: src/widgets/loaderpage.blp:9 msgid "Loading..." msgstr "Caricamento…" #: src/widgets/loaderpage.blp:21 src/widgets/inputdialog.py:32 #: src/widgets/eventeditdialog.blp:17 src/openwindow.py:113 msgid "Cancel" msgstr "Annulla" #: src/widgets/inputdialog.py:29 msgid "Add Event from URL" msgstr "Aggiungi evento da URL" #: src/widgets/inputdialog.py:30 msgid "" "Enter URL to event schedule to add it to the list.\n" "Confy supports events in Pentabarf (.xml) or iCal (.ics) format." msgstr "" "Inserisci l'indirizzo di un evento da aggiungere alla lista.\n" "Confy supporta eventi in formato Pentabarf (.xml) o iCal (.ics)." #: src/widgets/inputdialog.py:33 msgid "Add" msgstr "Aggiungi" #: src/widgets/loadingoverlay.py:38 src/widgets/loadingoverlay.py:43 msgid "Loading…" msgstr "Caricamento…" #: src/widgets/loadingoverlay.py:45 msgid "cancel" msgstr "annulla" #: src/widgets/eventeditdialog.blp:8 msgid "Edit event" msgstr "Modifica evento" #: src/widgets/eventeditdialog.blp:25 msgid "Save" msgstr "Salva" #: src/widgets/eventeditdialog.blp:41 msgid "URL" msgstr "URL" #: src/widgets/eventeditdialog.blp:47 msgid "Title" msgstr "Titolo" #: src/widgets/eventeditdialog.blp:52 msgid "Start" msgstr "Inizio" #: src/widgets/eventeditdialog.blp:56 msgid "End" msgstr "Fine" #: src/widgets/eventeditdialog.blp:60 msgid "Icon URL" msgstr "URL icona" #: src/widgets/eventeditdialog.blp:70 src/openwindow.py:114 msgid "Delete" msgstr "Rimuovi" #: src/local.py:164 msgid "Device disconnected and no cached data available." msgstr "Dispositivo disconnesso e nessun dato locale disponibile." #. edit existing obj #: src/local.py:300 src/openwindow.py:166 msgid "Event already in list" msgstr "Evento già in lista" #: src/pages/events.blp:60 src/pages/list.blp:41 msgid "Nothing starred yet" msgstr "Nessun preferito ancora" #: src/pages/events.blp:61 src/pages/list.blp:42 msgid "Star a talk to be notified when it's about to start." msgstr "" "Metti un talk tra i preferiti per essere notificato quando sta per iniziare." #: src/pages/events.blp:82 msgid "Group by" msgstr "Raggruppa per" #: src/pages/events.blp:84 msgid "Date" msgstr "Data" #: src/pages/events.blp:89 msgid "Track" msgstr "Tema" #: src/pages/events.blp:94 msgid "Room" msgstr "Stanza" #: src/pages/events.blp:99 msgid "No group" msgstr "Non raggruppare" #: src/pages/events.py:152 msgid "Talks on {}" msgstr "Presentazioni il {}" #: src/pages/events.py:165 msgid "{} Track" msgstr "Tema {}" #: src/pages/events.py:172 msgid "No Room" msgstr "Nessuna Stanza" #: src/pages/events.py:174 msgid "Room {}" msgstr "Stanza {}" #: src/pages/events.py:182 src/mainwindow.py:49 msgid "Starred" msgstr "Preferiti" #: src/pages/events.py:189 msgid "Search Talks" msgstr "Cerca Presentazioni" #: src/pages/details.blp:100 msgid "Conflicts with" msgstr "In conflitto con" #: src/pages/details.blp:133 msgid "Links" msgstr "Collegametni" #: src/pages/details.blp:150 msgid "Copy to clipboard" msgstr "Copia negli appunti" #: src/preferences.py:50 msgid "Events list cache duration" msgstr "Durata cache lista eventi" #: src/preferences.py:51 msgid "Try to update list cache when it's older than this." msgstr "Prova ad aggiornare la cache quando è più vecchia di." #: src/preferences.py:56 msgid "Events info cache duration" msgstr "Durata cache informazioni eventi" #: src/preferences.py:57 msgid "Try to update event cache when it's older than this." msgstr "Prova ad aggiornare la cache quando è più vecchia di." #: src/preferences.py:66 msgid "Clear" msgstr "Pulisci" #: src/preferences.py:70 msgid "Cached data" msgstr "Dati in cache" #: src/preferences.py:87 msgid "Confy has {} of cached data" msgstr "Confy ha {} di dati in cache" #: src/config.py.in:7 msgid "%A %B %d, %Y" msgstr "%A %d %B %Y" #: src/shortcuts.blp:9 msgid "Application" msgstr "Applicazione" #: src/shortcuts.blp:21 msgid "Close" msgstr "Chiude" #: src/shortcuts.blp:26 msgid "Event Window" msgstr "Finestra Evento" #: src/shortcuts.blp:30 src/shortcuts.blp:43 src/mainwindow.blp:66 #: src/mainwindow.blp:135 msgid "Open Event" msgstr "Apri Evento" #: src/shortcuts.blp:34 msgid "Find talk" msgstr "Trova talk" #: src/shortcuts.blp:38 msgid "Copy talk details to clipboard" msgstr "Copia dettagli talk negli appunti" #: src/shortcuts.blp:51 msgid "Reload events list" msgstr "Ricarica lista eventi" #. Translators: about dialog text; this string should be replaced by a text crediting yourselves and your translation team, or should be left empty. Do not translate literally! #: src/main.py:141 msgid "translator-credits" msgstr "Fabio Comuni " #: src/main.py:142 data/net.kirgroup.confy.metainfo.xml.in:7 msgid "Conference schedules viewer" msgstr "Visualizzatore di programmi di conferenze" #: src/openwindow.py:54 src/openwindow.py:95 src/openwindow.py:200 msgid "" "Error loading events list:\n" "{}" msgstr "" "Errore caricando la lista eventi\n" "{}" #: src/openwindow.py:92 msgid "Events list updated" msgstr "Lista eventi aggiornata" #: src/openwindow.py:111 msgid "Delete event \"{}\"?" msgstr "Cancellare l'evento \"{}\"?" #: src/openwindow.py:112 msgid "Event will be removed from event list and related data will be deleted" msgstr "" "L'evento verrà rimosso dalla lista degli eventi e i relativi dati cancellati" #: src/openwindow.py:148 msgid "New event: {}" msgstr "Nuovo evento: {}" #: src/openwindow.py:151 src/openwindow.py:173 msgid "Error: {}" msgstr "Errore: {}" #: src/mainwindow.py:45 msgid "Event info" msgstr "Informazioni Evento" #: src/mainwindow.py:46 msgid "Days" msgstr "Giorni" #: src/mainwindow.py:47 msgid "Tracks" msgstr "Temi" #: src/mainwindow.py:48 msgid "Rooms" msgstr "Stanze" #: src/mainwindow.py:318 msgid "Next up: {}" msgstr "Il prossimo: {}" #: src/mainwindow.py:319 msgid "at {} in {}" msgstr "alle {} in {}" #: src/mainwindow.py:330 msgid "Error loading event" msgstr "Errore caricando l'evento" #: src/mainwindow.py:333 msgid "Ok" msgstr "Ok" #: src/mainwindow.py:384 msgid "Event details copied to the clipboard" msgstr "Dettagli talk copiati negli appunti" #: src/remotes/__init__.py:36 msgid "Unknown schedule format" msgstr "Formato programma sconosciuto" #: src/remotes/pentabarf.py:55 msgid "Invalid pentabarf format" msgstr "Formato pentabarf non valido" #: src/mainwindow.blp:36 msgid "Open an Event to start" msgstr "Apri un Evento per iniziare" #: src/mainwindow.blp:131 msgid "Recent Events" msgstr "Eventi Recenti" #: data/net.kirgroup.confy.desktop.in:2 #: data/net.kirgroup.confy.metainfo.xml.in:4 msgid "Confy" msgstr "Confy" #: data/net.kirgroup.confy.desktop.in:9 msgid "Conference;Organize;" msgstr "Conferenze;Organizza;" #: data/net.kirgroup.confy.metainfo.xml.in:5 msgid "Fabio Comuni" msgstr "Fabio Comuni" #: data/net.kirgroup.confy.metainfo.xml.in:9 msgid "Confy lets you browse conference schedules." msgstr "Confy permette di navigare i programmi delle conferenze" #: data/net.kirgroup.confy.metainfo.xml.in:12 msgid "" "Browse talks by day, track or room. Select the talks you are interested in " "and receive notification when they are about to start. View when two or more " "talks you are interested in overlap." msgstr "" "Sfoglia i talk per giorno, traccia o stanza. Seleziona i talk che ti " "interessano e ricevi una notifica quando stanno per iniziare. Visualizza " "quando due o più talk a cui sei interessato si sovrappongono." #: data/net.kirgroup.confy.metainfo.xml.in:51 msgid "German translation, thanks to Sebastian Crane" msgstr "Traduzione in tedesco, grazie a Sebastian Crane" #: data/net.kirgroup.confy.metainfo.xml.in:52 msgid "Fix day format in Swedish translation" msgstr "Formato data corretto nella traduzione svedese" #: data/net.kirgroup.confy.metainfo.xml.in:53 msgid "Update README" msgstr "Aggiornato README" #: data/net.kirgroup.confy.metainfo.xml.in:54 msgid "Fix Meson build scripts" msgstr "Corretti gli script di Meson" #: data/net.kirgroup.confy.metainfo.xml.in:55 msgid "Flatpak: bump to GNOME Runtime 45" msgstr "Flatpag: aggiorna la versione di Gnome Runtime alla 45" #: data/net.kirgroup.confy.metainfo.xml.in:60 msgid "Updated to Gtk4/libadwaita" msgstr "Aggiornato a Gtk4/libadwaita" #: data/net.kirgroup.confy.metainfo.xml.in:61 msgid "Reviseted user interaction, dialogs and shortcuts" msgstr "Rivisti interazione utente, dialoghi e shorcuts" #: data/net.kirgroup.confy.metainfo.xml.in:62 msgid "Copy talk detail into clipboard as plaintext from menu or shortcut" msgstr "" "Copia dettagli talk negli appunti come testo semplice da menu o da " "scorciatoia" #: data/net.kirgroup.confy.metainfo.xml.in:63 msgid "Fix events that are after UTC midnight" msgstr "Corretti gli eventi a cavallo della mezzanotte UTC" #: data/net.kirgroup.confy.metainfo.xml.in:68 msgid "French tranlsation, thanks to Irénée Thirion" msgstr "Traduzione in francese, grazie a Irénée Thirion" #: data/net.kirgroup.confy.metainfo.xml.in:69 msgid "Swedish translation, thanks to Luna Jernberg" msgstr "Traduzione in svedese, grazie a Luna Jernberg" #: data/net.kirgroup.confy.metainfo.xml.in:70 msgid "Fix Pentabarf date parsing" msgstr "Corretta la lettura delle date da Pentabarf" #: data/net.kirgroup.confy.metainfo.xml.in:71 msgid "Flatpak: bump Gnome Runtime to verion 44" msgstr "Flatpag: aggiorna la versione di Gnome Runtime alla 44" #: data/net.kirgroup.confy.metainfo.xml.in:76 msgid "Convert markdown links to html hyperlinks" msgstr "Converte i link markdown in hyperlink html" #: data/net.kirgroup.confy.metainfo.xml.in:77 msgid "Don't track visited links in labels" msgstr "Non traccia i link visitati nelle etichette" #: data/net.kirgroup.confy.metainfo.xml.in:78 msgid "Make labels selectable" msgstr "Rese le etichette selezionabili" #: data/net.kirgroup.confy.metainfo.xml.in:79 msgid "" "Margin in loading widget: no more loadbar touching screen edges in mobile" msgstr "" "Margini nel widget di progresso caricamento: la barra di progresso non tocca " "più i lati dello schermo in mobile" #: data/net.kirgroup.confy.metainfo.xml.in:80 msgid "Event text justified to left" msgstr "Giustifica il testo delle presentazioni a sinistra" #: data/net.kirgroup.confy.metainfo.xml.in:81 msgid "Use symbolic icon in search placeholder" msgstr "Usa icona simbolica nel segnaposto della ricerca" #: data/net.kirgroup.confy.metainfo.xml.in:86 msgid "Update metainfo data with input support and display requirement." msgstr "" "Aggiornati i metadati con info sul supporto input e le richieste display." #: data/net.kirgroup.confy.metainfo.xml.in:91 msgid "Update appearance to better conform to Gnome" msgstr "" "Aggiornato l'aspetto per meglio conformarsi meglio alle linee guida Gnome" #: data/net.kirgroup.confy.metainfo.xml.in:96 msgid "Fix event progressbar for events with zero duration" msgstr "Sistemata la barra di avanzamento per gli eventi con durata zero" #: data/net.kirgroup.confy.metainfo.xml.in:97 msgid "Display events talks datetimes in current timezone" msgstr "Mostra data e ora dei talk nel fuso orario corrente" #: data/net.kirgroup.confy.metainfo.xml.in:98 msgid "Declare support for mobile devices in metadata" msgstr "Dichiara supporto per device mobili nei metadati" #: data/net.kirgroup.confy.metainfo.xml.in:103 msgid "Search talks in schedule and starred view" msgstr "Ricerca talk nelle viste Programma e Preferiti" #: data/net.kirgroup.confy.metainfo.xml.in:104 msgid "Better page navigation in starred view" msgstr "Navigazione tra pagine migliorata nella vista Preferiti" #: data/net.kirgroup.confy.metainfo.xml.in:105 msgid "Varius enhancement to UI to better fit GNOME guidelines" msgstr "" "Varie migliorie all'interfaccia per conformarsi meglio alle linee guida di " "GNOME" #: data/net.kirgroup.confy.metainfo.xml.in:110 msgid "Open urls with default application per file type, if possible." msgstr "" "Apri utl con l'applcazione di default per il tipo di file, se possibile." #: data/net.kirgroup.confy.metainfo.xml.in:115 msgid "Fix \"next up\" query and notification." msgstr "Sistema query e notifiche \"in arrivo\"" #: data/net.kirgroup.confy.metainfo.xml.in:116 msgid "Fix text rendering issues with unsupported markup tags." msgstr "Sistema i problemi nel rendere il testo a causa di tag non supportati" #: data/net.kirgroup.confy.metainfo.xml.in:121 msgid "Add event progress indicator." msgstr "Aggiunge un indicatore di progresso dei talk" #: data/net.kirgroup.confy.metainfo.xml.in:122 msgid "" "Fix overlapping events definition: exclude events ending/starting on same " "exact time." msgstr "" "Sistema la definizione degli eventi sovrapposti: esclude gli eventi che " "iniziano/finiscono alla stessa identica ora." #~ msgid "" #~ "App will auto-update cache (if possible) when it's older than setting." #~ msgstr "" #~ "L'app aggiornerà automaticamente (se possibile) la cache quando è più " #~ "vecchia di quanto impostato" #~ msgid "Event info cache duration" #~ msgstr "Durata cache informazioni evento" confy-0.8.0/po/meson.build000066400000000000000000000000461473600550000154150ustar00rootroot00000000000000i18n.gettext('confy', preset: 'glib') confy-0.8.0/po/sv.po000066400000000000000000000413321473600550000142460ustar00rootroot00000000000000# Swedish translations for confy package. # Copyright (C) 2020-2022 Fabio Comuni, et al. # This file is distributed under the same license as the confy package. # Luna Jernberg , 2023. # msgid "" msgstr "" "Project-Id-Version: confy\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2025-01-02 20:19+0100\n" "PO-Revision-Date: 2024-02-12 10:17+0100\n" "Last-Translator: Luna Jernberg \n" "Language-Team: ~fabrixxm/confy-dev@lists.sr.ht\n" "Language: sv\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" "X-Generator: Poedit 3.4.2\n" #: src/openwindow.blp:15 msgid "Events" msgstr "Evenemang" #: src/openwindow.blp:20 src/openwindow.blp:126 src/shortcuts.blp:55 msgid "Add event from URL" msgstr "Lägg till evenemang från URL" #: src/openwindow.blp:27 src/openwindow.blp:56 src/shortcuts.blp:47 msgid "Find event" msgstr "Hitta evenemang" #: src/openwindow.blp:41 msgid "Refresh events list" msgstr "Uppdatera listan med evenemang" #: src/openwindow.blp:51 src/openwindow.blp:132 msgid "Edit events" msgstr "Redigera evenemang" #: src/openwindow.blp:62 msgid "Done" msgstr "" #: src/openwindow.blp:76 msgid "No events yet" msgstr "Inga evenemang än" #: src/openwindow.blp:77 msgid "Add an event with the add button in title bar." msgstr "Lägg till ett evenemang med knappen Lägg till i namnlisten." #: src/openwindow.blp:83 src/pages/events.blp:70 msgid "No matches" msgstr "Inga matchningar" #: src/openwindow.blp:98 msgid "Coming up" msgstr "Kommer upp" #: src/openwindow.blp:108 msgid "Past" msgstr "Förbi" #: src/openwindow.blp:128 msgid "Refresh list" msgstr "Uppdatera lista" #: src/openwindow.blp:130 msgid "Search" msgstr "Sök" #. separator ? #: src/openwindow.blp:136 src/shortcuts.blp:13 src/mainwindow.blp:140 msgid "Preferences" msgstr "Inställningar" #: src/openwindow.blp:138 src/shortcuts.blp:17 src/mainwindow.blp:145 msgid "Keyboard Shortcuts" msgstr "Tangentbordsgenvägar" #: src/openwindow.blp:140 src/mainwindow.blp:150 msgid "About Confy" msgstr "Om Confy" #: src/widgets/loaderpage.blp:9 msgid "Loading..." msgstr "Laddar..." #: src/widgets/loaderpage.blp:21 src/widgets/inputdialog.py:32 #: src/widgets/eventeditdialog.blp:17 src/openwindow.py:113 msgid "Cancel" msgstr "Avbryt" #: src/widgets/inputdialog.py:29 msgid "Add Event from URL" msgstr "Lägg till evenemang från URL" #: src/widgets/inputdialog.py:30 msgid "" "Enter URL to event schedule to add it to the list.\n" "Confy supports events in Pentabarf (.xml) or iCal (.ics) format." msgstr "" "Ange URL till evenemangsschemat för att lägga till det i listan.\n" "Confy stöder evenemang i Pentabarf (.xml) eller iCal (.ics) format." #: src/widgets/inputdialog.py:33 msgid "Add" msgstr "Lägg till" #: src/widgets/loadingoverlay.py:38 src/widgets/loadingoverlay.py:43 msgid "Loading…" msgstr "Laddar…" #: src/widgets/loadingoverlay.py:45 msgid "cancel" msgstr "avbryt" #: src/widgets/eventeditdialog.blp:8 msgid "Edit event" msgstr "Redigera evenemang" #: src/widgets/eventeditdialog.blp:25 msgid "Save" msgstr "" #: src/widgets/eventeditdialog.blp:41 msgid "URL" msgstr "URL" #: src/widgets/eventeditdialog.blp:47 msgid "Title" msgstr "Titel" #: src/widgets/eventeditdialog.blp:52 msgid "Start" msgstr "Start" #: src/widgets/eventeditdialog.blp:56 msgid "End" msgstr "Slut" #: src/widgets/eventeditdialog.blp:60 msgid "Icon URL" msgstr "Ikon-URL" #: src/widgets/eventeditdialog.blp:70 src/openwindow.py:114 msgid "Delete" msgstr "Ta bort" #: src/local.py:164 msgid "Device disconnected and no cached data available." msgstr "Enheten är frånkopplad och ingen cachad data tillgänglig." #. edit existing obj #: src/local.py:300 src/openwindow.py:166 msgid "Event already in list" msgstr "Evenemanget finns redan i listan" #: src/pages/events.blp:60 src/pages/list.blp:41 msgid "Nothing starred yet" msgstr "Inget stjärnmärkt ännu" #: src/pages/events.blp:61 src/pages/list.blp:42 msgid "Star a talk to be notified when it's about to start." msgstr "Stjärnmärk en föreläsning för att få ett meddelande när den ska börja." #: src/pages/events.blp:82 msgid "Group by" msgstr "" #: src/pages/events.blp:84 msgid "Date" msgstr "" #: src/pages/events.blp:89 #, fuzzy msgid "Track" msgstr "Spår" #: src/pages/events.blp:94 #, fuzzy msgid "Room" msgstr "Rum" #: src/pages/events.blp:99 msgid "No group" msgstr "" #: src/pages/events.py:152 msgid "Talks on {}" msgstr "Föreläsningar på {}" #: src/pages/events.py:165 msgid "{} Track" msgstr "{} Spår" #: src/pages/events.py:172 msgid "No Room" msgstr "Inga rum" #: src/pages/events.py:174 msgid "Room {}" msgstr "Rum {}" #: src/pages/events.py:182 src/mainwindow.py:49 msgid "Starred" msgstr "Stjärnmärkt" #: src/pages/events.py:189 msgid "Search Talks" msgstr "Sök efter föreläsningar" #: src/pages/details.blp:100 msgid "Conflicts with" msgstr "Krockar med" #: src/pages/details.blp:133 msgid "Links" msgstr "Länkar" #: src/pages/details.blp:150 msgid "Copy to clipboard" msgstr "Kopiera till urklipp" #: src/preferences.py:50 msgid "Events list cache duration" msgstr "Evenemangslistans cachelängd" #: src/preferences.py:51 msgid "Try to update list cache when it's older than this." msgstr "Försök att uppdatera listcachen när den är äldre än detta." #: src/preferences.py:56 msgid "Events info cache duration" msgstr "Evenemangsinformation cache varaktighet" #: src/preferences.py:57 msgid "Try to update event cache when it's older than this." msgstr "Försök att uppdatera evenemangscachen när den är äldre än detta." #: src/preferences.py:66 msgid "Clear" msgstr "Rensa" #: src/preferences.py:70 msgid "Cached data" msgstr "Cachad data" #: src/preferences.py:87 msgid "Confy has {} of cached data" msgstr "Confy har {} cachad data" #: src/config.py.in:7 msgid "%A %B %d, %Y" msgstr "%A %B %d, %Y" #: src/shortcuts.blp:9 msgid "Application" msgstr "Program" #: src/shortcuts.blp:21 msgid "Close" msgstr "Stäng" #: src/shortcuts.blp:26 msgid "Event Window" msgstr "Evenemangs fönster" #: src/shortcuts.blp:30 src/shortcuts.blp:43 src/mainwindow.blp:66 #: src/mainwindow.blp:135 msgid "Open Event" msgstr "Öppna evenemang" #: src/shortcuts.blp:34 msgid "Find talk" msgstr "Hitta föreläsning" #: src/shortcuts.blp:38 msgid "Copy talk details to clipboard" msgstr "Kopiera föreläsningsdetaljer till urklipp" #: src/shortcuts.blp:51 msgid "Reload events list" msgstr "Ladda om evenemangslista" #. Translators: about dialog text; this string should be replaced by a text crediting yourselves and your translation team, or should be left empty. Do not translate literally! #: src/main.py:141 msgid "translator-credits" msgstr "Luna Jernberg " #: src/main.py:142 data/net.kirgroup.confy.metainfo.xml.in:7 msgid "Conference schedules viewer" msgstr "Konferensscheman visare" #: src/openwindow.py:54 src/openwindow.py:95 src/openwindow.py:200 msgid "" "Error loading events list:\n" "{}" msgstr "" "Fel vid laddning av evenemangslistan:\n" "{}" #: src/openwindow.py:92 msgid "Events list updated" msgstr "Evenemangslistan uppdaterad" #: src/openwindow.py:111 msgid "Delete event \"{}\"?" msgstr "Ta bort evenemang \"{}\"?" #: src/openwindow.py:112 msgid "Event will be removed from event list and related data will be deleted" msgstr "" "Evenemanget kommer att tas bort från evenemangslistan och relaterad data " "kommer att raderas" #: src/openwindow.py:148 msgid "New event: {}" msgstr "Nytt evenemang : {}" #: src/openwindow.py:151 src/openwindow.py:173 msgid "Error: {}" msgstr "Fel : {}" #: src/mainwindow.py:45 msgid "Event info" msgstr "Evenemangsinformation" #: src/mainwindow.py:46 msgid "Days" msgstr "Dagar" #: src/mainwindow.py:47 msgid "Tracks" msgstr "Spår" #: src/mainwindow.py:48 msgid "Rooms" msgstr "Rum" #: src/mainwindow.py:318 msgid "Next up: {}" msgstr "Nästa: {}" #: src/mainwindow.py:319 msgid "at {} in {}" msgstr "på {} i {}" #: src/mainwindow.py:330 msgid "Error loading event" msgstr "Fel vid laddning av evenemang" #: src/mainwindow.py:333 msgid "Ok" msgstr "OK" #: src/mainwindow.py:384 #, fuzzy msgid "Event details copied to the clipboard" msgstr "Kopiera föreläsningsdetaljer till urklipp" #: src/remotes/__init__.py:36 msgid "Unknown schedule format" msgstr "Okänt schemaformat" #: src/remotes/pentabarf.py:55 msgid "Invalid pentabarf format" msgstr "Ogiltigt pentabarf format" #: src/mainwindow.blp:36 msgid "Open an Event to start" msgstr "Öppna ett evenemang vid uppstart" #: src/mainwindow.blp:131 #, fuzzy msgid "Recent Events" msgstr "Öppna evenemang" #: data/net.kirgroup.confy.desktop.in:2 #: data/net.kirgroup.confy.metainfo.xml.in:4 msgid "Confy" msgstr "Confy" #: data/net.kirgroup.confy.desktop.in:9 msgid "Conference;Organize;" msgstr "Konferens;Organisera;schemalägga;seminarium;möte;" #: data/net.kirgroup.confy.metainfo.xml.in:5 msgid "Fabio Comuni" msgstr "Fabio Comuni" #: data/net.kirgroup.confy.metainfo.xml.in:9 msgid "Confy lets you browse conference schedules." msgstr "Confy låter dig bläddra i konferensscheman." #: data/net.kirgroup.confy.metainfo.xml.in:12 msgid "" "Browse talks by day, track or room. Select the talks you are interested in " "and receive notification when they are about to start. View when two or more " "talks you are interested in overlap." msgstr "" "Bläddra bland föreläsningar efter dag, spår eller rum. Välj de föreläsningar " "du är intresserad av och få ett meddelande när de ska börja. Se när två " "eller flera föredrag som du är intresserad av överlappar varandra." #: data/net.kirgroup.confy.metainfo.xml.in:51 msgid "German translation, thanks to Sebastian Crane" msgstr "Tysk översättning, tack till Sebastian Crane" #: data/net.kirgroup.confy.metainfo.xml.in:52 msgid "Fix day format in Swedish translation" msgstr "Fixat dag format i den svenska översättningen" #: data/net.kirgroup.confy.metainfo.xml.in:53 msgid "Update README" msgstr "Uppdaterat README" #: data/net.kirgroup.confy.metainfo.xml.in:54 msgid "Fix Meson build scripts" msgstr "Fixat Meson bygg-skript" #: data/net.kirgroup.confy.metainfo.xml.in:55 msgid "Flatpak: bump to GNOME Runtime 45" msgstr "Flatpak: öka Gnome körtid till version 45" #: data/net.kirgroup.confy.metainfo.xml.in:60 msgid "Updated to Gtk4/libadwaita" msgstr "Uppdaterat till Gtk4/libadwaita" #: data/net.kirgroup.confy.metainfo.xml.in:61 msgid "Reviseted user interaction, dialogs and shortcuts" msgstr "Omarbetat användarinteraktion, dialogrutor och genvägar" #: data/net.kirgroup.confy.metainfo.xml.in:62 msgid "Copy talk detail into clipboard as plaintext from menu or shortcut" msgstr "" "Kopiera föreläsningsdetaljer till urklipp som klartext från meny eller genväg" #: data/net.kirgroup.confy.metainfo.xml.in:63 msgid "Fix events that are after UTC midnight" msgstr "Fixat händelser som är efter midnatt UTC" #: data/net.kirgroup.confy.metainfo.xml.in:68 msgid "French tranlsation, thanks to Irénée Thirion" msgstr "Fransk översättning, tack till Irénée Thirion" #: data/net.kirgroup.confy.metainfo.xml.in:69 msgid "Swedish translation, thanks to Luna Jernberg" msgstr "Svensk översättning, tack till Luna Jernberg" #: data/net.kirgroup.confy.metainfo.xml.in:70 msgid "Fix Pentabarf date parsing" msgstr "Fixa Pentabarf datumparsning" #: data/net.kirgroup.confy.metainfo.xml.in:71 msgid "Flatpak: bump Gnome Runtime to verion 44" msgstr "Flatpak: öka Gnome körtid till version 44" #: data/net.kirgroup.confy.metainfo.xml.in:76 msgid "Convert markdown links to html hyperlinks" msgstr "Konvertera markdown länkar till html hyperlänkar" #: data/net.kirgroup.confy.metainfo.xml.in:77 msgid "Don't track visited links in labels" msgstr "Spåra inte besökta länkar i etiketter" #: data/net.kirgroup.confy.metainfo.xml.in:78 msgid "Make labels selectable" msgstr "Gör etiketter valbara" #: data/net.kirgroup.confy.metainfo.xml.in:79 msgid "" "Margin in loading widget: no more loadbar touching screen edges in mobile" msgstr "" "Marginal i laddningswidget: inga fler laddningsfält som rör skärmkanterna på " "mobil" #: data/net.kirgroup.confy.metainfo.xml.in:80 msgid "Event text justified to left" msgstr "Evenemangstext justerad till vänster" #: data/net.kirgroup.confy.metainfo.xml.in:81 msgid "Use symbolic icon in search placeholder" msgstr "Använd symbolisk ikon i sökplatshållaren" #: data/net.kirgroup.confy.metainfo.xml.in:86 msgid "Update metainfo data with input support and display requirement." msgstr "Uppdatera metainfodata med inmatningsstöd och visningskrav." #: data/net.kirgroup.confy.metainfo.xml.in:91 msgid "Update appearance to better conform to Gnome" msgstr "Uppdatera utseendet för att bättre överensstämma med Gnome" #: data/net.kirgroup.confy.metainfo.xml.in:96 msgid "Fix event progressbar for events with zero duration" msgstr "Fixat evenemangsförloppsindikator för händelser med noll varaktighet" #: data/net.kirgroup.confy.metainfo.xml.in:97 msgid "Display events talks datetimes in current timezone" msgstr "Visa evenemang för aktuellt datum och tid i aktuell tidszon" #: data/net.kirgroup.confy.metainfo.xml.in:98 msgid "Declare support for mobile devices in metadata" msgstr "Deklarera stöd för mobila enheter i metadata" #: data/net.kirgroup.confy.metainfo.xml.in:103 msgid "Search talks in schedule and starred view" msgstr "Sök efter föreläsningar i schema och stjärnmärkt vy" #: data/net.kirgroup.confy.metainfo.xml.in:104 msgid "Better page navigation in starred view" msgstr "Bättre sidnavigering i stjärnmärkt vy" #: data/net.kirgroup.confy.metainfo.xml.in:105 msgid "Varius enhancement to UI to better fit GNOME guidelines" msgstr "Diverse förbättring av UI för att bättre passa GNOMEs riktlinjer" #: data/net.kirgroup.confy.metainfo.xml.in:110 msgid "Open urls with default application per file type, if possible." msgstr "Öppna webbadresser med standardprogram per filtyp, om möjligt." #: data/net.kirgroup.confy.metainfo.xml.in:115 msgid "Fix \"next up\" query and notification." msgstr "Fixat \"nästa upp\" fråga och avisering." #: data/net.kirgroup.confy.metainfo.xml.in:116 msgid "Fix text rendering issues with unsupported markup tags." msgstr "Fixade problem med textrendering med kodningstaggar som inte stöds." #: data/net.kirgroup.confy.metainfo.xml.in:121 msgid "Add event progress indicator." msgstr "Lägg till evenemangsförloppsindikator." #: data/net.kirgroup.confy.metainfo.xml.in:122 msgid "" "Fix overlapping events definition: exclude events ending/starting on same " "exact time." msgstr "" "Fixade definition av överlappande evenemang: uteslut evenemang som slutar/" "startar på exakt samma tidpunkt." #~ msgid "" #~ "App will auto-update cache (if possible) when it's older than setting." #~ msgstr "" #~ "Programmet kommer automatiskt att uppdatera cachen (om möjligt) när den " #~ "är äldre än inställningen." #~ msgid "Event info cache duration" #~ msgstr "Evenemangsinformation cache varaktighet" #, fuzzy #~ msgid "Open Conference" #~ msgstr "Redigera konferans" #~ msgid "Show window menu" #~ msgstr "Visa fönstermeny" #~ msgid "Go back" #~ msgstr "Gå tillbaka" #~ msgid "Schedule" #~ msgstr "Schema" #~ msgid "Map" #~ msgstr "Karta" #~ msgid "" #~ "Updated event:\n" #~ "{}" #~ msgstr "" #~ "Uppdaterat evenemang:\n" #~ "{}" #~ msgid "Event schedule updated" #~ msgstr "Evenemangsprogram uppdaterat" #~ msgid "cache updated" #~ msgstr "cachen uppdaterad" #~ msgid "Room: {}" #~ msgstr "Rum: {}" #~ msgid "Track: {}" #~ msgstr "Spår {}" #~ msgid "Links" #~ msgstr "Länkar" #~ msgid "You don't have any starred talk yet." #~ msgstr "Du har inga stjärnmärkta föreläsningar än." #~ msgid "" #~ "Click on the star button to add a talk to this list and to be reminded " #~ "when they are about to start." #~ msgstr "" #~ "Klicka på stjärnknappen för att lägga till en föreläsning till den här " #~ "listan och för att bli påmind när de ska börja." #~ msgid "{}" #~ msgstr "{}" #~ msgid "Loading…" #~ msgstr "Laddar…" #~ msgid "Schedule URL" #~ msgstr "Schema URL" #~ msgid "%b %a %d %Y" #~ msgstr "%b %a %d %Y" #~ msgid "No cache" #~ msgstr "Ingen cache" #~ msgid "One hour" #~ msgstr "En timme" #~ msgid "One day" #~ msgstr "En dag" #~ msgid "One week" #~ msgstr "En vecka" #~ msgid "Quit" #~ msgstr "Avsluta" #~ msgid "" #~ "Confy lets you organise your visit - select talks to be reminded of (with " #~ "warnings in case of conflicts)." #~ msgstr "" #~ "Confy låter dig organisera ditt besök - välj föreläsningar att påminnas " #~ "om (med varningar i händelse av krockar)." #~ msgid "Conference schedule viewer" #~ msgstr "Konferensschema visare" #~ msgid "Conferences schedule viewer" #~ msgstr "Konferenser schemavisare" confy-0.8.0/python3-icalendar.json000066400000000000000000000022461473600550000170600ustar00rootroot00000000000000{ "name": "python3-icalendar", "buildsystem": "simple", "build-commands": [ "pip3 install --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} \"icalendar\" --no-build-isolation" ], "sources": [ { "type": "file", "url": "https://files.pythonhosted.org/packages/a5/b5/276bf1e5d0433144b27f707c40afe79e7e8863806837f42956053840a078/icalendar-6.1.0-py3-none-any.whl", "sha256": "46c09b774a6e6948495dafcb166dc15135c8259d0ae25491f154cbc822714b69" }, { "type": "file", "url": "https://files.pythonhosted.org/packages/ec/57/56b9bcc3c9c6a792fcbaf139543cee77261f3651ca9da0c93f5c1221264b/python_dateutil-2.9.0.post0-py2.py3-none-any.whl", "sha256": "a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427" }, { "type": "file", "url": "https://files.pythonhosted.org/packages/a6/ab/7e5f53c3b9d14972843a647d8d7a853969a58aecc7559cb3267302c94774/tzdata-2024.2-py2.py3-none-any.whl", "sha256": "a48093786cdcde33cad18c2555e8532f34422074448fbc874186f0abd79565cd" } ] } confy-0.8.0/requirements.dev.txt000066400000000000000000000000461473600550000166760ustar00rootroot00000000000000PyGObject-stubs types-python-dateutil confy-0.8.0/src/000077500000000000000000000000001473600550000134245ustar00rootroot00000000000000confy-0.8.0/src/__init__.py000066400000000000000000000000001473600550000155230ustar00rootroot00000000000000confy-0.8.0/src/config.py.in000066400000000000000000000002041473600550000156440ustar00rootroot00000000000000from gettext import gettext as _ APP_VERSION="@VERSION@" APP_NAME="Confy" APP_ID="net.kirgroup.confy" FMT_DAY = _("%A %B %d, %Y") confy-0.8.0/src/confy.css000066400000000000000000000004101473600550000152470ustar00rootroot00000000000000/* default box margin inside a Clamp. That's the main box */ .main-box { margin: 24px 12px; } /* floating toolbar over map */ .map-toolbar { border-radius: 5px; margin: 0 16px 16px 0; } .editbar { background-color: @accent_bg_color; color: @accent_fg_color; } confy-0.8.0/src/confy.gresource.xml000066400000000000000000000021521473600550000172610ustar00rootroot00000000000000 confy.css shortcuts.ui openwindow.ui mainwindow.ui widgets/searchbaroverlay.ui widgets/eventeditdialog.ui widgets/loaderpage.ui widgets/starbutton.ui pages/info.ui pages/list.ui pages/events.ui pages/details.ui confy-0.8.0/src/confy.in000077500000000000000000000024511473600550000150770ustar00rootroot00000000000000#!@PYTHON@ # confy.in # # Copyright 2020-2022 Fabio Comuni, et al. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . import os import sys import signal import gettext VERSION = '@VERSION@' pkgdatadir = '@pkgdatadir@' pythondir = '@pythondir@' localedir = '@localedir@' sys.path.insert(1, pythondir) signal.signal(signal.SIGINT, signal.SIG_DFL) gettext.install('confy', localedir) if __name__ == '__main__': import gi from gi.repository import Gio resource = Gio.Resource.load(os.path.join(pkgdatadir, 'confy.gresource')) resource._register() resource = Gio.Resource.load(os.path.join(pkgdatadir, 'confy.data.gresource')) resource._register() from confy import main sys.exit(main.main(VERSION)) confy-0.8.0/src/fetcher.py000066400000000000000000000072161473600550000154240ustar00rootroot00000000000000# fetcher.py # # Copyright 2020-2022 Fabio Comuni, et al. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . from threading import Thread import os import tempfile import urllib.request from gi.repository import GLib from gi.repository import GObject class DownloadCancelled(Exception): pass class Fetcher(GObject.GObject): """ Fetch source to dest, asyncly. property running (bool, r) download is running fraction (floar, r) download progress 0.0 - 1.0 signals: error (message:str) done (local_file_path:str) """ @GObject.Signal(arg_types=(str,)) def error(self, message): ... @GObject.Signal(arg_types=(str,)) def done(self, local_file_path): ... @GObject.Property(type=bool, default=False) def running(self): return self._run @GObject.Property(type=float) def fraction(self): return self._fraction def __init__(self, source, dest=None, cbk=None): """ download `source` to `dest` `source`: uri `dest`: path. if None, then temp `cbk` : function called when done: `fn(local_file_path)` `cbk` is called before firing `done` signal. If any exception is raised by `cbk`, `error` signal is fired, instead. """ super().__init__() self._run = True self._fraction = 0.0 self._cbk = cbk if dest is None: _, dest = tempfile.mkstemp() Thread(target=self._fetch, args=(source, dest)).start() def _fetch(self, source, dest): try: with urllib.request.urlopen(source, timeout=20) as fsrc, open(dest, "wb") as fdst: total_size = int(fsrc.info().get('Content-Length', 0)) block_size = 8192 dwl_size = 0 # python in runtime is old :) # while chunk := fsrc.read(block_size): chunk = fsrc.read(block_size) while chunk: if not self._run: raise DownloadCancelled("Download cacelled") fdst.write(chunk) if total_size > 0: dwl_size += block_size self._fraction = min(dwl_size, total_size) / total_size GLib.idle_add(self.notify, "fraction") chunk = fsrc.read(block_size) except Exception as e: if os.path.exists(dest): os.unlink(dest) import traceback traceback.print_exc() GLib.idle_add(self.emit, "error", str(e)) else: GLib.idle_add(self._done, dest) def _done(self, dest): if self._cbk is not None: try: self._cbk(self, dest) except Exception as e: import traceback traceback.print_exc() GLib.idle_add(self.emit, "error", str(e)) return GLib.idle_add(self.emit, "done", dest) def cancel(self): self._run = False self.notify("running") confy-0.8.0/src/local.py000066400000000000000000000256131473600550000150770ustar00rootroot00000000000000# local.py # # Copyright 2020-2024 Fabio Comuni, et al. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . from typing import Optional import types import os import json import hashlib import sqlite3 import importlib.util import datetime import time from gettext import gettext as _ from gi.repository import GLib from .settings import Settings from .fetcher import Fetcher from . import remotes from . import models # # init and migration machinery class UnitializedError(Exception): pass class LocalDBDoesNotExistsException(Exception): pass class LocalDBNotOpen(Exception): pass dbfile: Optional[str] = None db: Optional[sqlite3.Connection] = None appdir: Optional[str] = None cachedir: Optional[str] = None def getDb(): return db def init(app_id: str): """Init paths and open db""" global appdir, cachedir appdir = os.path.join(GLib.get_user_data_dir(), app_id) if not os.path.exists(appdir): os.makedirs(appdir) cachedir = os.path.join(GLib.get_user_cache_dir(), app_id) if not os.path.exists(cachedir): os.makedirs(cachedir) Settings.init(app_id) def import_migration(filename: str) -> types.ModuleType: modulename = os.path.basename(filename).replace(".py", "") spec = importlib.util.spec_from_file_location(modulename, filename) if spec is None or spec.loader is None: raise ImportError(f"Unable to import migration {filename}") migration = importlib.util.module_from_spec(spec) spec.loader.exec_module(migration) return migration def migrate(): schema = -1 migrated = False try: c = db.execute("SELECT value FROM meta WHERE key='schema'") info = c.fetchone() if info is not None: schema = int(info['value']) except Exception as e: print("... ", e) migrationsdir = os.path.join(os.path.dirname(__file__), "migrations") files = sorted([f for f in os.listdir(migrationsdir) if f.endswith(".py")]) try: c = db.cursor() for f in files: newschema = int(f.split("_")[0]) if newschema > schema: # TODO: how to log using glib? print("Migrating to {}".format(f.replace(".py", ""))) import_migration(os.path.join(migrationsdir, f)).up(c) schema = newschema migrated = True except Exception as e: db.rollback() raise e from None db.execute("INSERT OR REPLACE INTO meta (key, value) VALUES ('schema', ?)", (schema,)) db.commit() return migrated # event database def openconf(conf: models.Conference, is_online=True): """Open event database for `conf` conf is a models.Conference After opening, tries to update meta """ def _update_meta(*args): from .models import Meta with Meta() as m: m.title = m.title if m.title else conf.title m.start = m.start if m.start else conf.start m.end = m.end if m.end else conf.end f = opendb(conf.url, is_online) if f is None: _update_meta() else: f.connect("done", _update_meta) return f def existsdb(url): """Check if exists database for `url`""" dbhashname = hashlib.md5(url.encode('utf8')).hexdigest() dbfilename = os.path.join(cachedir, dbhashname + ".db") return os.path.exists(dbfilename) def opendb(url, is_online=True): """Open event database for `url` if `is_online`, fetch original pentabarf and update cache return Fetcher instance if downloading, else None """ global dbfile, db dbhashname = hashlib.md5(url.encode('utf8')).hexdigest() dbfilename = os.path.join(cachedir, dbhashname + ".db") if not os.path.exists(dbfilename) and not is_online: db = None raise LocalDBDoesNotExistsException(_("Device disconnected and no cached data available.")) print("open db", dbfilename) db = sqlite3.connect(dbfilename, detect_types=sqlite3.PARSE_DECLTYPES | sqlite3.PARSE_COLNAMES) db.row_factory = sqlite3.Row migrated = migrate() dbfile = dbfilename from .models import Meta is_time_to_update = (time.time() - Meta().last_update) > Settings.instance().get_event_cache() if is_online and (migrated or is_time_to_update): return updatedb(url) return None def updatedb(from_url): """Update event cache from schedule url return Fetcher instance """ if db is None: raise LocalDBNotOpen() return remotes.update_schedule(from_url) def close(): """Close db""" global db, dbfile dbfile = None if db is not None: db.close() db = None # # schedules list (from giggity and user defined) def update_menu() -> Fetcher: """Fetch remote menu json""" # TODO: what about user entries shadowing entries from giggity? if cachedir is None: raise UnitializedError("cachedir is not defiend, local db not initialized") ggcachefile = os.path.join(cachedir, "ggmenu.json") url = "https://ggt.gaa.st/menu.json" return Fetcher(url, ggcachefile) def open_menu(is_online): """ Update menu cache file if expired or not exists. returns None or Fetcher """ ggcachefile = os.path.join(cachedir, "ggmenu.json") print("menu cache file:", ggcachefile) need_refresh = not os.path.exists(ggcachefile) need_refresh = need_refresh or ((time.time() - os.path.getmtime(ggcachefile)) > Settings.instance().get_list_cache()) if need_refresh and is_online: return update_menu() return None def get_menu(): """ Get menu entries from menu cache and from user menu entries. User entries with same urls as entries from gg cache file shadow the latter (happens when user edit an entry from gg) """ ggcachefile = os.path.join(cachedir, "ggmenu.json") userfile = os.path.join(cachedir, "usermenu.json") schedules = [] if os.path.exists(userfile): with open(userfile, "r") as f: schedules += json.load(f) userurls = [s['url'] for s in schedules] if os.path.exists(ggcachefile): with open(ggcachefile, "r") as f: menu = json.load(f) for s in menu['schedules']: if s['url'] not in userurls: schedules.append(s) def _sort_key(elm): start = elm['start'] return datetime.date(*[int(s) for s in start.split("-")]) schedules = sorted(schedules, key=_sort_key, reverse=True) return schedules def _add_user_menu_ready(sender, local_file_path, cbk): userfile = os.path.join(cachedir, "usermenu.json") from .models import Meta m = Meta() item = m.to_json() if m.title is None: m.title = "" m.save() schedules = [] if os.path.exists(userfile): with open(userfile, "r") as f: schedules = json.load(f) schedules.append(item) with open(userfile, "w") as f: json.dump(schedules, f) cbk(m) close() class MenuItemAlreadyExistsException(Exception): def __init__(self, message, obj): super().__init__(message) self.obj = obj def add_user_menu(url, cbk): """ Add and fetch schedule from url. Returns Fetcher or None. When ready calls "cbk({..metadata..})" """ # try to not add same event twice: objs = [e for e in get_menu() if e['url'] == url] if len(objs) > 0: raise MenuItemAlreadyExistsException(_("Event already in list"), objs[0]) f = opendb(url, True) # I suppose that we are online at this point.. if f is not None: f.connect("done", _add_user_menu_ready, cbk) else: _add_user_menu_ready(None, None, cbk) return f def update_user_menu(data): """ Update user menu entry data is a dict() """ data['user'] = True userfile = os.path.join(cachedir, "usermenu.json") if os.path.exists(userfile): with open(userfile, "r") as f: schedules = json.load(f) else: schedules = [] _id = None for i, s in enumerate(schedules): if s['url'] == data['url']: _id = i break if _id is None: schedules.append(data) else: schedules[_id] = data with open(userfile, "w") as f: json.dump(schedules, f) def delete_user_menu(data): """ Remove user menu entry `data` is a dict() """ userfile = os.path.join(cachedir, "usermenu.json") if not os.path.exists(userfile): # non dovrei arrivare qui. solo i meta con user=True # posso essere editati, e quindi deve esistere il file raise Exception("User menu file not found. This should not happen.") with open(userfile, "r") as f: schedules = json.load(f) _id = None for i, s in enumerate(schedules): if s['url'] == data['url']: _id = i break if _id is not None: del schedules[_id] with open(userfile, "w") as f: json.dump(schedules, f) # async image fetcher def get_image_async(fileurl, cbk): """ Save a remote image in local cache. Returns Fetcher or None When ready calls "cbk(None, 'localfilename')" """ if fileurl is None: return None localfilename = hashlib.md5(fileurl.encode('utf8')).hexdigest() localdir = os.path.join(cachedir, "images") if not os.path.exists(localdir): os.makedirs(localdir) localfile = os.path.join(localdir, localfilename) if not os.path.exists(localfile): try: return Fetcher(fileurl, localfile, cbk) except Exception: return None cbk(None, localfile) return None # cache handling def get_cache_size(): """get total size of cache files: db and images. skip json menu files""" total_size = 0 for dirpath, dirnames, filenames in os.walk(cachedir): for f in filenames: if not f.endswith(".json"): fp = os.path.join(dirpath, f) # skip if it is symbolic link if not os.path.islink(fp): total_size += os.path.getsize(fp) return total_size def clear_cache(): """remove all files in cachedir except currently opened database and json menu files""" for dirpath, dirnames, filenames in os.walk(cachedir): for f in filenames: if not f.endswith(".json"): fp = os.path.join(dirpath, f) if fp != dbfile: os.remove(fp) confy-0.8.0/src/main.py000066400000000000000000000120711473600550000147230ustar00rootroot00000000000000# main.py # # Copyright 2020-2024 Fabio Comuni, et al. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . import sys from gettext import gettext as _ import gi gi.require_version('Gtk', '4.0') gi.require_version('Adw', '1') gi.require_version("Notify", "0.7") from gi.repository import Gtk, Gdk, Gio, GLib, GObject from gi.repository import Adw from gi.repository import Notify from . import local from .config import APP_NAME, APP_ID, APP_VERSION # type:ignore # config is generated at compile time from .preferences import PreferencesWindow from .openwindow import OpenWindow from .mainwindow import MainWindow class Application(Gtk.Application): @GObject.Signal def tick(self): """Event fired every minute Used to check for notifications to send and to update events row background """ pass def __init__(self): super().__init__(application_id=APP_ID, flags=Gio.ApplicationFlags.FLAGS_NONE) GLib.set_application_name(APP_NAME) GLib.set_prgname(APP_ID) display = Gdk.Display.get_default() # resource icons in icon theme path icon_theme = Gtk.IconTheme.get_for_display(display) icon_theme.add_resource_path("/net/kirgroup/confy/icons") # custom css css_provider = Gtk.CssProvider() css_provider.load_from_resource("/net/kirgroup/confy/confy.css") Gtk.StyleContext.add_provider_for_display( display, css_provider, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION) def run(self, argv): self.connect("startup", self.on_startup) self.connect("activate", self.on_activate) self.connect("shutdown", self.on_shutdown) return super().run(argv) def on_startup(self, *_): Adw.init() Notify.init(APP_NAME) local.init(APP_ID) self._add_action('quit', None, ["q",], lambda *args: self.quit()) self._add_action('shortcuts', None, ["question"], self.show_shortcuts) self._add_action('preferences', None, ["comma",], self.show_preferences) self._add_action('about', None, None, self.show_about) GLib.timeout_add_seconds(30, self._do_tick) def _add_action(self, name, parameter_type, accels, activate_cbk): action = Gio.SimpleAction.new(name, parameter_type) action.connect("activate", activate_cbk) self.add_action(action) if accels is not None: self.set_accels_for_action(F"app.{name}", accels) return action def _do_tick(self): self.emit("tick") return True def open_conf(self, conf): win = self.props.active_window if isinstance(win, OpenWindow): win.close() win = self.props.active_window win.load_conf(conf) win.present() # def start_window(self): # a_win = self.props.active_window # win = OpenWindow(application=self) # if isinstance(a_win, MainWindow): # win.connect("show", lambda *_: a_win.destroy()) # win.present() def on_activate(self, *_): win = self.props.active_window if not win: win = MainWindow(application=self) win.present() def on_shutdown(self, *_): local.close() def show_shortcuts(self, *_): b = Gtk.Builder.new_from_resource("/net/kirgroup/confy/shortcuts.ui") w = b.get_object("shortcuts-win") w.set_transient_for(self.props.active_window) w.props.view_name = None w.show() def show_preferences(self, *args): pref = PreferencesWindow(transient_for=self.props.active_window) pref.show() def show_about(self, *args): Adw.AboutWindow( application_name=APP_NAME, application_icon=APP_ID, version=APP_VERSION, copyright="© 2020-2023 Fabio Comuni, et al.", website="https://confy.kirgroup.net/", issue_url="https://todo.sr.ht/~fabrixxm/confy", developers=["Fabio Comuni", "Evangelos Ribeiro Tzaras", "Sebastian Crane"], # Translators: about dialog text; this string should be replaced by a text crediting yourselves and your translation team, or should be left empty. Do not translate literally! translator_credits=_("translator-credits"), comments=_("Conference schedules viewer"), license_type=Gtk.License.GPL_3_0 ).show() def main(version): app = Application() return app.run(sys.argv) confy-0.8.0/src/mainwindow.blp000066400000000000000000000067501473600550000163070ustar00rootroot00000000000000using Gtk 4.0; using Adw 1; template $ConfyMainWindow : Adw.ApplicationWindow { title: "Confy"; close-request => $_on_close_requested(); Adw.Breakpoint { condition ("max-width: 500sp") setters { main_split_view.collapsed: true; } } Gtk.Stack loader_stack { Gtk.StackPage { // Start page name: 'start'; child: Adw.ToolbarView { [top] Adw.HeaderBar { show-title: false; [end] MenuButton { menu-model: menu_app; icon-name: "open-menu-symbolic"; primary: true; } } content: Adw.StatusPage { icon-name: "net.kirgroup.confy"; title: "Confy"; description: _("Open an Event to start"); vexpand: true; hexpand: true; Adw.Clamp { Gtk.Box { orientation: vertical; spacing: 8; Gtk.ListView { styles ['card'] single-click-activate: true; activate => $_on_recent_activated(); visible: bind template.has-recent; model: recent_model; factory: Gtk.BuilderListItemFactory { template Gtk.ListItem { child: Adw.ActionRow { title: bind template.item as <$ConfyRecentConf>.title; }; } }; } Gtk.Button { halign: center; hexpand: true; styles ["suggested-action", "pill"] label: _("Open Event"); action-name: 'win.open-conference'; } } } }; }; } // /page 'start' Gtk.StackPage { // Loader page name: "loader"; child: $ConfyLoaderPage loader {}; } // /page 'loader' Gtk.StackPage { // Main page name: "main"; child: Adw.ToastOverlay overlay { Adw.OverlaySplitView main_split_view { sidebar: Adw.NavigationPage { tag: "sidebar"; child: Adw.ToolbarView { [top] Adw.HeaderBar { show-title: false; [start] Gtk.Button { icon-name: "system-search-symbolic"; action-name: "win.search"; } [end] MenuButton button_menu { menu-model: menu_app; icon-name: "open-menu-symbolic"; primary: true; } } // /headerbar content: $ConfyNavbar navbar { page-changed => $_on_page_changed(); }; }; // /sidebar.child: toolbarview; }; // /sidebar: content: Adw.NavigationPage { tag: "content"; child: Adw.NavigationView main_stack { }; // TODO }; // /content: } // /main_split_view }; // overlay } // page 'main' } // /loader-stack } Gtk.NoSelection recent_model {} menu menu_app { section { submenu recent_menu { label: _("Recent Events"); } item { label: _("Open Event"); action: "win.open-conference"; } item { label: _("Preferences"); action: "app.preferences"; } item { label: _("Keyboard Shortcuts"); action: "app.shortcuts"; } item { label: _("About Confy"); action: "app.about"; } } } confy-0.8.0/src/mainwindow.py000066400000000000000000000344261473600550000161630ustar00rootroot00000000000000# mainwindow.py # # Copyright 2020-2024 Fabio Comuni, et al. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . from typing import Optional import json from time import time from gettext import gettext as _ from gi.repository import GLib from gi.repository import Gio from gi.repository import GObject from gi.repository import Gtk from gi.repository import Adw from gi.repository import Notify from . import local from . import models from .settings import Settings from .openwindow import OpenWindow from .config import APP_NAME, APP_ID # type:ignore # config is generated at compile time from .networkconnectionmonitor import NetworkConnectionMonitor from .widgets import LoaderPage from .widgets import Navbar from .widgets.navbar import NavbarItem from .pages import PageInfo from .pages import PageList from .pages import PageEvents from .utils import clean_markup PAGES = dict( info=NavbarItem(name="info", label=_("Event info"), icon="emblem-system-symbolic"), days=NavbarItem(name="days", label=_("Days"), icon="x-office-calendar-symbolic"), tracks=NavbarItem(name="tracks", label=_("Tracks"), icon="format-justify-fill-symbolic"), rooms=NavbarItem(name="rooms", label=_("Rooms"), icon="display-projector-symbolic"), starred=NavbarItem(name="starred", label=_("Starred"), icon="starred-symbolic", group=1) ) @Gtk.Template(resource_path="/net/kirgroup/confy/mainwindow.ui") class MainWindow(Adw.ApplicationWindow): __gtype_name__ = "ConfyMainWindow" @GObject.Signal def conf_updated(self): pass @GObject.Property(type=bool, default=False) def has_recent(self): return self.recent_model.get_n_items() > 0 overlay: Adw.ToastOverlay = Gtk.Template.Child() # type: ignore # stack to switch between 'start', 'loader' and 'main' views loader_stack: Gtk.Stack = Gtk.Template.Child() # type: ignore # the loader widget inside 'loader' view loader: LoaderPage = Gtk.Template.Child() # type: ignore # main split view main_split_view: Adw.OverlaySplitView = Gtk.Template.Child() # type: ignore # sidebar navbar navbar: Navbar = Gtk.Template.Child() # type: ignore # main navigation view main_stack: Adw.NavigationView = Gtk.Template.Child() # type: ignore # recent confs model and menu, in 'start' page recent_model: Gtk.NoSelection = Gtk.Template.Child() # type: ignore recent_menu: Gio.MenuItem = Gtk.Template.Child() # type: ignore # Monitor network connectivity nm = NetworkConnectionMonitor() # current opened conference conf: Optional[models.Conference] = None # dict of sent notifications. # Keeps Notification ojects around to be able to get activation events notifications: dict[str, Notify.Notification] = {} def __init__(self, application: Gtk.Application, **kwargs): super().__init__(application=application, **kwargs) size = Settings.instance().get_size() self.set_default_size(*size) # Check if there are notifications to send application.connect('tick', self.check_event_notification) # handle conf data updating, eg. reloading from remote self.connect('conf-updated', self._on_conf_updated) self._add_action("open-conference", None, ["o",], self.open_conference) self._add_action("search", None, ["f",], lambda *_: self.show_search_all()) self._add_action("copy", None, ["c",], lambda *_: self.copy_details_to_clipboard()) # open recent action, used by recent menu self._add_action("open-recent", "i", None, self._on_recent_action) # TODO: serve? self.nm.connect("notify", self._on_networkconnectionmonitor_notify) model = Gio.ListStore.new(models.RecentConf) self.recent_model.set_model(model) self.recentmanager = Gtk.RecentManager.get_default() self.recentmanager.connect("changed", self._on_recent_changed) self._on_recent_changed() def _add_action(self, name, parameter_type, accels, activate_cbk): """Simplify adding an action to the window""" if parameter_type is not None: parameter_type = GLib.VariantType.new(parameter_type) action = Gio.SimpleAction.new(name, parameter_type) action.connect("activate", activate_cbk) self.add_action(action) if accels is not None: self.get_application().set_accels_for_action(F"win.{name}", accels) return action def _on_networkconnectionmonitor_notify(self, *_): # TODO: what should be here? ... def _on_recent_changed(self, *args): # empty recent confs model and menu... model = self.recent_model.get_model() menu = self.recent_menu menu.remove_all() while model.get_n_items() > 0: model.remove(0) # ... then rebuild model and menu n = 0 for item in self.recentmanager.get_items(): if item.has_application(APP_NAME): print(f"#{n} {item.get_uri()} {item.get_applications()}") recentconf = models.RecentConf(item) model.append(recentconf) # add menu item, trigger 'open-recent' action menu.append(recentconf.props.title, f"win.open-recent({n})") n = n + 1 self.notify("has-recent") @Gtk.Template.Callback() def _on_recent_activated(self, listview, index): """Called by recent listview 'activated' signal""" recentconf = self.recent_model.get_item(index) conf = json.loads(recentconf.data) conf = models.Conference()._init(conf) # don't load conf if it is already loaded if self.conf is not None and self.conf.url == conf.url: print(f"Same url {self.conf.url} == {conf.url}. Skip") return self.load_conf(conf) def _on_recent_action(self, action, args): """ Called by open-recent action activation first arg from action is int32 index in recent model """ index = args.get_int32() self._on_recent_activated(None, index) def _add_recent(self, conf: models.Conference): """ Add conference to recent. """ # remove current conf if is already in recents # this way will be readded on top # TODO: is there a better way to do this? if self.recentmanager.has_item(conf.url): self.recentmanager.remove_item(conf.url) recentdata = Gtk.RecentData() recentdata.mime_type = "x-application/confy-event-uri" recentdata.app_exec = "confy" recentdata.is_private = True recentdata.app_name = APP_NAME recentdata.display_name = conf.title # misuse recentdata description to hold conf object, yay! recentdata.description = json.dumps(conf.to_json()) self.recentmanager.add_full(conf.url, recentdata) def _send_desktop_notification(self, title: str, body: str, nid: str): """ Send a notification and register it to react to user action """ n = Notify.Notification.new(title, body, APP_ID) n.set_timeout(Notify.EXPIRES_NEVER) n.add_action("view", "View", self._on_notification_action, nid) n.show() self.notifications[nid] = n def _on_conf_updated(self, *args): """ Callback when conference data is modified (eg. is reloaded) """ self.navbar.set_item_cond(PAGES['info'], True) self.navbar.set_item_cond(PAGES['days'], models.Day.count() > 0) self.navbar.set_item_cond(PAGES['tracks'], models.Track.count() > 0) self.navbar.set_item_cond(PAGES['rooms'], models.Room.count() > 0) self.navbar.set_item_cond(PAGES['starred'], True) def _on_fetcher_done(self, *_): """ Callback when conference has been open from remote url """ self._add_recent(self.conf) self.emit("conf_updated") self.show_main() def _on_fetcher_error(self, fetcher, error): """ Callback when there was an error fetching conference from remote url """ self.show_error(error) def _on_notification_action(self, notification, action, data): """ User clicked on "View" in notification """ print(notification, action, data) if action == "view" and data.startswith("nextup-"): self.present_with_time(time()) eventid = int(data.split("-")[1]) event = models.Event.by_id(eventid) # if we are not on "events" subpage, force it as non navigatable, # we want to be back to where we were print(self.subpage_leaflet.get_visible_child(), self.subpage_events) can_we_go_back_to_events = self.subpage_leaflet.get_visible_child() == self.subpage_events self.show_details(event, can_we_go_back_to_events) @Gtk.Template.Callback() def _on_page_changed(self, navbar): self.navigate_to(navbar.get_current_item().name) @Gtk.Template.Callback() def _on_close_requested(self, *args): print("close-request", args) def open_conference(self, *_): """ Show open window to open a conference """ app = self.get_application() win = OpenWindow(modal=True, transient_for=self, application=app) win.show() def load_conf(self, conf: models.Conference): """ Load conference Setup/reset window to display `conf` """ self.conf = conf # we reset navigation because 'conf-updated' is emited, but # we don't really have a clear way to get the updated conf in pages # as we cannot attach a conf to the signal, as is not a GObject. # So existing pages will update values but with old conf object. # Reset navigation will force to create a new PageInfo with the new # conf object self.navigate_to(None) # reset navigation self.show_loader() try: fetcher = local.openconf(conf, is_online=self.nm.get_isconnected()) except Exception as e: self.show_error(e) return else: if fetcher is not None: # 'local.openconf' returns a `Fetcher` if there is no local cache # or the local cache is expired, and data must be downloaded # we listen to fetcher events fetcher.connect("done", self._on_fetcher_done) fetcher.connect("error", self._on_fetcher_error) # pass the fetcher to the loader to show progress self.loader.set_fetcher(fetcher) else: # there was a valid local cache, signal change in conf, # and show main page self._add_recent(self.conf) self.emit("conf-updated") self.show_main() self.notifications = {} self.check_event_notification() def check_event_notification(self, *args): """ Notifiy starred talk staring in next 5 minutes """ if self.conf is None: # no conf loaded, nothing to do return nextup = list(models.Event.nextup(5)) for e in nextup: title = clean_markup(e.title) self._send_desktop_notification( _("Next up: {}").format(title), _("at {} in {}").format( e.start_in_tz().strftime("%H:%M"), e.room ), f"nextup-{e.id}") e.set_notified(True) def show_error(self, error=None): msg = Adw.MessageDialog( transient_for=self, modal=True, heading=_("Error loading event"), body=str(error) if error else "", ) msg.add_response("ok", _("Ok")) msg.connect("response", self.open_conference) msg.present() def show_start(self): """Show 'start' page""" self.loader_stack.set_visible_child_name("start") def show_loader(self): """Show 'loader' page""" self.loader_stack.set_visible_child_name("loader") def show_main(self): """Show 'main' page""" self.navigate_to("info") self.loader_stack.set_visible_child_name("main") def navigate_to(self, name: Optional[str]): print("Navigate to", name) if name is None: self.main_stack.replace([Adw.NavigationPage()]) return # we already into this navigation path? top = self.main_stack.find_page(name) if top is not None: self.main_stack.replace_with_tags([name]) if self.main_split_view.get_collapsed(): self.main_split_view.set_show_sidebar(False) return # no, start anew child: Adw.NavigationPage match name: case "info": info = PAGES[name] child = PageInfo(self, self.conf, title=info.label, tag=name) case "starred" | "search": child = PageEvents(None, model=name, tag=name) case _: info = PAGES[name] child = PageList(self, self.conf, model=name, title=info.label, tag=name) self.main_stack.replace([child]) if self.main_split_view.get_collapsed(): self.main_split_view.set_show_sidebar(False) def copy_details_to_clipboard(self): page = self.main_stack.get_visible_page() if page and page.get_tag() == "details": page.copy_to_clipboard() self.notification_show(_("Event details copied to the clipboard")) def notification_show(self, text): t = Adw.Toast() t.set_title(text) self.overlay.add_toast(t) def show_search_all(self): self.navigate_to("search") confy-0.8.0/src/meson.build000066400000000000000000000034151473600550000155710ustar00rootroot00000000000000pkgdatadir = join_paths(get_option('prefix'), get_option('datadir'), meson.project_name()) gnome = import('gnome') python = import('python') python3 = python.find_installation('python3') pythondir = python3.get_install_dir() moduledir = join_paths(pythondir, 'confy') subdir('widgets') subdir('pages') subdir('migrations') subdir('remotes') ## blueprint blueprints_src = [ 'openwindow.blp', 'mainwindow.blp', 'shortcuts.blp', ] blueprints_ui = [] foreach b : blueprints_src blueprints_ui += b.replace('.blp', '.ui') endforeach blueprints = custom_target('blueprints', input: blueprints_src, output: blueprints_ui, command: [blueprint_compiler, 'batch-compile', '@OUTDIR@', '@CURRENT_SOURCE_DIR@', '@INPUT@'], ) ## /blueprint gnome.compile_resources('confy', 'confy.gresource.xml', dependencies: [blueprints, widgets_blueprints, pages_blueprints], gresource_bundle: true, install: true, install_dir: pkgdatadir, source_dir: 'src/', ) conf = configuration_data() conf.set('PYTHON', python3.full_path()) conf.set('VERSION', meson.project_version()) conf.set('localedir', join_paths(get_option('prefix'), get_option('localedir'))) conf.set('pkgdatadir', pkgdatadir) conf.set('pythondir', pythondir) configure_file( input: 'confy.in', output: 'confy', configuration: conf, install: true, install_mode: 'rwxr-xr-x', install_dir: get_option('bindir') ) configure_file( input: 'config.py.in', output: 'config.py', configuration: conf, install: true, install_dir: moduledir ) confy_sources = [ '__init__.py', 'main.py', 'openwindow.py', 'mainwindow.py', 'models.py', 'local.py', 'settings.py', 'fetcher.py', 'preferences.py', 'utils.py', 'networkconnectionmonitor.py', ] install_data(confy_sources, install_dir: moduledir) confy-0.8.0/src/migrations/000077500000000000000000000000001473600550000156005ustar00rootroot00000000000000confy-0.8.0/src/migrations/000_initial.py000066400000000000000000000030031473600550000201560ustar00rootroot00000000000000def up(cursor): cursor.execute("""CREATE TABLE IF NOT EXISTS meta ( key TEXT(20) PRIMARY KEY, value TEXT)""") cursor.execute("""CREATE TABLE IF NOT EXISTS persons ( id TEXT(50) PRIMARY KEY, name TEXT)""") cursor.execute("""CREATE TABLE IF NOT EXISTS event_person ( event_id TEXT(50), person_id TEXT(50), FOREIGN KEY(event_id) REFERENCES events(id), FOREIGN KEY(person_id) REFERENCES persons(id))""") cursor.execute("""CREATE TABLE IF NOT EXISTS events ( id TEXT(50) PRIMARY KEY, date DATE, start TIMESTAMP, end TIMESTAMP, room TEXT DEFAULT "", slug TEXT, title TEXT, subtitle TEXT, track TEXT DEFAULT "", type TEXT, abstract TEXT, description TEXT, starred INTEGER(1) DEFAULT 0, notified INTEGER(1) DEFAULT 0)""") cursor.execute("CREATE INDEX IF NOT EXISTS event_date ON events(date)") cursor.execute("CREATE INDEX IF NOT EXISTS event_room ON events(room)") cursor.execute("CREATE INDEX IF NOT EXISTS event_track ON events(track)") cursor.execute("CREATE INDEX IF NOT EXISTS event_starred ON events(starred)") cursor.execute("""CREATE TABLE IF NOT EXISTS links ( event_id TEXT(50), href TEXT, name TEXT, FOREIGN KEY(event_id) REFERENCES events(id))""") cursor.execute("CREATE UNIQUE INDEX IF NOT EXISTS name_event ON links(event_id, name)") def drop(cursor): # Do I need this? ... confy-0.8.0/src/migrations/001_event_person_unique.py000066400000000000000000000005421473600550000226300ustar00rootroot00000000000000def up(cursor): cursor.execute("DROP TABLE IF EXISTS event_person") cursor.execute("""CREATE TABLE event_person ( event_id TEXT(50), person_id TEXT(50), FOREIGN KEY(event_id) REFERENCES events(id), FOREIGN KEY(person_id) REFERENCES persons(id), UNIQUE(event_id, person_id))""") def down(cursor): ... confy-0.8.0/src/migrations/002_full_text_search.py000066400000000000000000000002111473600550000220600ustar00rootroot00000000000000def up(cursor): cursor.execute("""CREATE VIRTUAL TABLE fts_event USING FTS5 (event_id, text)""") def down(cursor): ... confy-0.8.0/src/migrations/003_person_details.py000066400000000000000000000005431473600550000215510ustar00rootroot00000000000000def up(cursor): cursor.execute("ALTER TABLE persons ADD COLUMN organization TEXT DEFAULT '';") cursor.execute("ALTER TABLE persons ADD COLUMN thumbnail TEXT DEFAULT '';") cursor.execute("ALTER TABLE persons ADD COLUMN bio TEXT DEFAULT '';") cursor.execute("ALTER TABLE persons ADD COLUMN url TEXT DEFAULT '';") def down(cursor): ... confy-0.8.0/src/migrations/meson.build000066400000000000000000000003321473600550000177400ustar00rootroot00000000000000confy_migrations_sources = [ '000_initial.py', '001_event_person_unique.py', '002_full_text_search.py', '003_person_details.py', ] install_data(confy_migrations_sources, install_dir: moduledir / 'migrations') confy-0.8.0/src/models.py000066400000000000000000000406261473600550000152710ustar00rootroot00000000000000# models.py # # Copyright 2020-2025 Fabio Comuni, et al. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . from typing import Optional, Any import datetime from gi.repository import GObject, Gtk from dateutil.tz import UTC from . import local from .settings import Settings class ObjectNotFound(Exception): pass # models def _build_filter( table: str = "", *, day: Optional["Day"] = None, room: Optional["Room"] = None, track: Optional["Track"] = None, event: Optional["Event"] = None, **kwargs): filterdata = [] wherestm = [] if table != "": table = f"{table}." def __f(col, value): if value is None: wherestm.append(f"{table}{col} is null") else: wherestm.append(f"{table}{col} = ?") filterdata.append(value) if day is not None: __f("date", day.date) if room is not None: __f("room", room.name) if track is not None: __f("track", track.name) if event is not None: __f("id", event.id) for k, v in kwargs.items(): __f(k, v) return (filterdata, wherestm) class Conference: """A conference in menu files (ggmenu.json and usermenu.json)""" # was added by user (true) or come from giggity (false)? user: bool = False id: str = "" version: str = "" url: str = "" title: str = "" timezone: str = "UTC" # TODO: should default to current tz? start: datetime.date = datetime.date.today() end: datetime.date = datetime.date.today() metadata: dict[str, Any] = {} def _init(self, obj): self.metadata = {} self.user = False for k, v in obj.items(): setattr(self, k, v) self.start = datetime.date(*[int(s) for s in self.start.split("-")]) self.end = datetime.date(*[int(s) for s in self.end.split("-")]) return self def get_map_links(self): maps = [link for link in self.metadata.get('links', []) if link['title'] == "Map"] return maps def get_map_files(self, cbk): r = [] for link in self.get_map_links(): r.append(local.get_image_async(link['url'], cbk)) return r def get_logo_file(self, cbk): logourl = self.metadata.get('icon', None) return local.get_image_async(logourl, cbk) def __repr__(self): return f"<{self.__class__.__name__} {self.__dict__}>" @classmethod def all(cls): # from giggity menu return [cls()._init(s) for s in local.get_menu()] @classmethod def by_url(cls, url): ss = [s for s in local.get_menu() if url in s['url']] if len(ss) == 0: return None return cls()._init(ss[0]) def has_cache(self): """Check if there is local db for this conference""" return local.existsdb(self.url) def get_meta(self): """Return metadata from db. This will close any opened db connection.""" local.close() local.opendb(self.url, False) return Meta() def to_json(self): """Export conference meta as json for user menu""" d = self.__dict__.copy() for k in d: if isinstance(d[k], (datetime.date, datetime.datetime)): d[k] = d[k].strftime("%Y-%m-%d") return d class Meta: """Conference metadata from "meta" table in db""" def __init__(self): _c = local.getDb().execute("SELECT key, value FROM meta") _d = [(row['key'], self._fmtd_value(row['key'], row['value'])) for row in _c] self._data = {'last_update': 0} self._data.update(dict(_d)) def _fmtd_value(self, k, v): if k == "start" or k == "end": if v is not None and v != "": # drop any time info and keep only date v = v.split(" ")[0] v = v.split("T")[0] v = datetime.date(*[int(s) for s in v.split("-")]) else: v = None if k == "last_update": v = float(v) return v def __getattr__(self, name): if name.startswith("_"): return super().__getattr__(name) return self._data.get(name) def __setattr__(self, name, value): if name.startswith("_"): return super().__setattr__(name, value) self._data[name] = value def __enter__(self): return self def __exit__(self, *args): self.save() def __contains__(self, name): return name in self._data def __repr__(self): return f"<{self.__class__.__name__} {self.__dict__}>" def get(self, name, default=None): #print("Meta.get", name, "->", self._data.get(name, default)) return self._data.get(name, default) def set(self, name, value): #print("Meta.set", name, value) self._data[name] = value def save(self): db = local.getDb() if db is None: local.opendb(self.url, False) db = local.getDb() print(self._data.items()) db.executemany("INSERT OR REPLACE INTO meta (key, value) VALUES (?,?)", self._data.items()) db.commit() def to_json(self): """Export conference meta as json for user menu""" return { "url": self.url, "title": self.title if self.title else "", "start": self.start.strftime("%Y-%m-%d"), "end": self.end.strftime("%Y-%m-%d"), "user": True } class Day: def _init(self, data): self.date = data['date'] return self def __repr__(self): return "<{} {!r}>".format(self.__class__.__name__, self.date) def __str__(self): return self.date.strftime("%x") @classmethod def all(cls): for row in local.getDb().execute("SELECT date FROM events GROUP BY date"): yield cls()._init(row) @classmethod def count(cls): for row in local.getDb().execute("SELECT count(DISTINCT date) FROM events"): return row[0] @classmethod def filter(cls, room=None, track=None, event=None): filterdata, wherestm = _build_filter(room=room, track=track, event=event) query = """SELECT date FROM events WHERE {} GROUP BY date""".format(" AND ".join(wherestm)) for row in local.getDb().execute(query, filterdata): yield cls()._init(row) class Room: def _init(self, data): self.name = data['room'] return self def __repr__(self): return "<{} {!r}>".format(self.__class__.__name__, self.name) def __str__(self): return self.name or "- no room -" @classmethod def all(cls): for row in local.getDb().execute("SELECT room FROM events GROUP BY room"): yield cls()._init(row) @classmethod def count(cls): for row in local.getDb().execute("SELECT count(DISTINCT room) FROM events"): return row[0] @classmethod def filter(cls, day=None, track=None, event=None): filterdata, wherestm = _build_filter(day=day, track=track, event=event) query = """SELECT room FROM events WHERE {} GROUP BY room""".format(" AND ".join(wherestm)) for row in local.getDb().execute(query, filterdata): yield cls()._init(row) class Track: def _init(self, data): self.name = data['track'] self.room = list(Room.filter(track=self)) self.date = list(Day.filter(track=self)) return self def __repr__(self): return "<{} {!r} in {!r} @ {}>".format( self.__class__.__name__, self.name, self.room, self.date) def __str__(self): return self.name or "- no track -" @classmethod def all(cls): for row in local.getDb().execute( "SELECT track, room, date FROM events WHERE track != '' GROUP BY track ORDER BY date, track"): yield cls()._init(row) @classmethod def count(cls): for row in local.getDb().execute("SELECT count(DISTINCT track) FROM events"): return row[0] class Person: def _init(self, data): self.id = data['id'] self.name = data['name'] self.organization = data['organization'] self.thumbnail = data['thumbnail'] self.bio = data['bio'] self.url = data['url'] return self def events(self): for row in local.getDb().execute( """SELECT e.* FROM events as e LEFT JOIN event_person AS ep ON e.id = ep.event_id WHERE ep.person_id = ?""", (self.id,)): yield Event()._init(row) def __repr__(self): return "<{} {!r}>".format(self.__class__.__name__, self.name) def __str__(self): return self.name @classmethod def all(cls): for row in local.getDb().execute( "SELECT * FROM persons"): yield cls()._init(row) @classmethod def by_event(cls, event_id): for row in local.getDb().execute( """SELECT * FROM persons as p LEFT JOIN event_person AS ep ON p.id = ep.person_id WHERE ep.event_id = ?""", (event_id,)): yield cls()._init(row) class Link: def _init(self, event, data): self.event = event self.href = data['href'] self.name = data['name'] return self def __repr__(self): return "<{} for {!r} {!r} {!r}>".format( self.__class__.__name__, self.event, self.name, self.href) def __str__(self): return '{}'.format(self.href, self.name) class DbUpdateWatcherObj(GObject.GObject): @GObject.Signal def update(self): ... dbUpdateWatcher = DbUpdateWatcherObj() class Event(GObject.GObject): @GObject.Signal def update(self): ... def _init(self, data): self.id = data['id'] self.date = data['date'] self.start = data['start'] self.end = data['end'] self.room = data['room'] self.slug = data['slug'] self.title = data['title'] self.subtitle = data['subtitle'] or "" self.track = data['track'] self.evtype = data['type'] self.abstract = data['abstract'] or "" self.description = data['description'] or "" self.starred = data['starred'] == 1 self.notified = data['notified'] == 1 return self def set_star(self, starred): local.getDb().execute("UPDATE events SET starred=? WHERE id=?", (starred, self.id,)) local.getDb().commit() self.starred = starred self.emit('update') dbUpdateWatcher.emit('update') def set_notified(self, notified): local.getDb().execute("UPDATE events SET notified=? WHERE id=?", (notified, self.id,)) local.getDb().commit() self.notified = notified self.emit('update') dbUpdateWatcher.emit('update') def start_in_tz(self): return self._dt_in_tz(self.start) def end_in_tz(self): return self._dt_in_tz(self.end) def _dt_in_tz(self, dt): dt = dt.replace(tzinfo=UTC) dt = dt.astimezone(Settings.instance().get_timezone()) return dt def persons(self): # print("event", self.id, "persons()") return Person.by_event(self.id) def links(self): for row in local.getDb().execute( """SELECT href, name FROM links WHERE event_id=?""", (self.id,)): yield Link()._init(self, row) def __repr__(self): return "<{} {!r} in {!r} @ {!r}>".format(self.__class__.__name__, self.title, self.room, self.start) def __str__(self): return self.title def get_conflicts(self): query = """SELECT * FROM events WHERE starred = 1 AND id != ? AND date = ? AND end > ? AND start < ? """ for row in local.getDb().execute(query, (self.id, self.date, self.start, self.end)): yield Event()._init(row) @classmethod def all(cls): row = local.getDb().execute("SELECT count(id) as c FROM events").fetchone() yield 0 if row is None else row['c'] for row in local.getDb().execute("SELECT * FROM events"): yield cls()._init(row) @classmethod def by_id(cls, id): row = local.getDb().execute("SELECT * FROM events WHERE id = ?", (id,)).fetchone() if row is None: raise ObjectNotFound("<{} #{}>".format(cls.__name__, id)) return cls()._init(row) @classmethod def filter(cls, day: Optional[Day] = None, room: Optional[Room] = None, track: Optional[Track] = None, order_by: str = "start, room", **kwargs): filterdata, wherestm = _build_filter("events", day=day, room=room, track=track, **kwargs) query = """SELECT * FROM events WHERE {} ORDER BY {}""".format(" AND ".join(wherestm), order_by) resultcountquery = query.replace("SELECT *", "SELECT count(events.id) as c") row = local.getDb().execute(resultcountquery, filterdata).fetchone() yield 0 if row is None else row['c'] for row in local.getDb().execute(query, filterdata): yield cls()._init(row) @classmethod def nextup(cls, minutes): """get events starting in next `minutes`""" minutes = min(int(minutes), 30) # some sanity check now = datetime.datetime.now(UTC).replace(tzinfo=None).strftime("%Y-%m-%dT%H:%M:%S.000") # now = "now" # is "now" somehow broken? query = """SELECT * FROM events WHERE starred=1 AND notified=0 AND datetime(start) >= datetime("{1}") AND datetime(start) <= datetime("{1}", "+{0} minutes");""" for row in local.getDb().execute(query.format(minutes, now)): yield cls()._init(row) @classmethod def search(cls, term, starred=False, order_by=None, **filters): """Search events for 'term'""" if starred: filters["starred"] = 1 filterdata, wherestm = _build_filter("events", **filters) if term == "" and len(wherestm) == 0: yield 0 return if term != "": order = ['rank'] if order_by: order = [order_by, 'rank'] wherestm.append("fts_event = ?") filterdata.append(term) query = """SELECT events.* FROM fts_event JOIN events ON events.id = fts_event.event_id WHERE {} GROUP BY events.id ORDER BY {}""" else: order = ['start', 'room'] if order_by: order = [order_by] query = """SELECT events.* FROM events WHERE {} ORDER BY {}""" query = query.format( " AND ".join(wherestm), ", ".join(order) ) resultcountquery = query.replace("SELECT events.*", "SELECT count(events.id) as c") row = local.getDb().execute(resultcountquery, filterdata).fetchone() yield 0 if row is None else row['c'] results = local.getDb().execute(query, filterdata) for row in results: yield cls()._init(row) class RecentConf(GObject.Object): __gtype_name__ = "ConfyRecentConf" @GObject.Property(type=str, default="") def uri(self): return self._uri @GObject.Property(type=str, default="") def title(self): return self._title def __init__(self, recentinfo: Gtk.RecentInfo): super().__init__() self.data = recentinfo.get_description() self._uri = recentinfo.get_uri() self._title = recentinfo.get_display_name() def __str__(self): return f"{self._title} : {self._uri}" confy-0.8.0/src/networkconnectionmonitor.py000066400000000000000000000020441473600550000211570ustar00rootroot00000000000000from gi.repository import GObject from gi.repository import Gio class NetworkConnectionMonitor(GObject.Object): __gtype_name__ = "ConfyNetworkConnectionMonitor" def __init__(self): super().__init__() self._isconnected = False self.nm = Gio.NetworkMonitor.get_default() self.nm.connect("network-changed", self.on_network_changed) self.on_network_changed() def on_network_changed(self, *args): _ic = self._isconnected self._isconnected = self.nm.get_connectivity() == Gio.NetworkConnectivity.FULL if (self._isconnected != _ic): # print("NetworkConnectionMonitor.isconnected", self._isconnected) self.notify("isconnected") @GObject.Property(type=bool, default=False) def isconnected(self): """The system can reach the global netowrk. Bool, read-only""" # print("NetworkConnectionMonitor.isconnected getter:", self._isconnected) return self._isconnected def get_isconnected(self) -> bool: return self._isconnected confy-0.8.0/src/openwindow.blp000066400000000000000000000070721473600550000163220ustar00rootroot00000000000000using Gtk 4.0; using Adw 1; template $ConfyOpenWindow : Adw.ApplicationWindow { icon-name: "net.kirgroup.confy"; default-width: 600; default-height: 480; Adw.ToastOverlay overlay { Gtk.Box { orientation: vertical; Adw.HeaderBar { visible: bind template.in_edit inverted; title-widget: Adw.WindowTitle { title: _("Events"); }; [start] Button open_button { icon-name: "list-add-symbolic"; tooltip-text: _("Add event from URL"); action-name: 'win.add-event'; } [start] ToggleButton search_button { icon-name: "system-search-symbolic"; tooltip-text: _("Find event"); active: bind searchbar.search-mode-enabled bidirectional; } [end] MenuButton menu_button { menu-model: menu_start; icon-name: "open-menu-symbolic"; primary: true; } [end] Button update_button { icon-name: "view-refresh-symbolic"; tooltip-text: _("Refresh events list"); action-name: 'win.refresh-events'; } } Adw.HeaderBar { styles ['editbar'] visible: bind template.in_edit; show-end-title-buttons: false; show-start-title-buttons: false; title-widget: Adw.WindowTitle { title: _("Edit events"); }; [start] ToggleButton { icon-name: "system-search-symbolic"; tooltip-text: _("Find event"); active: bind searchbar.search-mode-enabled bidirectional; } [end] Gtk.ToggleButton { label: _("Done"); active: bind template.in_edit inverted bidirectional; } } $ConfySearchBarOverlay searchbar { show_advanced: false; changed => $on_do_search(); notify::search-mode-enabled => $on_do_search(); } Gtk.Stack stack { Adw.StatusPage empty_placeholder { icon-name: "net.kirgroup.confy"; title: _("No events yet"); description: _("Add an event with the add button in title bar."); vexpand: true; } Adw.StatusPage nomatch_placeholder { icon-name: "system-search-symbolic"; title: _("No matches"); vexpand: true; } Gtk.ScrolledWindow content{ vexpand: true; Adw.Clamp { Gtk.Box { styles ['main-box'] orientation: vertical; spacing: 12; Gtk.Label heading_next { styles ['heading'] halign: start; label: _("Coming up"); } Gtk.ListBox listbox_next { styles ['boxed-list'] margin-bottom: 20; row-activated => $on_activated_next(); } Gtk.Label heading_past{ styles ['heading'] halign: start; label: _("Past"); } Gtk.ListBox listbox_past { styles ['boxed-list'] row-activated => $on_activated_past(); } } } } } } } } menu menu_start { section { item (_("Add event from URL"), "win.add-event") item (_("Refresh list"), "win.refresh-events") item (_("Search"), "win.search") item (_("Edit events"), "win.edit-meta") // separator ? item (_("Preferences"), "app.preferences") item (_("Keyboard Shortcuts"), "app.shortcuts") item (_("About Confy"), "app.about") } } confy-0.8.0/src/openwindow.py000066400000000000000000000250271473600550000161750ustar00rootroot00000000000000import datetime from gettext import gettext as _ from gi.repository import Gio from gi.repository import GObject from gi.repository import Gtk from gi.repository import Adw from . import local from . import models from .networkconnectionmonitor import NetworkConnectionMonitor from .widgets import InputDialog from .widgets import EventEditDialog from .widgets import LoadingOverlay @Gtk.Template(resource_path="/net/kirgroup/confy/openwindow.ui") class OpenWindow(Adw.ApplicationWindow): __gtype_name__ = "ConfyOpenWindow" overlay = Gtk.Template.Child() # type: ignore searchbar = Gtk.Template.Child() # type: ignore stack = Gtk.Template.Child() # type: ignore empty_placeholder = Gtk.Template.Child() # type: ignore nomatch_placeholder = Gtk.Template.Child() # type: ignore content = Gtk.Template.Child() # type: ignore heading_next = Gtk.Template.Child() # type: ignore listbox_next = Gtk.Template.Child() # type: ignore heading_past = Gtk.Template.Child() # type: ignore listbox_past = Gtk.Template.Child() # type: ignore _in_edit = False @GObject.Property(type=bool, default=False) def in_edit(self): return self._in_edit @in_edit.setter def in_edit_setter(self, value): self._in_edit = value def __init__(self, **kwargs): self.nm = NetworkConnectionMonitor() self.data = [] super().__init__(**kwargs) self.stack.set_visible_child(self.empty_placeholder) fetcher = local.open_menu(self.nm.props.isconnected) if fetcher is not None: self.loading_show(fetcher) fetcher.connect("done", lambda *_: self.update_list()) fetcher.connect("error", lambda s, e: self.notification_show(_("Error loading events list:\n{}").format(e))) else: self.update_list() self._add_action("add-event", None, ["a"], self.open_custom_url) self._add_action("refresh-events", None, ["r"], self.update_schedules) # TODO: disable action if there is no user entris in menu self.edit_meta_action = self._add_action("edit-meta", None, None, lambda *_: self.set_in_edit(not self.props.in_edit)) self._add_action("search", None, ["f"], lambda *_: self.searchbar.set_search_mode(True)) # can't do this because: Warning: ../glib/gobject/gbinding.c:271: Unable to convert a value of type PyObject to a value of type gboolean # self.nm.bind_property("isconnected", refresh_events_action, "enabled", 0 ) self.nm.connect("notify", self.on_networkconnectionmonitor_notify) self.on_networkconnectionmonitor_notify() def _add_action(self, name, parameter_type, accels, activate_cbk): action = Gio.SimpleAction.new(name, parameter_type) action.connect("activate", activate_cbk) self.add_action(action) if accels is not None: self.get_application().set_accels_for_action(F"win.{name}", accels) return action def set_in_edit(self, value): self.props.in_edit = value @Gtk.Template.Callback() def on_do_search(self, *args): self.update_list() def on_networkconnectionmonitor_notify(self, *args): is_connected = self.nm.props.isconnected self.lookup_action("refresh-events").set_enabled(is_connected) self.lookup_action("add-event").set_enabled(is_connected) def update_schedules(self, *args): def _done(s, f): self.update_list() self.notification_show(_("Events list updated")) def _error(s, e): self.notification_show(_("Error loading events list:\n{}").format(e)) fetcher = local.update_menu() self.loading_show(fetcher) fetcher.connect("done", _done) fetcher.connect("error", _error) def delete_conf(self, conf, cbk=None): def _message_response(dialog, response): if response == "delete": local.delete_user_menu(conf.to_json()) self.update_list() if cbk is not None: cbk(conf) dialog.destroy() message = Adw.MessageDialog(transient_for=self) message.props.heading = _('Delete event "{}"?').format(conf.title) message.props.body = _("Event will be removed from event list and related data will be deleted") message.add_response("cancel", _("Cancel")) message.add_response("delete", _("Delete")) message.set_response_appearance("delete", Adw.ResponseAppearance.DESTRUCTIVE) message.set_default_response("cancel") message.set_close_response("cancel") message.connect("response", _message_response) message.present() def edit_conf(self, conf, ok_cbk=None, del_cbk=None, can_cancel=True, can_delete=False): def _save(dialog): conf = d.get_conf() local.update_user_menu(conf.to_json()) if conf.has_cache(): with conf.get_meta() as m: m.title = conf.title m.start = conf.start m.end = conf.end self.update_list() if ok_cbk is not None: ok_cbk(conf) d.close() def _delete(dialog): self.delete_conf(conf, lambda *_: d.close()) if conf is None: return d = EventEditDialog(self, conf, can_delete=can_delete, can_cancel=can_cancel) d.connect("save", _save) d.connect("delete", _delete) d.connect("cancel", lambda *args: d.close()) d.present(self) def open_custom_url(self, *args): def _cbk(conf): self.notification_show(_("New event: {}").format(conf.title)) def _error(s, e): self.notification_show(_("Error: {}").format(e)) def _add_menu_ckb(meta): conf = models.Conference.by_url(meta.url) self.edit_conf(conf, can_cancel=False, ok_cbk=_cbk) def _dialog_response(dialog, res): if res == InputDialog.OK: url = dialog.get_text() try: fetcher = local.add_user_menu(url, _add_menu_ckb) if fetcher is not None: fetcher.connect("error", _error) except local.MenuItemAlreadyExistsException as e: # edit existing obj self.notification_show(_("Event already in list")) conf = models.Conference()._init(e.obj) self.edit_conf(conf, can_cancel=True) except Exception as e: import traceback traceback.print_exc() self.notification_show(_("Error: {}").format(e)) else: if fetcher is not None: self.loading_show(fetcher) dialog.destroy() dialog = InputDialog(self) dialog.connect("response", _dialog_response) dialog.present() def _empty_list(self, listbox): w = listbox.get_last_child() while w: listbox.remove(w) w = listbox.get_last_child() def update_list(self): sb = self.searchbar try: confs = models.Conference.all() # if searchbar is visible and search text is not "", filter confs by title and url if sb.is_searching(): search = sb.entry.get_text().lower() confs = [conf for conf in confs if search in conf.title.lower() or search in conf.url.lower()] except Exception as e: self.notification_show(_("Error loading events list:\n{}").format(e)) self._empty_list(self.listbox_next) self._empty_list(self.listbox_past) count = len(confs) if count == 0: if self.searchbar.is_searching(): self.stack.set_visible_child(self.nomatch_placeholder) else: self.stack.set_visible_child(self.empty_placeholder) else: self.stack.set_visible_child(self.content) confs_next = [] confs_past = [] for conf in confs: row = self.build_row(conf) if conf.end < datetime.date.today(): confs_past.append(conf) self.listbox_past.append(row) else: confs_next.append(conf) self.listbox_next.append(row) show_next = len(confs_next) > 0 show_past = len(confs_past) > 0 self.listbox_next.set_visible(show_next) self.heading_next.set_visible(show_next) self.listbox_past.set_visible(show_past) self.heading_past.set_visible(show_past) self.data = [ confs_next, confs_past ] def build_row(self, obj): row = Adw.ActionRow(activatable=True, selectable=False) row.set_title(obj.title) self.bind_property("in-edit", row, "activatable", GObject.BindingFlags.SYNC_CREATE | GObject.BindingFlags.INVERT_BOOLEAN) if obj.user: delete_button = Gtk.Button( icon_name="user-trash-symbolic", valign=Gtk.Align.CENTER, ) delete_button.add_css_class("destructive-action") delete_button.connect("clicked", lambda *_: self.delete_conf(obj)) self.bind_property("in-edit", delete_button, "visible", GObject.BindingFlags.SYNC_CREATE) row.add_suffix(delete_button) edit_button = Gtk.Button( icon_name="document-edit-symbolic", valign=Gtk.Align.CENTER, ) edit_button.add_css_class("suggested-action") edit_button.connect("clicked", lambda *_: self.edit_conf(obj, can_delete=obj.user)) self.bind_property("in-edit", edit_button, "visible", GObject.BindingFlags.SYNC_CREATE) row.add_suffix(edit_button) return row @Gtk.Template.Callback() def on_activated_next(self, listbox, actionrow): idx = actionrow.get_index() obj = self.data[0][idx] self.props.application.open_conf(obj) @Gtk.Template.Callback() def on_activated_past(self, listbox, actionrow): idx = actionrow.get_index() obj = self.data[1][idx] self.props.application.open_conf(obj) def loading_show(self, cancellable): t = LoadingOverlay(cancellable) self.overlay.add_toast(t) def notification_show(self, text): t = Adw.Toast() t.set_title(text) self.overlay.add_toast(t) confy-0.8.0/src/pages/000077500000000000000000000000001473600550000145235ustar00rootroot00000000000000confy-0.8.0/src/pages/__init__.py000066400000000000000000000014531473600550000166370ustar00rootroot00000000000000# pages.py # # Copyright 2020-2023 Fabio Comuni, et al. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . from .info import PageInfo from .list import PageList from .events import PageEvents from .details import PageDetails confy-0.8.0/src/pages/details.blp000066400000000000000000000071201473600550000166470ustar00rootroot00000000000000using Gtk 4.0; using Adw 1; template $ConfyPageDetails : Adw.NavigationPage { tag: "details"; Adw.ToolbarView { [top] Adw.HeaderBar headerbar { title-widget: Adw.WindowTitle windowtitle { title: bind template.title; subtitle: bind template.authors; }; [start] $ConfyToggleSidebarButton { icon-name: "sidebar-show-symbolic"; } [end] MenuButton { menu-model: menu_details; icon-name: "open-menu-symbolic"; } } Gtk.ScrolledWindow scroll { hexpand: true; vexpand: true; Adw.Clamp { Gtk.Box pagebox { styles ['main-box'] orientation: vertical; spacing: 24; Gtk.Box { orientation: vertical; spacing: 6; Gtk.Label { styles ['title-1'] label: bind template.title; wrap: true; halign: start; // selectable: true; } Gtk.Label { label: bind template.subtitle; visible: bind template.has-subtitle; wrap: true; halign: start; // selectable: true; } Gtk.FlowBox author_box { orientation: horizontal; selection-mode: none; } } Gtk.Box { spacing: 6; Gtk.Box { hexpand: true; orientation: vertical; spacing: 6; Gtk.Label { styles ['caption-heading'] halign: start; label: bind template.time; } Gtk.Label { styles ['caption'] halign: start; wrap: true; label: bind template.room; } Gtk.Label { styles ['caption'] halign: start; wrap: true; label: bind template.track; } } $ConfyStarButton star_button { clicked => $toggle_starred(); } } Gtk.Box { orientation: vertical; spacing: 12; visible: bind conflicts_list.visible; Gtk.Label { styles ['heading'] halign: start; label: _("Conflicts with"); } Gtk.ListBox conflicts_list { styles ['boxed-list'] row-activated => $on_conflict_activated(); } } Gtk.Label { halign: start; wrap: true; label: bind template.abstract; visible: bind template.has-abstract; // selectable: true; use-markup: true; } Gtk.Label { halign: start; wrap: true; label: bind template.description; visible: bind template.has-description; // selectable: true; use-markup: true; } Gtk.Box { orientation: vertical; spacing: 12; visible: bind links_list.visible; Gtk.Label { styles ['heading'] halign: start; label: _("Links"); } Gtk.ListBox links_list { styles ['boxed-list'] row-activated => $on_link_activated(); } } } } } } } menu menu_details { section { item { label: _("Copy to clipboard"); action: "win.copy"; } } } confy-0.8.0/src/pages/details.py000066400000000000000000000153311473600550000165250ustar00rootroot00000000000000# events.py # # Copyright 2020-2024 Fabio Comuni, et al. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . from typing import Optional from gi.repository import GObject from gi.repository import Gdk from gi.repository import Gtk from gi.repository import Adw from ..utils import convert_markdown_links, clean_markup, markup_to_text from ..widgets import EventActionRow, Author, StarButton from ..widgets import WebLinkActionRow, weblinkactionrowactivated from ..models import Event @Gtk.Template(resource_path="/net/kirgroup/confy/pages/details.ui") class PageDetails(Adw.NavigationPage): __gtype_name__ = "ConfyPageDetails" scroll: Gtk.ScrolledWindow = Gtk.Template.Child() # type: ignore star_button: StarButton = Gtk.Template.Child() # type: ignore conflicts_list: Gtk.ListBox = Gtk.Template.Child() # type: ignore links_list: Gtk.ListBox = Gtk.Template.Child() # type: ignore author_box: Gtk.FlowBox = Gtk.Template.Child() # type: ignore _subtitle = "" _authors = "" _time = "" _room = "" _track = "" _abstract = "" _description = "" @GObject.Property(type=str, default="") def subtitle(self): return self._subtitle @subtitle.setter def subtitle_setter(self, v): self._subtitle = v self.notify("has-subtitle") @GObject.Property(type=bool, default=False) def has_subtitle(self): return self._subtitle != "" @GObject.Property(type=str, default="") def authors(self): return self._authors @authors.setter def authors_setter(self, v): self._authors = v self.notify("has-authors") @GObject.Property(type=bool, default=False) def has_authors(self): return self._authors != "" @GObject.Property(type=str, default="") def time(self): return self._time @time.setter def time_setter(self, v): self._time = v @GObject.Property(type=str, default="") def room(self): return self._room @room.setter def room_setter(self, v): self._room = v @GObject.Property(type=str, default="") def track(self): return self._track @track.setter def track_setter(self, v): self._track = v @GObject.Property(type=str, default="") def abstract(self): return self._abstract @abstract.setter def abstract_setter(self, v): self._abstract = v self.notify("has-abstract") @GObject.Property(type=bool, default=False) def has_abstract(self): return self._abstract is not None and self._abstract != "" and self._abstract != "None" @GObject.Property(type=str, default="") def description(self): return self._description @description.setter def description_setter(self, v): self._description = v self.notify("has-description") @GObject.Property(type=bool, default=False) def has_description(self): return self._description is not None and self._description != "" and self._description != "None" _handler_id: Optional[int] = None obj: Optional[Event] = None def __init__(self, obj, **kwargs): super().__init__(**kwargs) self.set_obj(obj) def set_obj(self, obj): if self._handler_id: self.obj.disconnect(self._handler_id) self.obj = obj self._handler_id = obj.connect('update', self._on_obj_update) self.scroll.get_vadjustment().set_value(0) self._on_obj_update() def _on_obj_update(self, *_): self.props.title = markup_to_text(self.obj.title) self.props.authors = ", ".join([clean_markup(str(p)) for p in self.obj.persons()]) self.props.subtitle = markup_to_text(self.obj.subtitle) self.props.time = "{}-{}".format( self.obj.start_in_tz().strftime("%A %H:%M"), self.obj.end_in_tz().strftime("%H:%M")) self.props.room = clean_markup(self.obj.room) self.props.track = clean_markup(self.obj.track) self.props.abstract = clean_markup(convert_markdown_links(self.obj.abstract)) self.props.description = clean_markup(convert_markdown_links(self.obj.description)) self.author_box.remove_all() for author in self.obj.persons(): widget = Author(author) wrap = Gtk.FlowBoxChild(child=widget) self.author_box.append(wrap) self._conflicts = conflicts = list(self.obj.get_conflicts()) self.conflicts_list.props.visible = len(conflicts) > 0 w = self.conflicts_list.get_last_child() while w: self.conflicts_list.remove(w) w = self.conflicts_list.get_last_child() for c in conflicts: row = EventActionRow(c) self.conflicts_list.append(row) links = list(self.obj.links()) self.links_list.props.visible = len(links) > 0 w = self.links_list.get_last_child() while w: self.links_list.remove(w) w = self.links_list.get_last_child() for link in links: row = WebLinkActionRow(link.name, link.href) self.links_list.append(row) self.star_button.props.is_starred = self.obj.starred def copy_to_clipboard(self): cb = Gdk.Display.get_default().get_clipboard() data = [self.get_title()] def _append(txt): if txt != "": data.append(txt) _append(self._subtitle) _append(self._authors) data.append("") _append(self._time) _append(self._room) _append(self._track) data.append("") _append(self._abstract) _append(self._description) data.append("") for link in self.obj.links(): data.append(f"{link.name}\n{link.href}\n") text = "\n".join(data) text = markup_to_text(text) print(text) cb.set(text) @Gtk.Template.Callback() def toggle_starred(self, *_): self.obj.set_star(not self.obj.starred) @Gtk.Template.Callback() def on_conflict_activated(self, listbox, row): self.set_obj(row.obj) @Gtk.Template.Callback() def on_link_activated(self, listbox, row): weblinkactionrowactivated(listbox, row) confy-0.8.0/src/pages/events.blp000066400000000000000000000042251473600550000165310ustar00rootroot00000000000000using Gtk 4.0; using Adw 1; template $ConfyPageEvents : Adw.NavigationPage { Adw.ToolbarView { [top] Adw.HeaderBar { title-widget: Adw.WindowTitle windowtitle { title: bind template.title; subtitle: bind template.subtitle; }; [start] $ConfyToggleSidebarButton { icon-name: "sidebar-show-symbolic"; } // [start] // Gtk.ToggleButton search_button { // icon-name: "system-search-symbolic"; // } [end] Gtk.MenuButton { menu-model: menu_group_by; icon-name: "open-menu-symbolic"; } } [top] $ConfySearchBarOverlay searchbar { changed => $on_searchbar_entry_changed(); // search-mode-enabled: bind search_button.active bidirectional; notify::search-mode-enabled => $on_search_mode_changed(); } Gtk.Stack stack { Gtk.StackPage { name: 'list'; child: Gtk.ScrolledWindow scroll { hexpand: true; vexpand: true; Adw.Clamp { Gtk.Box pagebox { styles ['main-box'] orientation: vertical; spacing: 12; } } }; } Gtk.StackPage { name: 'empty_star'; child: Adw.StatusPage { icon-name: "non-starred-symbolic"; title: _("Nothing starred yet"); description: _("Star a talk to be notified when it's about to start."); vexpand: true; }; } Gtk.StackPage { name: 'no_match'; child: Adw.StatusPage nomatch_placeholder { icon-name: "system-search-symbolic"; title: _("No matches"); vexpand: true; }; } } } } menu menu_group_by { section { label: _("Group by"); item { label: _("Date"); action: "list.group-by"; target: "date"; } item { label: _("Track"); action: "list.group-by"; target: "track"; } item { label: _("Room"); action: "list.group-by"; target: "room"; } item { label: _("No group"); action: "list.group-by"; target: "NONE"; } } } confy-0.8.0/src/pages/events.py000066400000000000000000000256671473600550000164210ustar00rootroot00000000000000# events.py # # Copyright 2020-2024 Fabio Comuni, et al. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . from gettext import gettext as _ from typing import Any, Optional from dataclasses import dataclass, field from gi.repository import GObject from gi.repository import GLib from gi.repository import Gio from gi.repository import Gtk from gi.repository import Adw from .details import PageDetails from .. import models from ..config import FMT_DAY # type:ignore # config is generated at compile time from ..utils import clean_markup from ..utils import InterruptibleTimeout from ..widgets import EventActionRow, SearchBarOverlay @dataclass class ListBuilderCtx: lastobj: Optional[models.Event] = None listbox: Optional[Gtk.ListBox] = None data: list[GObject.GObject] = field(default_factory=list) def __repr__(self): return f"" @Gtk.Template(resource_path="/net/kirgroup/confy/pages/events.ui") class PageEvents(Adw.NavigationPage): """Talks list page (called "Events" from pentabarf xml)""" __gtype_name__ = "ConfyPageEvents" stack: Gtk.Stack = Gtk.Template.Child() # type: ignore pagebox: Gtk.Box = Gtk.Template.Child() # type: ignore # search_button: Gtk.ToggleButton = Gtk.Template.Child() # type: ignore searchbar: SearchBarOverlay = Gtk.Template.Child() # type: ignore scroll: Gtk.ScrolledWindow = Gtk.Template.Child() # type: ignore filters: Optional[dict[str, Any]] = None _group_by: Optional[str] = None _order_by: str = "start, room" _update_handler_id: Optional[int] = None _value: Optional[models.Event] = None timeout = InterruptibleTimeout() _subtitle = "" _model = "" @GObject.Property(type=str, default="") def subtitle(self): return self._subtitle @subtitle.setter def subtitle_setter(self, v): self._subtitle = v @GObject.Property(type=str, default="") def model(self): return self._model @model.setter def model_setter(self, v): if v not in ["days", "tracks", "rooms", "starred", "search"]: raise ValueError(f"Model {v} is not valid for PageList.") self._model = v @GObject.Property(type=str, default=None) def group_by(self): return self._group_by @group_by.setter def group_by_setter(self, value: Optional[str]): if value == "NONE": # I don't want to fight with Variant value = None self._group_py = value match value: case "track": self.order_by = "track, start, room" case "date": self.order_by = "start, room" case "room": self.order_by = "room, start" case _: self.order_by = "start, room" self._group_by_action.set_state(GLib.Variant.new_string(value if value else "NONE")) def set_model(self, v): self.props.model = v def set_group_by(self, value: Optional[str] = None): self.props.group_by = value # type: ignore def __init__(self, value, **kwargs): super().__init__(**kwargs) self._setup_actions() self.set_value(value) def _setup_actions(self): group = Gio.SimpleActionGroup.new() # group by parameter_type = GLib.VariantType.new("s") state = GLib.Variant("s", "NONE") self._group_by_action = action = Gio.SimpleAction.new_stateful("group-by", parameter_type, state) action.connect("activate", self._on_group_by) group.insert(action) self.insert_action_group("list", group) def _on_group_by(self, action: Gio.SimpleAction, param: GLib.Variant): self.set_group_by(param.get_string()) action.set_state(param) self.update() with models.Meta() as m: m.set(f"{self._model}_group_by", param.get_string()) def get_value(self): return self._value def set_value(self, obj): print(f"PageEvents: set_value(obj={obj}) model={self._model}") if self._update_handler_id: models.dbUpdateWatcher.disconnect(self._update_handler_id) self._update_handler_id = None self.scroll.get_vadjustment().set_value(0) # self.search_button.props.visible = True # self.search_button.props.active = False self.searchbar.props.search_mode_enabled = False self.searchbar.props.show_close_button = True if self._model == "days": self.props.title = _("Talks on {}").format(obj.date.strftime(FMT_DAY)) self.props.subtitle = "" self.filters = {'day': obj} self.set_group_by(None) self.order_by = "start, room" elif self._model == "tracks": subtitle = [] if len(obj.room) == 1 and obj.room[0].name != "": subtitle.append(obj.room[0].name) if len(obj.date) == 1: subtitle.append(obj.date[0].date.strftime(FMT_DAY)) self.props.title = _("{} Track").format(obj) self.props.subtitle = ", ".join(subtitle) self.filters = {'track': obj} self.set_group_by("date") elif self._model == "rooms": if obj.name is None: title = _("No Room") else: title = _("Room {}").format(clean_markup(obj.name)) self.props.title = title self.props.subtitle = "" self.filters = {'room': obj} self.set_group_by("date") elif self._model == "starred": self.props.title = _("Starred") self.props.subtitle = "" self.filters = {'starred': True} self.set_group_by("date") # TODO: or None? self._update_handler_id = models.dbUpdateWatcher.connect("update", self.update) elif self.model == "search": self.props.title = _("Search Talks") self.props.subtitle = "" # self.search_button.props.active = True # self.search_button.props.visible = False self.searchbar.props.search_mode_enabled = True self.searchbar.props.show_close_button = False self.filters = None self.set_group_by(None) else: print(f"PageEvents: set_value: no valid model set '{self._model}'") return _meta = models.Meta() _key = f"{self._model}_group_by" if _key in _meta: self.set_group_by(_meta.get(_key)) self.update() def update(self, *args): count, data = self.get_objects() self.timeout.stop() # empty box w = self.pagebox.get_last_child() while w: self.pagebox.remove(w) w = self.pagebox.get_last_child() if count == 0: self.show_placeholder() else: self.stack.set_visible_child_name('list') ctx = ListBuilderCtx() ctx.data = data self.timeout = InterruptibleTimeout(500, self.build_list, ctx) def build_list(self, timeout, ctx): for idx, obj in enumerate(ctx.data): if timeout.must_stop(): return False header = self.build_header(obj, ctx.lastobj) if header: ctx.listbox = None self.pagebox.append(header) row = self.build_row(obj) if ctx.listbox is None: ctx.listbox = self.build_listbox() self.pagebox.append(ctx.listbox) ctx.listbox.append(row) ctx.lastobj = obj if idx > 10: return True return False def build_listbox(self): lb = Gtk.ListBox(margin_bottom=20) lb.add_css_class("boxed-list") lb.connect("row-activated", self.on_litstbox_activated) return lb def build_header(self, current, before): """ `current` is current data to be added, `before` is data added before. return a widget for a new header, or None. """ _title = None match self._group_py: case "date": if before is None or current.date.strftime(FMT_DAY) != before.date.strftime(FMT_DAY): _title = current.date.strftime(FMT_DAY) case "track": if before is None or current.track != before.track: _title = current.track if _title == "": _title = "no track" case "room": if before is None or current.room != before.room: _title = current.room if _title: label = Gtk.Label(label=_title, halign=Gtk.Align.START, use_markup=True) label.add_css_class("heading") return label return None @Gtk.Template.Callback() def on_searchbar_entry_changed(self, e): self.update() @Gtk.Template.Callback() def on_search_mode_changed(self, *_): self.update() def get_objects(self): if self.model == "search": term = self.searchbar.entry.get_text() is_starred = self.searchbar.is_starred.get_active() _filters = {} if is_starred: _filters['starred'] = True g = models.Event.search(term, **_filters) return next(g), g if self.filters is None: return 0, [] if self.searchbar.is_searching(): term = self.searchbar.entry.get_text() is_starred = self.searchbar.is_starred.get_active() _filters = self.filters.copy() if is_starred: _filters['starred'] = True g = models.Event.search(term, order_by=self._group_py, **_filters) return next(g), g g = models.Event.filter(**self.filters, order_by=self.order_by) return next(g), g def build_row(self, obj): row = EventActionRow(obj) return row def show_placeholder(self): if self._model == "search" or self.searchbar.is_searching(): self.stack.set_visible_child_name('no_match') elif self._model == "starred": self.stack.set_visible_child_name('empty_star') else: self.stack.set_visible_child_name('list') def on_litstbox_activated(self, listbox, row): self._value = value = row.obj page = PageDetails(obj=value) self.get_parent().push(page) confy-0.8.0/src/pages/info.blp000066400000000000000000000010261473600550000161540ustar00rootroot00000000000000using Gtk 4.0; using Adw 1; template $ConfyPageInfo : Adw.NavigationPage { Adw.ToolbarView { [top] Adw.HeaderBar { [start] $ConfyToggleSidebarButton { icon-name: "sidebar-show-symbolic"; } } Adw.StatusPage statuspage { title: bind template.title; description: bind template.description; vexpand: false; Adw.Clamp { Gtk.ListBox linkbox { styles ['boxed-list'] row-activated => $on_linkbox_row_activated(); } } } } } confy-0.8.0/src/pages/info.py000066400000000000000000000060641473600550000160360ustar00rootroot00000000000000# info.py # # Copyright 2020-2024 Fabio Comuni, et al. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . from typing import Optional from gi.repository import GObject from gi.repository import Gio from gi.repository import Gdk from gi.repository import Gtk from gi.repository import Adw from .. import models from ..config import FMT_DAY # type:ignore # config is generated at compile time from ..widgets import WebLinkActionRow, weblinkactionrowactivated from ..utils import clean_markup @Gtk.Template(resource_path="/net/kirgroup/confy/pages/info.ui") class PageInfo(Adw.NavigationPage): __gtype_name__ = "ConfyPageInfo" conf: Optional[models.Conference] = None meta: Optional[models.Meta] = None statuspage = Gtk.Template.Child() # type: ignore linkbox = Gtk.Template.Child() # type: ignore @GObject.Property(type=str, default="") def description(self): desc = self.meta.venue or "" if self.meta.venue and self.meta.city: desc += "\n" desc += self.meta.city or "" if desc != "": desc += "\n\n" desc += self.meta.start.strftime(FMT_DAY) if self.meta.start != self.meta.end: desc += "\n" + self.meta.end.strftime(FMT_DAY) return clean_markup(desc) def __init__(self, win, conf, **kwargs): super().__init__(**kwargs) self.conf = conf self.update() win.connect("conf-updated", self.update) def _set_logo(self, fetcher, logofile): self.statuspage.set_paintable( Gdk.Texture.new_from_file( Gio.File.new_for_path(logofile) ) ) def update(self, *args): self.meta = self.conf.get_meta() if self.meta and self.meta.title: print("INFO set title to", self.meta.title) self.set_title(clean_markup(self.meta.title)) self.statuspage.set_icon_name('net.kirgroup.confy-symbolic') self.conf.get_logo_file(cbk=self._set_logo) w = self.linkbox.get_last_child() while w: self.linkbox.remove(w) w = self.linkbox.get_last_child() links = self.conf.metadata.get("links", []) self.linkbox.set_visible(len(links) > 0) for link in links: row = WebLinkActionRow(link['title'], link['url']) self.linkbox.append(row) self.notify("description") @Gtk.Template.Callback() def on_linkbox_row_activated(self, listbox, row): weblinkactionrowactivated(listbox, row) confy-0.8.0/src/pages/list.blp000066400000000000000000000020111473600550000161670ustar00rootroot00000000000000using Gtk 4.0; using Adw 1; template $ConfyPageList : Adw.NavigationPage { Adw.ToolbarView { [top] Adw.HeaderBar { [start] $ConfyToggleSidebarButton { icon-name: "sidebar-show-symbolic"; } } Gtk.Stack stack { Gtk.StackPage { name: 'list'; child: Gtk.ScrolledWindow { hexpand: true; vexpand: true; Adw.Clamp { Gtk.Box { styles ['main-box'] orientation: vertical; spacing: 12; Gtk.ListBox listbox { styles ['boxed-list'] row-activated => $on_litstbox_activated(); } } } }; } Gtk.StackPage { name: 'empty_star'; child: Adw.StatusPage { icon-name: "non-starred-symbolic"; title: _("Nothing starred yet"); description: _("Star a talk to be notified when it's about to start."); vexpand: true; }; } } } } confy-0.8.0/src/pages/list.py000066400000000000000000000102741473600550000160540ustar00rootroot00000000000000# info.py # # Copyright 2020-2024 Fabio Comuni, et al. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . from typing import Optional from gi.repository import GObject from gi.repository import Gtk from gi.repository import Adw from .events import PageEvents from .. import models from ..config import FMT_DAY # type:ignore # config is generated at compile time from ..utils import clean_markup @Gtk.Template(resource_path="/net/kirgroup/confy/pages/list.ui") class PageList(Adw.NavigationPage): __gtype_name__ = "ConfyPageList" conf: Optional[models.Conference] = None win: Optional[Adw.ApplicationWindow] = None stack: Gtk.Stack = Gtk.Template.Child() # type: ignore listbox: Gtk.ListBox = Gtk.Template.Child() # type: ignore # a quanto pare non posso attaccare nessun tipo di userdata a un ActionRow # quindi per sapere a quale oggetto si riferisce l'ActionRow attivato # mi tocca tenere un bel dizionario. E' brutto? Si. Frega qualcosa? Decisamente no. # La vecchia versione teneva la lista corrente degli oggetti, e ricavava il # selezionato da 'row.get_index()' nell' handler di 'row-activated'. # E' meglio o peggio? boh. _widget_data: dict[str, models.Event] = {} _value: Optional[models.Event] = None def get_value(self): return self._value _model = "" @GObject.Property(type=str, default="") def model(self): return self._model @model.setter def model_setter(self, v): if v not in ["days", "tracks", "rooms"]: raise ValueError(f"Model {v} is not valid for PageList.") self._model = v def get_model(self): return self._model def __init__(self, win, conf, **kwargs): super().__init__(**kwargs) self.conf = conf self.win = win win.connect("conf-updated", self.update) self.update() def update(self, *_): count, data = self.get_objects() # empty listbox self._widget_data = {} self.listbox.remove_all() if count == 0: self.show_placeholder() else: self.stack.set_visible_child_name('list') # fill listbox for idx, obj in enumerate(data): row = self.build_row(obj) self._widget_data[row] = obj self.listbox.append(row) def build_row(self, obj): """ Return a widget for data in current listbox """ title = str(obj) subtitle = "" if self._model == "days": title = obj.date.strftime(FMT_DAY) elif self._model == "tracks": if title == "": title = "- no track -" subtitle = ", ".join(str(r) for r in obj.room) row = Adw.ActionRow( activatable=True, selectable=False, title=clean_markup(title), subtitle=clean_markup(subtitle) ) icon = Gtk.Image.new_from_icon_name('go-next-symbolic') row.add_suffix(icon) return row def get_objects(self): if self._model == "days": return models.Day.count(), models.Day.all() elif self._model == "tracks": return models.Track.count(), models.Track.all() elif self._model == "rooms": return models.Room.count(), models.Room.all() else: return 0, [] @Gtk.Template.Callback() def on_litstbox_activated(self, listbox, row): self._value = value = self._widget_data[row] page = PageEvents(value, model=self._model) self.get_parent().push(page) def show_placeholder(self): self.stack.set_visible_child_name('list') confy-0.8.0/src/pages/meson.build000066400000000000000000000011771473600550000166730ustar00rootroot00000000000000## blueprint pages_blueprints_src = [ 'info.blp', 'list.blp', 'events.blp', 'details.blp', ] pages_blueprints_ui = [] foreach b : pages_blueprints_src pages_blueprints_ui += b.replace('.blp', '.ui') endforeach pages_blueprints = custom_target('widget_blueprints', input: pages_blueprints_src, output: pages_blueprints_ui, command: [blueprint_compiler, 'batch-compile', '@OUTDIR@', '@CURRENT_SOURCE_DIR@', '@INPUT@'], ) ## /blueprint confy_pages_sources = [ '__init__.py', 'details.py', 'events.py', 'info.py', 'list.py', ] install_data(confy_pages_sources, install_dir: moduledir / 'pages') confy-0.8.0/src/preferences.py000066400000000000000000000057621473600550000163110ustar00rootroot00000000000000# preferences.py # # Copyright 2020-2022 Fabio Comuni, et al. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . from gettext import gettext as _ from gi.repository import Gio from gi.repository import Gtk from gi.repository import Adw from .settings import Settings, CacheDuration from . import local def format_size(num): for unit in ['B', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB']: if abs(num) < 1024.0: return "%3.1f%s" % (num, unit) num /= 1024.0 return "%.1f%s" % (num, 'Yi') class PreferencesWindow(Adw.PreferencesWindow): def __init__(self, **kwargs): opts = dict( default_height=290, default_width=640, search_enabled=False, ) opts.update(kwargs) super().__init__(**opts) page = Adw.PreferencesPage() group = Adw.PreferencesGroup() listcache = Adw.ComboRow( title=_("Events list cache duration"), subtitle=_("Try to update list cache when it's older than this.")) listcache.set_model(CacheDuration.as_model()) Settings.instance().bind('list-cache', listcache, 'selected', Gio.SettingsBindFlags.DEFAULT) eventcache = Adw.ComboRow( title=_("Events info cache duration"), subtitle=_("Try to update event cache when it's older than this.")) eventcache.set_model(CacheDuration.as_model()) Settings.instance().bind('event-cache', eventcache, 'selected', Gio.SettingsBindFlags.DEFAULT) group.add(listcache) group.add(eventcache) page.add(group) group = Adw.PreferencesGroup() button = Gtk.Button(label=_("Clear"), valign=Gtk.Align.CENTER, halign=Gtk.Align.END) button.get_style_context().add_class("list-button") row = Adw.ActionRow( title=_("Cached data")) self._update_space_label(row) row.add_suffix(button) row.set_activatable_widget(button) button.connect("clicked", self._delete_cached_files, row) group.add(row) page.add(group) self.add(page) def _delete_cached_files(self, btn, row): local.clear_cache() self._update_space_label(row) def _update_space_label(self, row): cache_size = local.get_cache_size() occupied_space = format_size(cache_size) row.set_subtitle(_("Confy has {} of cached data").format(occupied_space)) confy-0.8.0/src/remotes/000077500000000000000000000000001473600550000151025ustar00rootroot00000000000000confy-0.8.0/src/remotes/__init__.py000066400000000000000000000026431473600550000172200ustar00rootroot00000000000000# __init__.py # # Copyright 2020-2022 Fabio Comuni, et al. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . import os from ..fetcher import Fetcher from .exceptions import InvalidFormatException from .pentabarf import import_pentabarf from .ics import import_ics from gettext import gettext as _ def update_schedule(url: str) -> Fetcher: def _do_load(sender, local_filename: str): print("local conf file:", local_filename) with open(local_filename, "r") as f: content = f.read() if content.strip().startswith("<"): import_pentabarf(content, url) elif content.strip().startswith("BEGIN:VCALENDAR"): import_ics(content, url) else: raise InvalidFormatException(_("Unknown schedule format")) os.remove(local_filename) return Fetcher(url, cbk=_do_load) confy-0.8.0/src/remotes/exceptions.py000066400000000000000000000013541473600550000176400ustar00rootroot00000000000000# exceptions.py # # Copyright 2020-2022 Fabio Comuni, et al. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . class InvalidFormatException(Exception): pass confy-0.8.0/src/remotes/ics.py000066400000000000000000000102501473600550000162300ustar00rootroot00000000000000# ics.py # # Copyright 2020-2022 Fabio Comuni, et al. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . import time import html from datetime import datetime, timedelta from dateutil.tz import UTC from icalendar import Calendar # type: ignore from .. import local from ..models import Meta def import_ics(content: str, url: str): """Import data from ICS all dates will be converted to UTC and stored in db without tzinfo, because sqlite3 driver spits errors otherwise. """ cal = Calendar.from_ical(content) _db = local.getDb() meta_title = None meta_end = datetime(1970, 1, 1, 0, 0, 0) meta_start = datetime(3100, 12, 12, 23, 59, 59) for c in cal.walk(): if c.name == "VCALENDAR": meta_title = c.get('X-WR-CALNAME') if c.name == "VEVENT": fulltextsearch = [] eventid = c['UID'] if c.get('DTSTART'): start = c['DTSTART'].dt.astimezone(UTC).replace(tzinfo=None) else: start = c['DTSTAMP'].dt.astimezone(UTC).replace(tzinfo=None) if c.get('DURATION'): end = start + c['DURATION'].dt elif c.get('DTEND'): end = c['DTEND'].dt.astimezone(UTC).replace(tzinfo=None) else: end = start + timedelta(hours=1) evtdate = start.date() room = c.get('LOCATION') slug = None title = c.get('SUMMARY', "") subtitle = None track = None evtype = None abstract = None description = c.get('DESCRIPTION', "") if title == "" and description == "": title = "Untitled event" if title == "" and description != "": title = description[:20] if len(description) > 20: title = title + "…" if room: room = html.unescape(room) if room == "": room = None if start < meta_start: meta_start = start if end > meta_end: meta_end = end fulltextsearch += [s for s in [title, subtitle, abstract, description, room, track] if s is not None] links = [] _url = c.get('URL') if _url: links.append((eventid, _url, _url)) _db.execute("""INSERT OR REPLACE INTO events (id, date, start, end, room, slug, title, subtitle, track, type, abstract, description, starred) VALUES (?,?,?,?,?,?,?,?,?,?,?,?, (SELECT starred FROM events WHERE id=?))""", (eventid, evtdate, start, end, room, slug, title, subtitle, track, evtype, abstract, description, eventid)) # _db.executemany("INSERT OR REPLACE INTO persons (id, name) VALUES (?, ?)", persons) # _db.executemany("""INSERT OR REPLACE INTO event_person (event_id, person_id) # VALUES (?, ?) ON CONFLICT DO NOTHING""", # [ (eventid, p[0]) for p in persons ]) _db.executemany("""INSERT OR REPLACE INTO links (event_id, href, name) VALUES (?,?,?)""", links) fulltextsearchstr = ' '.join(fulltextsearch) _db.execute("""INSERT OR REPLACE INTO fts_event (event_id, text) VALUES (?, ?)""", (eventid, fulltextsearchstr)) _db.commit() with Meta() as m: m.url = url m.title = meta_title m.last_update = time.time() # timestamp m.start = meta_start.date() m.end = meta_end.date() confy-0.8.0/src/remotes/meson.build000066400000000000000000000002501473600550000172410ustar00rootroot00000000000000confy_remotes_sources = [ '__init__.py', 'pentabarf.py', 'ics.py', 'exceptions.py', ] install_data(confy_remotes_sources, install_dir: moduledir / 'remotes') confy-0.8.0/src/remotes/pentabarf.py000066400000000000000000000154221473600550000174220ustar00rootroot00000000000000# pentabarf.py # # Copyright 2020-2022 Fabio Comuni, et al. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . from typing import Optional import datetime import time import sqlite3 import xml.etree.ElementTree as ET from gettext import gettext as _ from dateutil.tz import UTC, tzlocal from .exceptions import InvalidFormatException from .. import local from ..models import Meta def _local_to_utc_to_unset(dt): dt = dt.replace(tzinfo=tzlocal()) dt = dt.astimezone(UTC) return dt.replace(tzinfo=None) def _get_text(root: Optional[ET.Element], nodename: str) -> str: text = "" if root is not None: node = root.find(nodename) if node is not None and node.text is not None: text = node.text return text def import_pentabarf(xmlstr: str, url: str): """Import data from Pentabarf XML As far I can tell, Pentabarf XML doesn't declare timezone. We will import dates in local timezone, then convert to UTC, then remove timezone info to store dates in db (because sqlite3 cries otherwise) """ root = ET.fromstring(xmlstr) if root.tag != "schedule": raise InvalidFormatException(_("Invalid pentabarf format")) econference = root.find("conference") base_url = _get_text(econference, "base_url") with Meta() as m: m.url = url m.last_update = time.time() # timestamp m.title = _get_text(econference, "title") m.start = _get_text(econference, "start") m.end = _get_text(econference, "end") m.venue = _get_text(econference, "venue") m.days = _get_text(econference, "days") m.city = _get_text(econference, "city") _db = local.getDb() for eday in root.iter('day'): date = eday.attrib['date'] # found in sfscon. events nested in element # if we find 'day > room', we parse children events using # room name from room elements rooms = eday.findall("room") if rooms: for eroom in rooms: room = eroom.attrib['name'] _handle_events(_db, eroom, base_url, date, room) else: # if we don't find 'day > room', we then parse as 'day > event' _handle_events(_db, eday, base_url, date) # TODO: remove removed events _db.commit() def _handle_events( _db: sqlite3.Connection, root: ET.Element, base_url: str, date: str, room: Optional[str] = None) -> None: for eevent in root.iter('event'): fulltextsearch = [] # found in sfscon xml. event 'id' changes, # while unique_id not. # we use unique_id if is set if 'unique_id' in eevent.attrib: eventid = eevent.attrib['unique_id'] else: eventid = eevent.attrib['id'] tstart = _get_text(eevent, 'start').strip()[:5] start = _local_to_utc_to_unset( datetime.datetime.strptime(date + " " + tstart, "%Y-%m-%d %H:%M") ) end = _get_text(eevent, 'duration').split(":") end = start + datetime.timedelta(hours=int(end[0]), minutes=int(end[1])) evtdate = datetime.datetime.strptime(date, "%Y-%m-%d").date() if room is None: room = _get_text(eevent, 'room') slug = _get_text(eevent, 'slug') title = _get_text(eevent, 'title') subtitle = _get_text(eevent, 'subtitle') track = _get_text(eevent, 'track') evtype = _get_text(eevent, 'type') abstract = _get_text(eevent, 'abstract') description = _get_text(eevent, 'description') persons = [] for e in eevent.iter('person'): if e.text is None: continue name = e.text id = e.attrib.get('id', name) org = e.attrib.get('organizzation', '') thumbnail = e.attrib.get('thumbnail', '') if thumbnail and thumbnail.startswith("/"): thumbnail = base_url + thumbnail bio = e.attrib.get('bio', '') url = e.attrib.get('url', '') if url and url.startswith("/"): url = base_url + url persons.append(( id, name, org, thumbnail, bio, url )) fulltextsearch += [s for s in [title, subtitle, abstract, description, room, track] if s is not None] fulltextsearch += [p[1] for p in persons] links = [] for e in eevent.iter('link'): if e.text is None: continue name = e.text href = e.attrib.get('href', "") if not href: href = name if base_url and href.startswith("/"): href = base_url + href links.append((eventid, href, name)) for e in eevent.iter('attachment'): if e.text is None: continue name = e.text if e.attrib.get('type', False): name = '{} ({})'.format(name, e.attrib['type']) href = e.attrib.get('href', "") if not href: href = name if base_url and href.startswith("/"): href = base_url + href links.append((eventid, href, name)) _db.execute("""INSERT OR REPLACE INTO events (id, date, start, end, room, slug, title, subtitle, track, type, abstract, description, starred) VALUES (?,?,?,?,?,?,?,?,?,?,?,?, (SELECT starred FROM events WHERE id=?))""", (eventid, evtdate, start, end, room, slug, title, subtitle, track, evtype, abstract, description, eventid)) _db.executemany("INSERT OR REPLACE INTO persons (id, name, organization, thumbnail, bio, url) VALUES (?, ?, ?, ?, ?, ?)", persons) _db.executemany("""INSERT OR REPLACE INTO event_person (event_id, person_id) VALUES (?, ?) ON CONFLICT DO NOTHING""", [(eventid, p[0]) for p in persons]) _db.executemany("""INSERT OR REPLACE INTO links (event_id, href, name) VALUES (?,?,?)""", links) fulltextsearchstr = ' '.join(fulltextsearch) _db.execute("""INSERT OR REPLACE INTO fts_event (event_id, text) VALUES (?, ?)""", (eventid, fulltextsearchstr)) confy-0.8.0/src/settings.py000066400000000000000000000050221473600550000156350ustar00rootroot00000000000000# settings.py # # Copyright 2020-2022 Fabio Comuni, et al. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . from typing import Self, Optional from enum import IntEnum from gi.repository import Gio from gi.repository import Gtk from dateutil import tz class UnitializedError(Exception): pass # in secs CACHE_NOCACHE = 0 CACHE_ONE_HOUR = 60 * 60 CACHE_ONE_DAY = 24 * CACHE_ONE_HOUR CACHE_ONE_WEEK = 7 * CACHE_ONE_DAY class CacheDuration(IntEnum): NO_CACHE = 0 ONE_HOUR = 1 ONE_DAY = 2 ONE_WEEK = 3 @classmethod def as_model(cls): labels = [n.name.replace("_", " ").title() for n in cls] return Gtk.StringList.new(labels) @classmethod def get_duration(cls, enum_value): return [ CACHE_NOCACHE, CACHE_ONE_HOUR, CACHE_ONE_DAY, CACHE_ONE_WEEK ][enum_value] class Settings(Gio.Settings): _instance: Optional[Self] = None def __init__(self): """ Init settings """ Gio.Settings.__init__(self) @classmethod def instance(kls): if kls._instance is None: raise UnitializedError("No instance. Settings has not intialized.") return kls._instance @classmethod def init(kls, app_id): """ Initialize and return a new Settings object """ settings = Gio.Settings.new(app_id) settings.__class__ = Settings kls._instance = settings return settings def get_list_cache(self): return CacheDuration.get_duration(self.get_int('list-cache')) def get_event_cache(self): return CacheDuration.get_duration(self.get_int('event-cache')) def get_timezone(self): return tz.tzlocal() def get_size(self): return (self.get_int('window-width'), self.get_int('window-height')) def set_size(self, size): self.set_int('window-width', size[0]) self.set_int('window-height', size[1]) confy-0.8.0/src/shortcuts.blp000066400000000000000000000024451473600550000161660ustar00rootroot00000000000000using Gtk 4.0; Gtk.ShortcutsWindow shortcuts-win { modal: true; Gtk.ShortcutsSection { section-name: "shortcuts"; Gtk.ShortcutsGroup { title: _("Application"); Gtk.ShortcutsShortcut { accelerator: "comma"; title: _("Preferences"); } Gtk.ShortcutsShortcut { accelerator: "question"; title: _("Keyboard Shortcuts"); } Gtk.ShortcutsShortcut { accelerator: "Q"; title: _("Close"); } } Gtk.ShortcutsGroup { title: _("Event Window"); Gtk.ShortcutsShortcut { accelerator: "O"; title: _("Open Event"); } Gtk.ShortcutsShortcut { accelerator: "F"; title: _("Find talk"); } Gtk.ShortcutsShortcut { accelerator: "C"; title: _("Copy talk details to clipboard"); } } Gtk.ShortcutsGroup { title: _("Open Event"); Gtk.ShortcutsShortcut { accelerator: "F"; title: _("Find event"); } Gtk.ShortcutsShortcut { accelerator: "R"; title: _("Reload events list"); } Gtk.ShortcutsShortcut { accelerator: "A"; title: _("Add event from URL"); } } } } confy-0.8.0/src/utils.py000066400000000000000000000073071473600550000151450ustar00rootroot00000000000000import re from html.parser import HTMLParser from gi.repository import GLib def convert_markdown_links(text): """converts markdown links to html hyperlinks""" return re.sub(r"\[([^]]+?)\]\(([^)\s]+?)(?:\s.*?)?\)", r'\1', text) def clean_markup(text): """remove unsupported markup from text to use in label""" if text is None: text = "" text = html2pango(text) text = text.replace("\n\n\n", "\n\n") text = text.replace("&", "&") return text.strip() def markup_to_text(text): """return plain text version of markup string""" text = clean_markup(text) text = re.sub(r'', '_', text) text = re.sub(r'', '`', text) text = re.sub(r'', '**', text) text = text.replace("&", "&") # remove all remainig tags text = re.sub(r']*>', '', text) return text class InterruptibleTimeout: def __init__(self, intervall=0, callback=None, data=None): self._running = False self._requested_stop = True self._callback = callback if callback: self._running = True self._requested_stop = False if callback(self, data): GLib.timeout_add(intervall, self._on_timeout, data) def _on_timeout(self, data): if self._requested_stop: res = False else: res = self._callback(self, data) self._running = res return res def stop(self): self._requested_stop = True def must_stop(self): return self._requested_stop # pango tags: TAG_MAP = { # pango tags, as is 'b': ('', ''), 'i': ('', ''), 's': ('', ''), 'sub': ('', ''), 'sup': ('', ''), 'big': ('', ''), 'small': ('', ''), 'tt': ('', ''), 'u': ('', ''), # blocks 'address': ('', '\n\n'), 'blockquote': ('', '\n\n'), 'div': ('', '\n\n'), 'footer': ('', '\n\n'), 'header': ('', '\n\n'), # 'hr': ('', ''), 'p': ('', '\n\n'), 'pre': ('\n', '\n'), 'h1': ('', '\n\n'), 'h2': ('', '\n\n'), 'h3': ('', '\n\n'), 'h4': ('', '\n\n'), 'h5': ('', '\n\n'), 'h6': ('', '\n\n'), 'td': ('', ''), 'th': ('', ''), 'tr': ('', '\n'), 'dt': ('', ''), 'dd': (' ', '\n'), 'li': ('', '\n'), # inline 'em': ('', ''), 'var': ('', ''), 'kbd': ('', ''), 'code': ('', ''), 'strong': ('', ''), # a 'ins': ('', ''), 'del': ('', ''), 'strike': ('', ''), 'br': ('', '\n'), } class HTMLToPango(HTMLParser): def __init__(self): super().__init__() self.result = [] def a_s(self, tag, attrs): href = attrs.get('href', '') self.result.append(f'') def a_e(self, tag): self.result.append('') def handle_starttag(self, tag, attrs): attrs = dict(attrs) if tag in TAG_MAP: self.result.append(TAG_MAP[tag][0]) return f = getattr(self, f"{tag}_s", None) if f: f(tag, attrs) def handle_endtag(self, tag): if tag in TAG_MAP: self.result.append(TAG_MAP[tag][1]) return f = getattr(self, f"{tag}_e", None) if f: f(tag) def handle_data(self, data): self.result.append(data.strip()) def html2pango(text): parser = HTMLToPango() parser.feed(text) return ''.join(parser.result) confy-0.8.0/src/widgets/000077500000000000000000000000001473600550000150725ustar00rootroot00000000000000confy-0.8.0/src/widgets/__init__.py000066400000000000000000000022731473600550000172070ustar00rootroot00000000000000# widgets/__init__.py # # Copyright 2020-2023 Fabio Comuni, et al. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . from .eventeditdialog import EventEditDialog from .loaderpage import LoaderPage from .searchbaroverlay import SearchBarOverlay from .navbar import Navbar from .starbutton import StarButton from .datepickerrow import DatePickerRow from .inputdialog import InputDialog from .loadingoverlay import LoadingOverlay from .eventactionrow import EventActionRow from .weblinkactionrow import WebLinkActionRow, weblinkactionrowactivated from .author import Author from .togglesidebarbutton import ToggleSidebarButton confy-0.8.0/src/widgets/author.py000066400000000000000000000032311473600550000167450ustar00rootroot00000000000000# widgets/author.py # # Copyright 2020-2024 Fabio Comuni, et al. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . from gi.repository import Gio from gi.repository import Gtk from gi.repository import Gdk from gi.repository import Adw from .. import models from .. import local from ..utils import clean_markup class Author(Gtk.Box): __gtype_name__ = "ConfyAuthor" def __init__(self, person: models.Person): super().__init__(spacing=8) self.person = person name = clean_markup(person.name) self.avatar = avatar = Adw.Avatar.new(24, name, True) self.append(avatar) self.label = label = Gtk.Label(label=name) label.props.halign = Gtk.Align.START self.append(label) print(person.thumbnail) if person.thumbnail: self._f = local.get_image_async(person.thumbnail, self._set_image) def _set_image(self, fetcher, localfile): self._f = None self.avatar.set_custom_image( Gdk.Texture.new_from_file( Gio.File.new_for_path(localfile) ) ) confy-0.8.0/src/widgets/datepickerrow.py000066400000000000000000000054611473600550000203150ustar00rootroot00000000000000# widgets/datepickerrow.py # # Copyright 2020-2023 Fabio Comuni, et al. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . import datetime import re from gi.repository import GLib from gi.repository import GObject from gi.repository import Gtk from gi.repository import Adw class DatePickerRow(Adw.EntryRow): __gtype_name__ = "ConfyDatePickerRow" @GObject.Signal def date_changed(self): ... def __init__(self, **kwargs): self.date = None super().__init__(**kwargs) self.set_selectable(False) self.pop = Gtk.Popover() self.cal = Gtk.Calendar() self.cal.show() self.pop.set_child(self.cal) self.menubutton = Gtk.MenuButton( popover=self.pop, valign=Gtk.Align.CENTER, icon_name="x-office-calendar-symbolic" ) self.menubutton.add_css_class("flat") self.add_suffix(self.menubutton) self.cal.connect("day-selected", self._cal_changed) self.connect("changed", self._entry_changed) self.set_date(None) def get_date(self): return self.date def get_datetime(self): return datetime.datetime.combine(self.date, datetime.time.min) def _set_date(self, date): _date = self.date self.date = date if self.date != _date: self.emit("date_changed") if date is None: lbl = "" gdate = GLib.DateTime.new_now_local() else: lbl = str(date) gdate = GLib.DateTime.new_local(date.year, date.month, date.day, 0, 0, 0) return lbl, gdate def set_date(self, date): lbl, gdate = self._set_date(date) self.cal.select_day(gdate) self.set_text(lbl) def _cal_changed(self, *args): date = self.cal.get_date() date = datetime.date( year=date.get_year(), month=date.get_month(), day=date.get_day_of_month() ) self.set_date(date) def _entry_changed(self, *args): val = self.get_text() if re.match(r'\d\d\d\d-\d\d-\d\d', val): date = datetime.date(*[int(s) for s in val.split("-")]) self._set_date(date) else: self._set_date(None) confy-0.8.0/src/widgets/eventactionrow.py000066400000000000000000000134341473600550000205200ustar00rootroot00000000000000# widgets/eventactionrow.py # # Copyright 2020-2023 Fabio Comuni, et al. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . from typing import Optional import datetime import math from dateutil.tz import UTC from gi.repository import Gio from gi.repository import Gtk from gi.repository import Adw from gi.repository import Graphene from ..utils import clean_markup from ..models import dbUpdateWatcher, Event from .starbutton import StarButton class EventActionRow(Adw.ActionRow): _hid: Optional[int] = None obj: Optional[Event] = None def __init__(self, obj): super().__init__(activatable=True, selectable=False) self.obj = obj self._hid = dbUpdateWatcher.connect('update', self.on_update) self.toggle_btn = StarButton(is_starred=obj.starred) self.toggle_btn.connect("clicked", self.toggle_starred) self.add_suffix(self.toggle_btn) self.on_update() Gio.Application.get_default().connect( "tick", lambda *_: self.queue_draw() ) def __del__(self): if self._hid: dbUpdateWatcher.disconnect(self.hid) def _is_first(self): return self.get_index() == 0 def _is_last(self): p = self.get_parent() if p is None: return True return p.get_last_child() == self def do_snapshot(self, snapshot: Gtk.Snapshot): x = -2 y = -2 w = 10 h = self.get_allocated_height() rect = Graphene.Rect().init(x, y, w, h) cr = snapshot.append_cairo(rect) self._draw(cr, rect) first_child = self.get_first_child() if first_child is not None: self.snapshot_child(first_child, snapshot) def _roundedclippath(self, cr, x, y, w, h, rtop, rbottom): cr.arc(x + rtop, y + rtop, rtop, math.pi, 3 * math.pi / 2) cr.line_to(x + w, y) cr.line_to(x + w, y + h) cr.line_to(x + w, y + h) # cr.arc(x+w-rtop, y+rtop, rtop, 3*math.pi/2, 0) # top-right round corner # cr.arc(x+w-rbottom, y+h-rbottom, rbottom, 0, math.pi/2) # bottom-right cr.arc(x + rbottom, y + h - rbottom, rbottom, math.pi / 2, math.pi) cr.close_path() cr.clip() def _draw(self, cr, rect): """ Draw event progress indicator in widget background. It's a tick line on left border from top whose lenght is relative to the percentage of event time elapsed. We need to handle list round corners. Gtk doesn't clip element like HTML when rendering with "border-radius" value, so our line will overflow the corner. I use the clip path method. It get a top rounded corner if `self` is the first row in the list, and a bottom rounded corner if it's the last. Round radio is defined in code, as I can't find a way to get current widget CSS values. Then a line of required lenght, color and width is drawn from top. Color of the line is widget foreground color with alpha 0.2. Using foreground color make the line work on light and dark theme. """ now = datetime.datetime.now(UTC).replace(tzinfo=None) # now = datetime.datetime(2023, 2, 5, 10, 50, tzinfo=UTC).replace(tzinfo=None) obj = self.obj dur = (obj.end.timestamp() - obj.start.timestamp()) pos = (now.timestamp() - obj.start.timestamp()) if dur > 0: prc = min(max(pos / dur, 0.0), 1.0) else: # not a valid event duration # set prc to 0 if the event is in the future or 1 if in the past prc = int(pos >= 0) if prc == 0: return maxh = rect.get_height() x = rect.get_x() y = rect.get_y() h = maxh * prc w = rect.get_width() # clip at rounded corners rtop = 12 if self._is_first() and self.get_header() is None else 0 rbottom = 12 if self._is_last() else 0 # color # >= gtk 4.10 : self.get_color() color = self.get_style_context().get_color() color.alpha = 0.2 cr.save() # rounded clip path self._roundedclippath(cr, x, y - 1, w, maxh + 2, rtop, rbottom) # draw line cr.set_source_rgba( color.red, color.green, color.blue, color.alpha ) cr.set_line_width(w) cr.move_to(x, y) cr.line_to(x, h) cr.stroke() cr.restore() def on_update(self, *args): obj = self.obj subtitle = "{}-{}".format( obj.start_in_tz().strftime("%a %H:%M"), obj.end_in_tz().strftime("%H:%M")) if obj.room: subtitle = "{} ({})".format( subtitle, obj.room) if obj.track: subtitle = "{} '{}'".format( subtitle, obj.track) ps = list(obj.persons()) if len(ps) > 0: subtitle = "{} - {}".format( subtitle, ", ".join([str(p) for p in ps])) self.set_title(clean_markup(obj.title)) self.set_subtitle(clean_markup(subtitle)) self.toggle_btn.props.is_starred = self.obj.starred def toggle_starred(self, button): self.obj.set_star(not self.obj.starred) confy-0.8.0/src/widgets/eventeditdialog.blp000066400000000000000000000035651473600550000207510ustar00rootroot00000000000000using Gtk 4.0; using Adw 1; template $ConfyEventEditDialog : Adw.Dialog { can-close: true; content-width: 640; content-height: 420; title: _("Edit event"); Adw.ToolbarView { [top] Adw.HeaderBar { show-end-title-buttons: false; [start] Gtk.Button cancel { label: _("Cancel"); clicked => $cancel_event(); visible: bind template.can-cancel; } [end] Gtk.Button save { styles ['suggested-action'] label: _("Save"); sensitive: bind template.can-save; clicked => $save_event(); } } content: Gtk.ScrolledWindow { Adw.Clamp { Gtk.Box { styles ['main-box'] orientation: vertical; Gtk.ListBox { styles ['boxed-list'] Adw.EntryRow entry_url { title: _("URL"); editable: false; changed => $validate_entry_required(); realize => $validate_entry_required(); } Adw.EntryRow entry_title { title: _("Title"); changed => $validate_entry_required(); realize => $validate_entry_required(); } $ConfyDatePickerRow entry_start { title: _("Start"); date_changed => $validate_date_order(); } $ConfyDatePickerRow entry_end { title: _("End"); date_changed => $validate_date_order(); } Adw.EntryRow entry_icon { title: _("Icon URL"); } } Gtk.Separator { styles ["spacer", "vertical"] } Gtk.Button delete { styles ['destructive-action'] label: _("Delete"); clicked => $delete_event(); visible: bind template.can-delete; } } } }; } }confy-0.8.0/src/widgets/eventeditdialog.py000066400000000000000000000106501473600550000206150ustar00rootroot00000000000000# widgets/eventdialog.py # # Copyright 2020-2023 Fabio Comuni, et al. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . from gi.repository import Adw from gi.repository import GObject from gi.repository import Gtk @Gtk.Template(resource_path="/net/kirgroup/confy/widgets/eventeditdialog.ui") class EventEditDialog(Adw.Dialog): __gtype_name__ = "ConfyEventEditDialog" CANCEL = Gtk.ResponseType.CANCEL OK = Gtk.ResponseType.OK DELETE = 1 _can_save = False _can_delete = False _can_cancel = False @GObject.Property(type=bool, default=False) def can_save(self): return self._can_save @can_save.setter def can_save_setter(self, value): self._can_save = value @GObject.Property(type=bool, default=False) def can_delete(self): return self._can_delete @can_delete.setter def can_delete_setter(self, value): self._can_delete = value @GObject.Property(type=bool, default=False) def can_cancel(self): return self._can_cancel @can_cancel.setter def can_cancel_setter(self, value): self._can_cancel = value @GObject.Signal def save(self): pass @GObject.Signal def cancel(self): pass @GObject.Signal def delete(self): pass entry_url = Gtk.Template.Child() # type: ignore entry_title = Gtk.Template.Child() # type: ignore entry_start = Gtk.Template.Child() # type: ignore entry_end = Gtk.Template.Child() # type: ignore entry_icon = Gtk.Template.Child() # type: ignore def __init__(self, parent, conf, **kwargs): self._err = set() self.conf = conf super().__init__(**kwargs) self.setup_ui() def get_conf(self): return self.conf def _do_ok(self): self.conf.url = self.entry_url.get_text() self.conf.title = self.entry_title.get_text() self.conf.start = self.entry_start.get_date() self.conf.end = self.entry_end.get_date() if self.conf.metadata is None: self.conf.metadata = {} if self.entry_icon.get_text() != "": self.conf.metadata['icon'] = self.entry_icon.get_text() elif 'icon' in self.conf.metadata: del self.conf.metadata['icon'] @Gtk.Template.Callback() def save_event(self, entry): self._do_ok() self.emit("save") @Gtk.Template.Callback() def cancel_event(self, entry): self.emit("cancel") @Gtk.Template.Callback() def delete_event(self, entry): self.emit("delete") @Gtk.Template.Callback() def validate_entry_required(self, entry): if len(entry.get_text()) > 0: entry.remove_css_class("error") if entry in self._err: self._err.remove(entry) else: entry.add_css_class("error") self._err.add(entry) self._update_ok() @Gtk.Template.Callback() def validate_date_order(self, entry): if self.entry_start.get_date() is None or self.entry_end.get_date() is None: entry.add_css_class("error") self._err.add(entry) elif self.entry_start.get_date() > self.entry_end.get_date(): entry.add_css_class("error") self._err.add(entry) else: for e in (self.entry_start, self.entry_end): e.remove_css_class("error") if e in self._err: self._err.remove(e) self._update_ok() def _update_ok(self): self.props.can_save = len(self._err) == 0 def setup_ui(self): self.entry_url.set_text(self.conf.url) self.entry_title.set_text(self.conf.title) self.entry_start.set_date(self.conf.start) self.entry_end.set_date(self.conf.end) if self.conf.metadata is not None: self.entry_icon.set_text(self.conf.metadata.get('icon', '')) confy-0.8.0/src/widgets/inputdialog.py000066400000000000000000000031311473600550000177610ustar00rootroot00000000000000# widgets/inputdialog.py # # Copyright 2020-2023 Fabio Comuni, et al. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . from gettext import gettext as _ from gi.repository import Gtk from gi.repository import Adw class InputDialog(Adw.MessageDialog): CANCEL = "cancel" OK = "ok" def __init__(self, parent, **kwargs): super().__init__(transient_for=parent) self.props.heading = _("Add Event from URL") self.props.body = _("Enter URL to event schedule to add it to the list.\nConfy supports events in Pentabarf (.xml) or iCal (.ics) format.") self.add_response(self.CANCEL, _("Cancel")) self.add_response(self.OK, _("Add")) self.set_response_appearance(self.OK, Adw.ResponseAppearance.SUGGESTED) self.set_default_response(self.OK) self.set_close_response(self.CANCEL) self.props.extra_child = Gtk.Entry( activates_default=True, editable=True, ) def get_text(self): return self.props.extra_child.get_text() confy-0.8.0/src/widgets/loaderpage.blp000066400000000000000000000007761473600550000177060ustar00rootroot00000000000000using Gtk 4.0; using Adw 1; template $ConfyLoaderPage : Adw.Bin { vexpand: true; Adw.StatusPage { icon-name: "net.kirgroup.confy"; title: _("Loading..."); vexpand: true; Adw.Clamp { maximum-size: 400; Gtk.Box { orientation: vertical; spacing: 12; Gtk.ProgressBar progressbar {} Gtk.Button cancel_button { label: _("Cancel"); halign: center; clicked => $on_cancel_button_clicked(); } } } } } confy-0.8.0/src/widgets/loaderpage.py000066400000000000000000000032701473600550000175510ustar00rootroot00000000000000# widgets/loaderpage.py # # Copyright 2020-2023 Fabio Comuni, et al. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . from typing import Optional from gi.repository import GLib from gi.repository import Gtk from gi.repository import Adw from ..fetcher import Fetcher @Gtk.Template(resource_path="/net/kirgroup/confy/widgets/loaderpage.ui") class LoaderPage(Adw.Bin): __gtype_name__ = "ConfyLoaderPage" progressbar = Gtk.Template.Child() # type: ignore cancel_button = Gtk.Template.Child() # type: ignore fetcher: Optional[Fetcher] = None def __init__(self): super().__init__() GLib.timeout_add(200, self._do_pulse) @Gtk.Template.Callback() def on_cancel_button_clicked(self, *_): if self.fetcher: self.fetcher.cancel() def set_fetcher(self, fetcher): self.fetcher = fetcher self.progressbar.set_fraction(0) fetcher.bind_property("fraction", self.progressbar, "fraction") def _do_pulse(self, *args): if self.progressbar.get_fraction() > 0: return False self.progressbar.pulse() return True confy-0.8.0/src/widgets/loadingoverlay.py000066400000000000000000000036231473600550000204670ustar00rootroot00000000000000# widgets/loadingoverlay.py # # Copyright 2020-2023 Fabio Comuni, et al. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . from gettext import gettext as _ from gi.repository import Gtk from gi.repository import Adw def LoadingOverlay(cancellable): """ This used to be a Class, but, again, Adw.Toast is final. Is a Toast that cancell the `cancellable` clicking on a button. """ toast = Adw.Toast() toast.set_timeout(0) adw_1_2 = Adw.get_major_version() > 1 or Adw.get_minor_version() > 1 if adw_1_2: # this need libadwaita >=1.2 box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=20) spinner = Gtk.Spinner.new() spinner.start() label = Gtk.Label(label=_("Loading…")) box.append(spinner) box.append(label) toast.set_custom_title(box) else: toast.set_title(_("Loading…")) toast.set_button_label(_("cancel")) cancellable.connect("done", lambda *_: toast.dismiss()) cancellable.connect("error", lambda *_: toast.dismiss()) if adw_1_2: # this need libadwaita 1.2 toast.connect("button-clicked", lambda *_: cancellable.cancel()) else: # for older adw, dismissing the toast will cancell the operation toast.connect("dismissed", lambda *_: cancellable.cancel()) return toast confy-0.8.0/src/widgets/meson.build000066400000000000000000000016121473600550000172340ustar00rootroot00000000000000## blueprint widgets_blueprints_src = [ 'searchbaroverlay.blp', 'eventeditdialog.blp', 'loaderpage.blp', 'starbutton.blp', ] widgets_blueprints_ui = [] foreach b : widgets_blueprints_src widgets_blueprints_ui += b.replace('.blp', '.ui') endforeach widgets_blueprints = custom_target('widget_blueprints', input: widgets_blueprints_src, output: widgets_blueprints_ui, command: [blueprint_compiler, 'batch-compile', '@OUTDIR@', '@CURRENT_SOURCE_DIR@', '@INPUT@'], ) ## /blueprint confy_widgets_sources = [ '__init__.py', 'searchbaroverlay.py', 'eventeditdialog.py', 'navbar.py', 'loaderpage.py', 'starbutton.py', 'datepickerrow.py', 'inputdialog.py', 'loadingoverlay.py', 'eventactionrow.py', 'weblinkactionrow.py', 'author.py', 'togglesidebarbutton.py', ] install_data(confy_widgets_sources, install_dir: moduledir / 'widgets') confy-0.8.0/src/widgets/navbar.py000066400000000000000000000054461473600550000167260ustar00rootroot00000000000000# widgets/navbar.py # # Copyright 2020-2024 Fabio Comuni, et al. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . from dataclasses import dataclass from gi.repository import GObject from gi.repository import Gtk class NavbarListItem(Gtk.ListBoxRow): __gtype_name__ = "ConfyNavbarListItem" def __init__(self, item, **kwargs): super().__init__(**kwargs) self.item = item box = Gtk.Box(spacing=8) icon = Gtk.Image(icon_name=item.icon) label = Gtk.Label(halign=Gtk.Align.START, label=item.label) box.append(icon) box.append(label) self.set_child(box) @dataclass class NavbarItem: name: str = "" icon: str = "" label: str = "" group: int = 0 class Navbar(Gtk.ListBox): __gtype_name__ = "ConfyNavbar" model: list[NavbarItem] = [] _current_item = None # type: ignore @GObject.Signal def page_changed(self): ... def __init__(self, **kwargs): super().__init__(hexpand=True) self.add_css_class("navigation-sidebar") self.connect("row-activated", self._on_nav) def update(self): self.remove_all() found = False for idx, item in enumerate(self.model): widget = NavbarListItem(item) if self._current_item and item == self._current_item: found = True self.select_row(widget) self.append(widget) if not found: self._current_item = self.model[0] self.select_row(self.get_row_at_index(0)) self.emit("page-changed") def _on_nav(self, sender, row): self._current_item = row.item self.emit("page-changed") def get_current_item(self) -> NavbarItem: return self._current_item # type: ignore def set_item_cond(self, item: NavbarItem, cond: bool): """ if cond is true and item not in model, item is appended if cond is false and item is in model, item is removed """ if cond: if item not in self.model: self.model.append(item) self.update() else: if item in self.model: self.model.remove(item) self.update() confy-0.8.0/src/widgets/searchbaroverlay.blp000066400000000000000000000010601473600550000211220ustar00rootroot00000000000000using Gtk 4.0; using Adw 1; template $ConfySearchBarOverlay : Gtk.Box { Gtk.SearchBar bar { hexpand: true; show-close-button: true; Adw.Clamp { Gtk.Box { spacing: 8; Gtk.SearchEntry entry { can-focus: true; hexpand: true; changed => $send_changed(); } Gtk.ToggleButton is_starred { visible: bind template.show_advanced; toggled => $send_changed(); Gtk.Image { icon-name: "starred-symbolic"; } } } } } } confy-0.8.0/src/widgets/searchbaroverlay.py000066400000000000000000000071131473600550000210020ustar00rootroot00000000000000# widgets/searchbaroverlay.py # # Copyright 2020-2023 Fabio Comuni, et al. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . from gi.repository import GObject from gi.repository import Gtk @Gtk.Template(resource_path="/net/kirgroup/confy/widgets/searchbar.ui") class SearchBarOverlay(Gtk.Box): """ Ora, mi piacerebbe sapere perchè cazzo Gtk.SearchBox è final, che chiaramente significa che non è subclassabile, solo che pare che posso farlo (almeno in PyGObject), ma scazza con il template. In pratica me lo costruisce, ma poi sparisce il child. Quindi sono costretto a wrapparlo in un elemento che posso subclassare. Ma dato che Gtk.Widget non ha child, la cosa più veloce è usare un Box. Così adesso il Box deve calcolare la dimensione dell'unico child che ha, la stracazzo di Gtk.SearchBox. E siccome questa doveva essere una subclass di Gtk.SearchBar, mi aspetto che si comporti come una Gtk.SearchBar e quindi sono costretto a riportare le properties e i metodi che uso nel codice. Bella merda. """ __gtype_name__ = "ConfySearchBarOverlay" bar = Gtk.Template.Child() # type: ignore entry = Gtk.Template.Child() # type: ignore is_starred = Gtk.Template.Child() # type: ignore @GObject.Signal(name="changed") def changed(self): ... _search_mode_enabled = False _show_close_button = False _show_advanced = True @GObject.Property(type=bool, default=False) def search_mode_enabled(self): return self._search_mode_enabled @search_mode_enabled.setter def search_mode_enabled_setter(self, value): self._search_mode_enabled = value @GObject.Property(type=bool, default=True) def show_close_button(self): return self._show_close_button @show_close_button.setter def show_close_button_setter(self, value): self._show_close_button = value @GObject.Property(type=bool, default=True) def show_advanced(self): return self._show_advanced @show_advanced.setter def show_advanced_setter(self, value): self._show_advanced = value def __init__(self, **kwargs): super().__init__(**kwargs) self.bind_property('search-mode-enabled', self.bar, 'search-mode-enabled', GObject.BindingFlags.BIDIRECTIONAL) self.bind_property('show-close-button', self.bar, 'show-close-button', GObject.BindingFlags.BIDIRECTIONAL) self.bar.connect('notify::search-mode-enabled', self._on_search_mode_changed) def _on_search_mode_changed(self, *args): if self.bar.get_search_mode(): self.entry.set_text("") self.is_starred.set_active(False) self.entry.grab_focus() def set_search_mode(self, value): self.bar.set_search_mode(value) def is_searching(self): return self.bar.get_search_mode() and (self.entry.get_text() != "" or self.is_starred.get_active()) @Gtk.Template.Callback() def send_changed(self, *_): self.changed.emit() confy-0.8.0/src/widgets/starbutton.blp000066400000000000000000000002551473600550000200000ustar00rootroot00000000000000using Gtk 4.0; template $ConfyStarButton : Gtk.Button { styles ['circular', 'image-button'] valign: center; Gtk.Image { icon-name: bind template.icon-name; } } confy-0.8.0/src/widgets/starbutton.py000066400000000000000000000024741473600550000176600ustar00rootroot00000000000000# widgets/starbutton.py # # Copyright 2020-2023 Fabio Comuni, et al. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . from gi.repository import GObject from gi.repository import Gtk @Gtk.Template(resource_path="/net/kirgroup/confy/widgets/starbutton.ui") class StarButton(Gtk.Button): __gtype_name__ = "ConfyStarButton" _is_starred = False @GObject.Property(type=bool, default=True) def is_starred(self): return self._is_starred @is_starred.setter def is_starred_setter(self, v): self._is_starred = v self.notify("icon-name") @GObject.Property(type=str, default="non-starred-symbolic") def icon_name(self): return "starred-symbolic" if self._is_starred else "non-starred-symbolic" confy-0.8.0/src/widgets/togglesidebarbutton.py000066400000000000000000000026751473600550000215250ustar00rootroot00000000000000# mainwindow.py # # Copyright 2020-2024 Fabio Comuni, et al. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . from gettext import gettext as _ from gi.repository import GObject from gi.repository import Gtk from gi.repository import Adw class ToggleSidebarButton(Gtk.ToggleButton): __gtype_name__ = "ConfyToggleSidebarButton" def __init__(self, **kwargs): super().__init__(**kwargs) self.connect("realize", self._on) def _on(self, *args): # find Adw.OverlaySplitView parent = self while parent.get_parent() is not None: parent = parent.get_parent() if parent.__class__ == Adw.OverlaySplitView: parent.bind_property("collapsed", self, "visible", GObject.BindingFlags.SYNC_CREATE) parent.bind_property("show-sidebar", self, "active", GObject.BindingFlags.BIDIRECTIONAL) confy-0.8.0/src/widgets/weblinkactionrow.py000066400000000000000000000042411473600550000210260ustar00rootroot00000000000000# widgets/weblinkactionrow.py # # Copyright 2020-2025 Fabio Comuni, et al. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . from os import path from urllib.parse import urlparse import html from gi.repository import Gio from gi.repository import Gtk from gi.repository import Adw from ..utils import clean_markup class WebLinkActionRow(Adw.ActionRow): def __init__(self, title, url, icontype=None, **kwargs): opts = dict(activatable=True, selectable=False) opts.update(kwargs) super().__init__(**opts) self.url = url if title is None: title = path.basename(url) self.set_title(clean_markup(html.unescape(title))) self.set_subtitle(url) # if icontype is None: icontype = "text/html" parsedurl = urlparse(url) if parsedurl.path: ftype, _ = Gio.content_type_guess(parsedurl.path) fmaj, fmin = ftype.split("/") if fmaj in ('text', 'video', 'audio', 'image'): icontype = ftype if fmin == 'pdf' or 'document' in fmin: icontype = ftype self.content_type = icontype ficon = Gio.content_type_get_icon(icontype) image = Gtk.Image.new_from_gicon(ficon) image.set_icon_size(Gtk.IconSize.LARGE) self.add_prefix(image) def weblinkactionrowactivated(listbox, actionrow): appinfo = Gio.app_info_get_default_for_type(actionrow.content_type, True) if appinfo is not None: appinfo.launch_uris([actionrow.url], None) else: Gio.app_info_launch_default_for_uri(actionrow.url, None) confy-0.8.0/tools/000077500000000000000000000000001473600550000137755ustar00rootroot00000000000000confy-0.8.0/tools/flatpak-pip-generator000077500000000000000000000432001473600550000201160ustar00rootroot00000000000000#!/usr/bin/env python3 __license__ = 'MIT' import argparse import json import hashlib import os import re import shutil import subprocess import sys import tempfile import urllib.request from collections import OrderedDict from typing import Dict try: import requirements except ImportError: exit('Requirements modules is not installed. Run "pip install requirements-parser"') parser = argparse.ArgumentParser() parser.add_argument('packages', nargs='*') parser.add_argument('--python2', action='store_true', help='Look for a Python 2 package') parser.add_argument('--cleanup', choices=['scripts', 'all'], help='Select what to clean up after build') parser.add_argument('--requirements-file', '-r', help='Specify requirements.txt file') parser.add_argument('--build-only', action='store_const', dest='cleanup', const='all', help='Clean up all files after build') parser.add_argument('--build-isolation', action='store_true', default=False, help=( 'Do not disable build isolation. ' 'Mostly useful on pip that does\'t ' 'support the feature.' )) parser.add_argument('--ignore-installed', type=lambda s: s.split(','), default='', help='Comma-separated list of package names for which pip ' 'should ignore already installed packages. Useful when ' 'the package is installed in the SDK but not in the ' 'runtime.') parser.add_argument('--checker-data', action='store_true', help='Include x-checker-data in output for the "Flatpak External Data Checker"') parser.add_argument('--output', '-o', help='Specify output file name') parser.add_argument('--runtime', help='Specify a flatpak to run pip inside of a sandbox, ensures python version compatibility') parser.add_argument('--yaml', action='store_true', help='Use YAML as output format instead of JSON') parser.add_argument('--ignore-errors', action='store_true', help='Ignore errors when downloading packages') parser.add_argument('--ignore-pkg', nargs='*', help='Ignore a package when generating the manifest. Can only be used with a requirements file') opts = parser.parse_args() if opts.yaml: try: import yaml except ImportError: exit('PyYAML modules is not installed. Run "pip install PyYAML"') def get_pypi_url(name: str, filename: str) -> str: url = 'https://pypi.org/pypi/{}/json'.format(name) print('Extracting download url for', name) with urllib.request.urlopen(url) as response: body = json.loads(response.read().decode('utf-8')) for release in body['releases'].values(): for source in release: if source['filename'] == filename: return source['url'] raise Exception('Failed to extract url from {}'.format(url)) def get_tar_package_url_pypi(name: str, version: str) -> str: url = 'https://pypi.org/pypi/{}/{}/json'.format(name, version) with urllib.request.urlopen(url) as response: body = json.loads(response.read().decode('utf-8')) for ext in ['bz2', 'gz', 'xz', 'zip']: for source in body['urls']: if source['url'].endswith(ext): return source['url'] err = 'Failed to get {}-{} source from {}'.format(name, version, url) raise Exception(err) def get_package_name(filename: str) -> str: if filename.endswith(('bz2', 'gz', 'xz', 'zip')): segments = filename.split('-') if len(segments) == 2: return segments[0] return '-'.join(segments[:len(segments) - 1]) elif filename.endswith('whl'): segments = filename.split('-') if len(segments) == 5: return segments[0] candidate = segments[:len(segments) - 4] # Some packages list the version number twice # e.g. PyQt5-5.15.0-5.15.0-cp35.cp36.cp37.cp38-abi3-manylinux2014_x86_64.whl if candidate[-1] == segments[len(segments) - 4]: return '-'.join(candidate[:-1]) return '-'.join(candidate) else: raise Exception( 'Downloaded filename: {} does not end with bz2, gz, xz, zip, or whl'.format(filename) ) def get_file_version(filename: str) -> str: name = get_package_name(filename) segments = filename.split(name + '-') version = segments[1].split('-')[0] for ext in ['tar.gz', 'whl', 'tar.xz', 'tar.gz', 'tar.bz2', 'zip']: version = version.replace('.' + ext, '') return version def get_file_hash(filename: str) -> str: sha = hashlib.sha256() print('Generating hash for', filename.split('/')[-1]) with open(filename, 'rb') as f: while True: data = f.read(1024 * 1024 * 32) if not data: break sha.update(data) return sha.hexdigest() def download_tar_pypi(url: str, tempdir: str) -> None: with urllib.request.urlopen(url) as response: file_path = os.path.join(tempdir, url.split('/')[-1]) with open(file_path, 'x+b') as tar_file: shutil.copyfileobj(response, tar_file) def parse_continuation_lines(fin): for line in fin: line = line.rstrip('\n') while line.endswith('\\'): try: line = line[:-1] + next(fin).rstrip('\n') except StopIteration: exit('Requirements have a wrong number of line continuation characters "\\"') yield line def fprint(string: str) -> None: separator = '=' * 72 # Same as `flatpak-builder` print(separator) print(string) print(separator) packages = [] if opts.requirements_file: requirements_file_input = os.path.expanduser(opts.requirements_file) try: with open(requirements_file_input, 'r') as req_file: reqs = parse_continuation_lines(req_file) reqs_as_str = '\n'.join([r.split('--hash')[0] for r in reqs]) reqs_list_raw = reqs_as_str.splitlines() py_version_regex = re.compile(r';.*python_version .+$') # Remove when pip-generator can handle python_version reqs_list = [py_version_regex.sub('', p) for p in reqs_list_raw] if opts.ignore_pkg: reqs_new = '\n'.join(i for i in reqs_list if i not in opts.ignore_pkg) else: reqs_new = reqs_as_str packages = list(requirements.parse(reqs_new)) with tempfile.NamedTemporaryFile('w', delete=False, prefix='requirements.') as req_file: req_file.write(reqs_new) requirements_file_output = req_file.name except FileNotFoundError as err: print(err) sys.exit(1) elif opts.packages: packages = list(requirements.parse('\n'.join(opts.packages))) with tempfile.NamedTemporaryFile('w', delete=False, prefix='requirements.') as req_file: req_file.write('\n'.join(opts.packages)) requirements_file_output = req_file.name else: if not len(sys.argv) > 1: exit('Please specifiy either packages or requirements file argument') else: exit('This option can only be used with requirements file') for i in packages: if i["name"].lower().startswith("pyqt"): print("PyQt packages are not supported by flapak-pip-generator") print("However, there is a BaseApp for PyQt available, that you should use") print("Visit https://github.com/flathub/com.riverbankcomputing.PyQt.BaseApp for more information") sys.exit(0) with open(requirements_file_output, 'r') as req_file: use_hash = '--hash=' in req_file.read() python_version = '2' if opts.python2 else '3' if opts.python2: pip_executable = 'pip2' else: pip_executable = 'pip3' if opts.runtime: flatpak_cmd = [ 'flatpak', '--devel', '--share=network', '--filesystem=/tmp', '--command={}'.format(pip_executable), 'run', opts.runtime ] if opts.requirements_file: if os.path.exists(requirements_file_output): prefix = os.path.realpath(requirements_file_output) flag = '--filesystem={}'.format(prefix) flatpak_cmd.insert(1,flag) else: flatpak_cmd = [pip_executable] output_path = '' if opts.output: output_path = os.path.dirname(opts.output) output_package = os.path.basename(opts.output) elif opts.requirements_file: output_package = 'python{}-{}'.format( python_version, os.path.basename(opts.requirements_file).replace('.txt', ''), ) elif len(packages) == 1: output_package = 'python{}-{}'.format( python_version, packages[0].name, ) else: output_package = 'python{}-modules'.format(python_version) if opts.yaml: output_filename = os.path.join(output_path, output_package) + '.yaml' else: output_filename = os.path.join(output_path, output_package) + '.json' modules = [] vcs_modules = [] sources = {} tempdir_prefix = 'pip-generator-{}'.format(output_package) with tempfile.TemporaryDirectory(prefix=tempdir_prefix) as tempdir: pip_download = flatpak_cmd + [ 'download', '--exists-action=i', '--dest', tempdir, '-r', requirements_file_output ] if use_hash: pip_download.append('--require-hashes') fprint('Downloading sources') cmd = ' '.join(pip_download) print('Running: "{}"'.format(cmd)) try: subprocess.run(pip_download, check=True) os.remove(requirements_file_output) except subprocess.CalledProcessError: os.remove(requirements_file_output) print('Failed to download') print('Please fix the module manually in the generated file') if not opts.ignore_errors: print('Ignore the error by passing --ignore-errors') raise try: os.remove(requirements_file_output) except FileNotFoundError: pass fprint('Downloading arch independent packages') for filename in os.listdir(tempdir): if not filename.endswith(('bz2', 'any.whl', 'gz', 'xz', 'zip')): version = get_file_version(filename) name = get_package_name(filename) url = get_tar_package_url_pypi(name, version) print('Deleting', filename) try: os.remove(os.path.join(tempdir, filename)) except FileNotFoundError: pass print('Downloading {}'.format(url)) download_tar_pypi(url, tempdir) files = {get_package_name(f): [] for f in os.listdir(tempdir)} for filename in os.listdir(tempdir): name = get_package_name(filename) files[name].append(filename) # Delete redundant sources, for vcs sources for name in files: if len(files[name]) > 1: zip_source = False for f in files[name]: if f.endswith('.zip'): zip_source = True if zip_source: for f in files[name]: if not f.endswith('.zip'): try: os.remove(os.path.join(tempdir, f)) except FileNotFoundError: pass vcs_packages = { x.name: {'vcs': x.vcs, 'revision': x.revision, 'uri': x.uri} for x in packages if x.vcs } fprint('Obtaining hashes and urls') for filename in os.listdir(tempdir): name = get_package_name(filename) sha256 = get_file_hash(os.path.join(tempdir, filename)) is_pypi = False if name in vcs_packages: uri = vcs_packages[name]['uri'] revision = vcs_packages[name]['revision'] vcs = vcs_packages[name]['vcs'] url = 'https://' + uri.split('://', 1)[1] s = 'commit' if vcs == 'svn': s = 'revision' source = OrderedDict([ ('type', vcs), ('url', url), (s, revision), ]) is_vcs = True else: name = name.casefold() is_pypi = True url = get_pypi_url(name, filename) source = OrderedDict([ ('type', 'file'), ('url', url), ('sha256', sha256)]) if opts.checker_data: source['x-checker-data'] = { 'type': 'pypi', 'name': name} if url.endswith(".whl"): source['x-checker-data']['packagetype'] = 'bdist_wheel' is_vcs = False sources[name] = {'source': source, 'vcs': is_vcs, 'pypi': is_pypi} # Python3 packages that come as part of org.freedesktop.Sdk. system_packages = ['cython', 'easy_install', 'mako', 'markdown', 'meson', 'pip', 'pygments', 'setuptools', 'six', 'wheel'] fprint('Generating dependencies') for package in packages: if package.name is None: print('Warning: skipping invalid requirement specification {} because it is missing a name'.format(package.line), file=sys.stderr) print('Append #egg= to the end of the requirement line to fix', file=sys.stderr) continue elif package.name.casefold() in system_packages: print(f"{package.name} is in system_packages. Skipping.") continue if len(package.extras) > 0: extras = '[' + ','.join(extra for extra in package.extras) + ']' else: extras = '' version_list = [x[0] + x[1] for x in package.specs] version = ','.join(version_list) if package.vcs: revision = '' if package.revision: revision = '@' + package.revision pkg = package.uri + revision + '#egg=' + package.name else: pkg = package.name + extras + version dependencies = [] # Downloads the package again to list dependencies tempdir_prefix = 'pip-generator-{}'.format(package.name) with tempfile.TemporaryDirectory(prefix='{}-{}'.format(tempdir_prefix, package.name)) as tempdir: pip_download = flatpak_cmd + [ 'download', '--exists-action=i', '--dest', tempdir, ] try: print('Generating dependencies for {}'.format(package.name)) subprocess.run(pip_download + [pkg], check=True, stdout=subprocess.DEVNULL) for filename in sorted(os.listdir(tempdir)): dep_name = get_package_name(filename) if dep_name.casefold() in system_packages: continue dependencies.append(dep_name) except subprocess.CalledProcessError: print('Failed to download {}'.format(package.name)) is_vcs = True if package.vcs else False package_sources = [] for dependency in dependencies: casefolded = dependency.casefold() if casefolded in sources and sources[casefolded].get("pypi") is True: source = sources[casefolded] elif dependency in sources and sources[dependency].get("pypi") is False: source = sources[dependency] elif ( casefolded.replace("_", "-") in sources and sources[casefolded.replace("_", "-")].get("pypi") is True ): source = sources[casefolded.replace("_", "-")] elif ( dependency.replace("_", "-") in sources and sources[dependency.replace("_", "-")].get("pypi") is False ): source = sources[dependency.replace("_", "-")] else: continue if not (not source['vcs'] or is_vcs): continue package_sources.append(source['source']) if package.vcs: name_for_pip = '.' else: name_for_pip = pkg module_name = 'python{}-{}'.format(python_version, package.name) pip_command = [ pip_executable, 'install', '--verbose', '--exists-action=i', '--no-index', '--find-links="file://${PWD}"', '--prefix=${FLATPAK_DEST}', '"{}"'.format(name_for_pip) ] if package.name in opts.ignore_installed: pip_command.append('--ignore-installed') if not opts.build_isolation: pip_command.append('--no-build-isolation') module = OrderedDict([ ('name', module_name), ('buildsystem', 'simple'), ('build-commands', [' '.join(pip_command)]), ('sources', package_sources), ]) if opts.cleanup == 'all': module['cleanup'] = ['*'] elif opts.cleanup == 'scripts': module['cleanup'] = ['/bin', '/share/man/man1'] if package.vcs: vcs_modules.append(module) else: modules.append(module) modules = vcs_modules + modules if len(modules) == 1: pypi_module = modules[0] else: pypi_module = { 'name': output_package, 'buildsystem': 'simple', 'build-commands': [], 'modules': modules, } print() with open(output_filename, 'w') as output: if opts.yaml: class OrderedDumper(yaml.Dumper): def increase_indent(self, flow=False, indentless=False): return super(OrderedDumper, self).increase_indent(flow, False) def dict_representer(dumper, data): return dumper.represent_dict(data.items()) OrderedDumper.add_representer(OrderedDict, dict_representer) output.write("# Generated with flatpak-pip-generator " + " ".join(sys.argv[1:]) + "\n") yaml.dump(pypi_module, output, Dumper=OrderedDumper) else: output.write(json.dumps(pypi_module, indent=4)) print('Output saved to {}'.format(output_filename)) confy-0.8.0/tools/flatpak-test000077500000000000000000000007531473600550000163270ustar00rootroot00000000000000#!/bin/bash set -euo pipefail cd "$(dirname "$0")/.." rm -fr flatpak .flatpak-builder flatpak run --command=flatpak-builder-lint org.flatpak.Builder --exceptions manifest net.kirgroup.confy.json flatpak run --command=flatpak-builder-lint org.flatpak.Builder --exceptions appstream data/net.kirgroup.confy.metainfo.xml.in flatpak-builder flatpak/builddir net.kirgroup.confy.json sleep 3 flatpak run --command=flatpak-builder-lint org.flatpak.Builder --exceptions builddir flatpak/builddir confy-0.8.0/tools/makepo.sh000077500000000000000000000002261473600550000156100ustar00rootroot00000000000000#!/bin/bash set -euo pipefail cd "$(dirname "$0")/.." [ ! -d bld ] && meson setup bld ninja -C bld/ confy-pot ninja -C bld/ confy-update-po rm -r bld confy-0.8.0/tox.ini000066400000000000000000000002671473600550000141550ustar00rootroot00000000000000# E402 : Module level import not at top of file # E501 : Line too long [flake8] exclude = .git,work extend-ignore = E402,E501 [pycodestyle] ignore = E402,E501 max-line-length = 160