Feeds

Modernized, streamlined, and fediverse-friendly: OpenSource.org is fully migrated and ready to connect!

Open Source Initiative - Tue, 2024-02-27 03:00

Two years ago, we started migrating our website from Drupal to WordPress. We knew it wasn’t going to be a quick weekend project, but more of a journey. Today, we celebrate the final leg of this journey – merging our blog back into the main site, creating a unified online experience for our community.

Let’s rewind to 2022. Our Drupal site, while trusty, was starting to show its age. It lacked the modern features and it was self hosted, which was taking a huge toll on our team. We knew a change was necessary, but a complete overhaul would have taken too long. So, we decided to move in steps: blog first, main site later.

We first migrated our blog content to a brand new, WordPress-powered platform in early 2023. This gave us a taste of the agility and flexibility WordPress offered. We loved the intuitive interface, the vast plugin ecosystem, and the worry-free managed WordPress provided by DreamHost.

Emboldened by this success, we set our sights on the bigger challenge: migrating the entire website. This wasn’t just about moving content; it was about restructuring, modernizing, and enhancing. We meticulously migrated web pages, ensuring the least amount of URL broke during the transition.

But migration wasn’t just about moving pixels and text. We took this opportunity to modernize our licenses pages. We added missing metadata and made them easily accessible to our users with a dedicated search engine. We also created a Custom Post Type for directors and forms to improve how we handle the nominations for the board elections

Closing the loop with the blog

Now, here we are, at the final stage of our migration journey: merging the blog back into the main site. This completes the circle, creating a unified online experience where our blog seamlessly integrates with the rest of our content – licenses, events, elections, blog and more.

But the most exciting part? We’ve embraced the power of the fediverse! Comments on our blog posts can now be posted and shared across different platforms, fostering a lively and open discussion space. This integration with ActivityPub opens up our content to a wider audience and encourages a more vibrant online community.

Looking back, our Drupal-to-WordPress migration was an odyssey filled with technical hurdles, strategic decisions, and moments of pure satisfaction. We learned, we created a single-sign-on mechanism for OSI members that works on other sites (OpenSource.net and the forum, to start) and ultimately, we emerged with a website that is modern, functional, and better serves our mission. 

Next steps for opensource.org

Next project for us will be a content cleanup and expansion. We will soon start combing through years of content, removing outdated information and streamlining what remained. This decluttering will make space for new content for the website to be more useful, letting visitors learn what Open Source is and how it can help them. We’ll also add more features for OSI members based on the new forum. Explore the new blog, engage with our content, and join the conversation on the fediverse! And if you’re considering a website migration yourself, take heart from our story. With careful planning, the right tools, and the wonderful help of Automattic and the Pressable team, even the most complex migration can be a successful and rewarding journey.

Categories: FLOSS Research

Specbee: How to integrate SSO with Drupal using SAML

Planet Drupal - Tue, 2024-02-27 01:51
Show of hands for anyone thrilled about logging in to every website every single time? Anyone? Didn't think so. When businesses prioritize convenience, customers will follow. Single Sign-On (SSO) is one such convenient feature that leaves your customers feeling satisfied and less stressed. It is a huge time-saver, is more secure (reduces password breach attacks), and increases productivity. In fact, businesses adopting SSO have seen an increase in user adoption rate too. Do you want to learn about how you can integrate SSO with your Drupal website? Keep reading and dive into the details! What is SSO ? Single Sign-On (SSO) is a user authentication service that allows users to use one login credential for all the systems integrated with SSO. Or, if there already is an open session in the main application, just clicking a button will log you in. An example: We can consider Quora as an example, as the forum allows you to create a new account, log in with those credentials, and also use social media logins (Google and Facebook).                          Source: https://www.quora.com/ Types of SSO Protocols Like any other concept, there are many available protocols to achieve this. Some of the common protocols are: Lightweight Directory Access Protocol (LDAP) Kerberos Security Assertion Markup Language (SAML) OAuth 2 OpenID Connect Things to know before we start XML Certificate/Key Generation XML XML (eXtensible Markup Language) is a markup language similar to HTML. It has the ability to store and transport data. Example: <start> <first>Data1</first> <new>NewData</new> </start>Certificate/Key Generation Certificates and private keys play a major role in SAML-based SSO. Since they are used for security reasons, they validate incoming requests. To generate an OpenSSL certificate and private key, run the following command in the terminal: openssl req -x509 -nodes -sha256 -days 3650 -newkey rsa:2048 -keyout private_key.key -out certificate.crtHow it Works In SAML SSO, we consider the application requesting login as a Service Provider (SP), and the application providing authentication information is the Identity Provider (IdP). Flow: When a user tries to log in to SP, the browser sends a request to the SP server. SP will generate a SAML request (which contains SAML data in XML format) and redirect to the configured IdP URL (in SP) for authentication. Then, the IdP will validate the SAML data from the request XML with the pre-configured data of SP(in IdP). Once validated, IdP will generate an XML formatted SAML response to the ACS URL from the SAML request of SP with the current email address (by default which can be overridden) value with other data for validation. Now, SP will validate the data of the SAML response and authenticate the user of the email address in the SAML response.                                                                   Source Here, both the SAML request and SAML Response will be encrypted and will be decrypted in the redirected application (SP/IdP). In most cases, Drupal is used as a service provider, but it can also be enhanced as an identity provider. We can have 3 different types of SAML Request(AuthNRequest): AuthNRequest <samlp:AuthnRequest xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" ID="ONELOGIN_809707f0030a5d00620c9d9df97f627afe9dcc24" Version="2.0" ProviderName="SP test" IssueInstant="2014-07-16T23:52:45Z" Destination="http://idp.example.com/SSOService.php" ProtocolBinding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" AssertionConsumerServiceURL="http://sp.example.com/demo1/index.php?acs"> <saml:Issuer>http://sp.example.com/demo1/metadata.php</saml:Issuer> <samlp:NameIDPolicy Format="urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress" AllowCreate="true"/> <samlp:RequestedAuthnContext Comparison="exact"> <saml:AuthnContextClassRef>urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport</saml:AuthnContextClassRef> </samlp:RequestedAuthnContext> </samlp:AuthnRequest> With Signature (HTTP-Redirect binding) bM441nuRIzAjKeMM8RhegMFjZ4L4xPBHhAfHYqgnYDQnSxC++Qn5IocWuzuBGz7JQmT9C57nxjxgbFIatiqUCQN17aYrLn/mWE09C5mJMYlcV68ibEkbR/JKUQ+2u/N+mSD4/C/QvFvuB6BcJaXaz0h7NwGhHROUte6MoGJKMPE= AuthNRequest with embedded signature (HTTP-POST binding) <samlp:AuthnRequest xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" ID="pfx41d8ef22-e612-8c50-9960-1b16f15741b3" Version="2.0" ProviderName="SP test" IssueInstant="2014-07-16T23:52:45Z" Destination="http://idp.example.com/SSOService.php" ProtocolBinding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" AssertionConsumerServiceURL="http://sp.example.com/demo1/index.php?acs"> <saml:Issuer>http://sp.example.com/demo1/metadata.php</saml:Issuer> <ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#"> <ds:SignedInfo> <ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/> <ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/> <ds:Reference URI="#pfx41d8ef22-e612-8c50-9960-1b16f15741b3"> <ds:Transforms> <ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/> <ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/> </ds:Transforms> <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/> <ds:DigestValue>yJN6cXUwQxTmMEsPesBP2NkqYFI=</ds:DigestValue> </ds:Reference> </ds:SignedInfo> <ds:SignatureValue>g5eM9yPnKsmmE/Kh2qS7nfK8HoF6yHrAdNQxh70kh8pRI4KaNbYNOL9sF8F57Yd+jO6iNga8nnbwhbATKGXIZOJJSugXGAMRyZsj/rqngwTJk5KmujbqouR1SLFsbo7Iuwze933EgefBbAE4JRI7V2aD9YgmB3socPqAi2Qf97E=</ds:SignatureValue> <ds:KeyInfo> <ds:X509Data> <ds:X509Certificate>MIICajCCAdOgAwIBAgIBADANBgkqhkiG9w0BAQQFADBSMQswCQYDVQQGEwJ1czETMBEGA1UECAwKQ2FsaWZvcm5pYTEVMBMGA1UECgwMT25lbG9naW4gSW5jMRcwFQYDVQQDDA5zcC5leGFtcGxlLmNvbTAeFw0xNDA3MTcwMDI5MjdaFw0xNTA3MTcwMDI5MjdaMFIxCzAJBgNVBAYTAnVzMRMwEQYDVQQIDApDYWxpZm9ybmlhMRUwEwYDVQQKDAxPbmVsb2dpbiBJbmMxFzAVBgNVBAMMDnNwLmV4YW1wbGUuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC7vU/6R/OBA6BKsZH4L2bIQ2cqBO7/aMfPjUPJPSn59d/f0aRqSC58YYrPuQODydUABiCknOn9yV0fEYm4bNvfjroTEd8bDlqo5oAXAUAI8XHPppJNz7pxbhZW0u35q45PJzGM9nCv9bglDQYJLby1ZUdHsSiDIpMbGgf/ZrxqawIDAQABo1AwTjAdBgNVHQ4EFgQU3s2NEpYx7wH6bq7xJFKa46jBDf4wHwYDVR0jBBgwFoAU3s2NEpYx7wH6bq7xJFKa46jBDf4wDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQQFAAOBgQCPsNO2FG+zmk5miXEswAs30E14rBJpe/64FBpM1rPzOleexvMgZlr0/smF3P5TWb7H8Fy5kEiByxMjaQmml/nQx6qgVVzdhaTANpIE1ywEzVJlhdvw4hmRuEKYqTaFMLez0sRL79LUeDxPWw7Mj9FkpRYT+kAGiFomHop1nErV6Q==</ds:X509Certificate> </ds:X509Data> </ds:KeyInfo> </ds:Signature> <samlp:NameIDPolicy Format="urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress" AllowCreate="true"/> <samlp:RequestedAuthnContext Comparison="exact"> <saml:AuthnContextClassRef>urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport</saml:AuthnContextClassRef> </samlp:RequestedAuthnContext> </samlp:AuthnRequest>Reference: https://www.samltool.com/generic_sso_req.php We can have different types of SAML Response: SAML Response <samlp:Response xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" ID="_8e8dc5f69a98cc4c1ff3427e5ce34606fd672f91e6" Version="2.0" IssueInstant="2014-07-17T01:01:48Z" Destination="http://sp.example.com/demo1/index.php?acs" InResponseTo="ONELOGIN_4fee3b046395c4e751011e97f8900b5273d56685"> <saml:Issuer>http://idp.example.com/metadata.php</saml:Issuer> <samlp:Status> <samlp:StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:Success"/> </samlp:Status> <saml:Assertion xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" ID="_d71a3a8e9fcc45c9e9d248ef7049393fc8f04e5f75" Version="2.0" IssueInstant="2014-07-17T01:01:48Z"> <saml:Issuer>http://idp.example.com/metadata.php</saml:Issuer> <saml:Subject> <saml:NameID SPNameQualifier="http://sp.example.com/demo1/metadata.php" Format="urn:oasis:names:tc:SAML:2.0:nameid-format:transient">_ce3d2948b4cf20146dee0a0b3dd6f69b6cf86f62d7</saml:NameID> <saml:SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:cm:bearer"> <saml:SubjectConfirmationData NotOnOrAfter="2024-01-18T06:21:48Z" Recipient="http://sp.example.com/demo1/index.php?acs" InResponseTo="ONELOGIN_4fee3b046395c4e751011e97f8900b5273d56685"/> </saml:SubjectConfirmation> </saml:Subject> <saml:Conditions NotBefore="2014-07-17T01:01:18Z" NotOnOrAfter="2024-01-18T06:21:48Z"> <saml:AudienceRestriction> <saml:Audience>http://sp.example.com/demo1/metadata.php</saml:Audience> </saml:AudienceRestriction> </saml:Conditions> <saml:AuthnStatement AuthnInstant="2014-07-17T01:01:48Z" SessionNotOnOrAfter="2024-07-17T09:01:48Z" SessionIndex="_be9967abd904ddcae3c0eb4189adbe3f71e327cf93"> <saml:AuthnContext> <saml:AuthnContextClassRef>urn:oasis:names:tc:SAML:2.0:ac:classes:Password</saml:AuthnContextClassRef> </saml:AuthnContext> </saml:AuthnStatement> <saml:AttributeStatement> <saml:Attribute Name="uid" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic"> <saml:AttributeValue xsi:type="xs:string">test</saml:AttributeValue> </saml:Attribute> <saml:Attribute Name="mail" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic"> <saml:AttributeValue xsi:type="xs:string">test@example.com</saml:AttributeValue> </saml:Attribute> <saml:Attribute Name="eduPersonAffiliation" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic"> <saml:AttributeValue xsi:type="xs:string">users</saml:AttributeValue> <saml:AttributeValue xsi:type="xs:string">examplerole1</saml:AttributeValue> </saml:Attribute> </saml:AttributeStatement> </saml:Assertion> </samlp:Response>The rest of the types can be referred in https://www.samltool.com/generic_sso_res.php. The request and response can be sent as both GET and POST methods. Available Modules for SSO In Drupal, we have a list of modules for Service Provider and Identity Provider. Here are some of the SP and IdP modules: SP Modules: SAML Service Provider SAML Authentication Onelogin Integration miniOrange SAML SP(Paid Version)  IdP Modules: Light SAML IDP SAML IdP miniOrange SAML IDP (Paid Version) Testing Tools: Even though the data is encrypted, we can debug the SAML request with the help of the following tools. SAML Tracer for Mozilla Firefox. SAML Chrome Panel for Google Chrome. How to integrate SSO in Drupal using SAML Configure SSO module in SP Here we have used the saml_sp module for gearing up Drupal as a Service Provider. Configure SP module Settings Create the certificate and private_key and place them in a Drupal-readable location. Install the module.composer require 'drupal/saml_sp:^4.2' Enable the module in the Extend section.  Go to the configuration of the module (/admin/config/people/saml_sp). Configure the SP settings Provide the entityID if you want to override the default https://sp.lndo.site/user. Here https://sp.lndo.site is the domain. Provide an assertion URL similar to https://sp.lndo.site/saml/consume. Provide other mandatory details. Make sure that if you are using Sign specify the correct algorithm and select the Assertion and Encryption type based on requirement(based on the requirement of IdP). Provide the certificate and private key file path.Based on the data provided, Metadata will be generated. This XML metadata will be used for configuring the SP data in IdP. Configure Identity Providers in SP 1. Under Identity Providers click on Add Service Provider.2. Add the data from the metadata file/url provided by IdP. In SAML SP we can use the Drupal Login module once the above are configured. Under the Login Menu, configure the process of SAML login. For example, if a user without an account in SP but with an account in IdP creates an account in SP with an authenticated role. Configure SSO module in IdP Here we have used the light_saml_idp module for gearing up Drupal as an Identity Provider. Configure IdP module Settings: 1. Create the certificate and private_key and place it in a Drupal readable location.2. Install the module.3. Enable the module in the Extend section. 4. Go to the configuration (/admin/config/people/light_saml_idp) Provide the entity_id. Provide the other necessary details. Make sure to provide the correct file path of the certificate and private_key. Once the data is provided metadata will be generated under the Metadata tab. This needs to be provided to SP to configure there. Add the Service Provider under the Service Provider, with the data from SP metadata. The SSO will work properly once these are configured successfully. Hurray! SSO is integrated successfully. If you are not able to use the SSO, use testing tools to verify what is causing the issue. Final Thoughts You just learned how to seamlessly integrate SSO with Drupal using SAML for a stress-free user experience! Considering the protocols, certificates, and complex SAML login flow we've explored, SSO plays a significant role in simplifying user authentication. For a seamless SSO journey and Drupal development expertise, look no further than Specbee - your trusted partner in crafting exceptional digital experiences.  
Categories: FLOSS Project Planets

Python⇒Speed: Jevons Paradox doesn't always apply to software

Planet Python - Mon, 2024-02-26 19:00

When it comes to fighting climate change, I strongly believe that getting involved in politics is one of the most useful things you can do. But given how energy-intensive software is these days, writing more efficient software also seems worth doing, especially if your software is used at scale.

However, whenever efficiency is brought up, Jevons Paradox rears its head. Writing in the 19th century, Jevons pointed out that increased efficiency in the use of coal didn’t decrease the amount of coal used, it actually increased it. As it became more cost-effective and more useful, coal ended up being used in far more places.

So what about software: will faster software result in more usage, completely undoing the energy-consumption benefits of efficiency?

Read more...
Categories: FLOSS Project Planets

PyCharm: PyCharm 2023.3.4: AI Assistant’s Efficiency Boosters and a more powerful Django Structure tool window

Planet Python - Mon, 2024-02-26 16:10

This year, we are trying out a new approach with our releases, moving away from a quarterly schedule to more regular monthly feature-rich releases. This change is intended to deliver new features more rapidly and streamline the feedback process.

Upgrade to PyCharm 2023.3.4

New AI Assistant functionality [PyCharm Professional]

Get work done faster with new AI Assistant actions. Generate Python type annotations for functions and get Django views, admins, and serializers for models. Obtain a quick analysis of the data inside your DataFrame and convert Jupyter notebooks to scripts. Do all of this with just a click!

The Django Structure tool window [PyCharm Professional]

Navigate through your Django projects faster with the new features of the Django Structure tool window. Access settings.py or identify and register unregistered admins directly in the tool window.

Quick Documentation for type parameter declarations in the new syntax

If you have already adopted the new syntax for type parameter declarations introduced in PEP 695, this feature will definitely make your life easier. The Quick Documentation popup clearly explains the type parameters and type aliases used in your code.

These are the most notable updates featured in the PyCharm 2023.3.4 release. For a detailed overview of all the changes, we recommend reviewing the release notes.

Learn more about PyCharm 2023.3.4

Your feedback is invaluable to us as we work to improve PyCharm. We encourage you to share your thoughts and suggestions on the latest features and updates. Connect with us on X (formerly Twitter) or drop a comment below to let us know what you think. If you come across any bugs while working with the IDE, please report them to our issue tracker.

Categories: FLOSS Project Planets

FOSDEM 2024: two days on software freedom

FSF Blogs - Mon, 2024-02-26 15:35
We depend on software as a society. In such a world, software freedom has to be protected. Free Software Foundation's (FSF) Licensing and Compliance Manager, Krzysztof Siewicz is sharing his personal account of FOSDEM 2024.
Categories: FLOSS Project Planets

FSF Blogs: FOSDEM 2024: two days on software freedom

GNU Planet! - Mon, 2024-02-26 15:35
We depend on software as a society. In such a world, software freedom has to be protected. Free Software Foundation's (FSF) Licensing and Compliance Manager, Krzysztof Siewicz is sharing his personal account of FOSDEM 2024.
Categories: FLOSS Project Planets

Adnan Hodzic: App architecture with reliability in mind: From Kubernetes to Serverless with GCP Cloud Build & Cloud Run

Planet Debian - Mon, 2024-02-26 15:00

The blog post you’re reading is hosted on a private Kubernetes cluster that runs inside my home. Another workload that’s running on same cluster is...

The post App architecture with reliability in mind: From Kubernetes to Serverless with GCP Cloud Build & Cloud Run appeared first on FoolControl: Phear the penguin.

Categories: FLOSS Project Planets

Talking Drupal: Talking Drupal #439 - Drupal 7 Long-Term Support

Planet Drupal - Mon, 2024-02-26 14:00

Today we are talking about Drupal 7 Long Term Support, common security tips, and support services you can use with guests Greg Knaddison, Aaron Frost, and Dave Welch . We’ll also cover Storybook as our module of the week.

For show notes visit: www.talkingDrupal.com/439

Topics
  • Drupal 7 EoL
  • Drupal will not stop working
  • Security team perspective
  • Security concerns
  • Extened Community Support
  • Long Term support
  • HeroDevs
  • Never ending support (NES)
    • PHP
    • Hosting
    • Security
    • Contrib
  • Product advisor
  • Colorado Digital Service
Resources Guests

Greg Knaddison - morrisanimalfoundation.org greggles Aaron Frost - herodevs.com aaronfrost Dave Welch - herodevs.com dwelch2344

Hosts

Nic Laflin - nLighteneddevelopment.com nicxvan John Picozzi - epam.com johnpicozzi Ivan Stegic - ten7.com ivanstegic

MOTW Correspondent

Mark Casias - markie

  • Module name/project name:
  • Brief description:
    • The storybook module makes it easier to create a connection between Drupal and Storybook. It adds some Twig functionality so you can write Stories in Twig as opposed to YML or JSON or React
  • Brief history
    • How old: Less than a year
    • Versions available: Alpha4 came out earlier this month
  • Maintainership
    • Actively maintained: Yes
    • Number of open issues: 6
    • Test coverage: no
  • Usage stats:
    • N/A: for development only
    • Maintainer(s):
    • Mateu Aguiló Bosch (e0ipso) from Lullabot.
    • Module features and usage
    • Twig based stories
    • Pulls in Sites theme and base css.
    • So needs some updates to the development.services.yml
    • Also means it is hard to publish a storybook.
    • No need for SDC (but works well with it)
    • Great instructions on the module page
    • Way easier than previous integrations including cl_server.
    • Not as opinionated as previous storybook integrations.
Categories: FLOSS Project Planets

The Drop Times: Which CMS? Global City Website Trends Examined

Planet Drupal - Mon, 2024-02-26 13:04
Explore the trends of Content Management System (CMS) usage on official city websites with a comprehensive study spanning 466 cities worldwide. The research delves into the prevalence of open-source solutions, highlighting the dominance of WordPress, Drupal, and other platforms. The report categorizes findings based on city size, region, and EU membership, revealing intriguing patterns and insights. The study raises essential questions about the adoption of open-source systems in the public sector, shedding light on challenges and opportunities for promoting transparency and cost-efficiency in digital governance. Dive into the detailed analysis to understand the global dynamics of CMS choices in city administrations.
Categories: FLOSS Project Planets

The Drop Times: Innovation: The Lifeblood of Progress!

Planet Drupal - Mon, 2024-02-26 13:04

Dear Readers,

Innovation is the lifeblood of progress. It represents the pursuit of better solutions, the breaking of traditional boundaries, and products that challenge the status quo and push the boundaries of what is possible. True innovation involves a continuous cycle of exploration, experimentation, and adaptation, driven by a deep desire to solve complex problems and improve human experiences. It's about seeing beyond the current limitations and envisioning what could be, transforming bold visions into tangible solutions that can significantly advance how we live, work, and interact.

As a powerful tool for creating and maintaining dynamic web applications and the most sought-after enterprise-level CMS, Drupal stands as a testament to the power of innovation. As an open-source platform, Drupal thrives on its global community's collective creativity and technical prowess. Through Drupal, innovation is not just an individual pursuit but a shared journey, propelling the platform and its users toward new frontiers of digital possibility.`

Drupal means innovation, and the Drupal Association has introduced an Innovation Hub, a dedicated space to foster collaboration and advance innovation within the Drupal community. Headed by Alex Moreno, the initiative has devised a set of strategic goals for Drupal and its community for 2023-2025. With a focus on inspiration, collaboration, and driving Drupal forward, the Innovation Hub aims to shape the future of digital experiences and strengthen Drupal's vibrant ecosystem.

With that, welcome to the last week's most important content covered by The DropTimes.

Today marks the final day of Florida DrupalCamp 2024, and as media sponsors, The DropTimes came up with two interviews in the last week featuring two of the three featured speakers of FLDC 2024. I had the opportunity to interact with Matthew Ramir, who defied the limits posed by Cerebral Palsy and navigated the realms of Drupal. Read the full interview here.

Aubrey Sambor, the Lead Engineer at Lullabot and the featured speaker at FLDC 2024 in an interview with Kazima Abbas, sub-editor of The DropTimes, shares her experiences and expertise, offering a glimpse into the evolving world of web development and Drupal community contributions.

We have published a selection of essential modules that empower you to build a captivating online brand and turn your product features into compelling narratives with the help of Safallia Joseph, AcroCommerce. If you're crafting an e-commerce experience where storytelling and customer connection come first, Drupal with Drupal Commerce is your solution. If you've created or worked on a successful Drupal Commerce website, share your insights with us at editor@thedroptimes.com. This collaborative exchange will inspire and empower businesses to achieve extraordinary e-commerce results with Drupal and feature you in The DropTimes.

The Pantheon Autopilot Toolbar module addresses navigation deficiencies within Pantheon's Dashboard UI, enabling efficient access to Autopilot. Kevin Reynen, the Principal Web Applications Developer at the University of Colorado, discusses the module's creation and significance in this feature. Also, understand Pantheon's response to the issue. 

Mike Gifford shares his first-hand insights from FOSDEM'24, the eminent open-source conference, shedding light on the significant discussions around open-source solutions in government, digital public goods, and the evolving role of open-source in societal advancement. Read the full article here. The Drupal Delhi Meetup, organized by Anushri Kumari, Megha Sharma, and Libbna Mathew, marked great promise for Drupal devotees. Kazima Abbas connected with the organizers to learn more about the event.

In other news, DrupalCamp Rennes revealed its lineup of keynote speakers and conference topics, and early bird registration is now open for DrupalCon Portland 2024. Tickets are also available for Midcamp 2024, and the Drupal MountainCamp schedule is out

Drupal.org has made a significant announcement revealing that Drupal 11 is now open for development, while Drupal 10.3.x has been branched. A security advisory has been issued for the Node Access Rebuild Progressive module, identifying an access bypass vulnerability in versions prior to 2.0.2. Additionally, Neil Drumm has announced a streamlined process for accepting the Git Terms of Service within the Drupal community by transitioning the acceptance procedure to their GitLab instance.

We acknowledge that there are more stories to share. However, due to constraints in selection, we must pause further exploration for now.

To get timely updates, follow us on LinkedIn, Twitter and Facebook. Also, join us on Drupal Slack at #thedroptimes.

Thank you,

Sincerely
Alka Elizabeth
Sub-editor, TheDropTimes.

Categories: FLOSS Project Planets

FSF Events: Free Software Directory meeting on IRC: Friday, March 01, starting at 12:00 EST (17:00 UTC)

GNU Planet! - Mon, 2024-02-26 12:58
Join the FSF and friends on Friday, March 01, from 12:00 to 15:00 EST (17:00 to 20:00 UTC) to help improve the Free Software Directory.
Categories: FLOSS Project Planets

Chapter Three: Next-Drupal 2.0: Making a Good Thing Even Better

Planet Drupal - Mon, 2024-02-26 12:27
Remember Next-Drupal? It’s that thing we used to talk about incessantly but have been fairly quiet about in recent months. Not to worry – we haven’t lost interest. In fact, we’ve been working hard to make our Next.js-powered decoupled Drupal front-end product even better in Next-Drupal 2.0! For those of you who are not yet familiar, here is a good introduction to Next-Drupal. For those already acquainted, please read on. Making a Fast Front-End Even Faster The primary reason for the new release is that Next.js has recently released a new feature called App Router. App Router is a new model for building applications in React that allows users to render some React components on the server side, as opposed to on the user side only.
Categories: FLOSS Project Planets

ComputerMinds.co.uk: Aegir 3 and Drupal 10: just about working

Planet Drupal - Mon, 2024-02-26 12:00

In my previous article I outlined that I really needed to get Drupal 10 sites running in Aegir 3. I had no time to wait around for other solutions, and I was going to try to decouple Aegir from running Drupal sites, so that it wouldn't be tied to Drupal versions.

Since writing that article and actually sitting down to do this work, I realised that it's quite an undertaking, and the approach outlined by Omega8cc in various github issues was worth a second look.

It works!

But it's wild. It comprises three main things:

  1. A custom/forked version of Drush 8.
  2. A custom/forked version of Provision 3.
  3. A custom/forked version of Drupal 10.
  4. (A sneaky fourth is that you absolutely do not want to have site-local Drush)

So...yeah...it's not going to be for the faint-hearted, but I'm going to detail out those three things a little, and how you might want to apply them to your situation.

Custom Drush 8

So the official Drush 8 doesn't support Drupal 10. But, it's actually not that much work to get this up and running, since Drush has pluggable 'engines' that load code based on the Drupal version that's detected when running commands.

Omega8cc has done a great job of doing the leg-work and providing a forked version of Drush, you can see the changes that have been made to support Drupal 10 here:
 

https://github.com/omega8cc/drush/compare/8.4.12...8-boa-micro

Although note, that there are some Aegir specific and non Drush 10 supporting changes in there too, so what I did was to make my own (private) fork of Drush and go through and apply the relevant changes to the files. If you don't know what the relevant changes are, then you probably are better off simply replacing your Drush with the Omega8cc fork, and it'll probably be fine.

Essentially this step is needed so that Drush sees the Drupal 10 codebase, and can interact with it correctly. It's likely that in Drupal 10's lifetime something will change, and Drush 8 will need some more work to be compatible with 10.3 and 10.4 etc.

If you were to run Drush 8 commands at this point, they'd start to bootstrap the site, but would fail with fatal errors. You need changes in Drupal 10 core too...

Custom Provision 3

Provision also makes use of Drush engines to load the correct code for the correct situation, so that if you ask Aegir to install a new site on a platform it'll load up the correct bit of code for the relevant Drupal version.

Again Omega8cc has done all the hard work here and provided the changes you need, but they are a bit harder to pick out of the repo. Try searching for files that contain '_10':

https://github.com/omega8cc/provision

And that should get you the files you need. I will note that unlike the Drush fork above, this really is a heavy fork. You are getting a lot more besides Drupal 10 support, if you can, I'd go for patching this into your existing Provision codebase.

I could add these to official provision 3 on Drupal.org, but without the other pieces they are useless and won't help you. Aegir 3 is essentially unmaintained, so while I've committed some PHP 8 fixes in the last few weeks, I'm not going to commit huge things like this.
I suppose we could have some code maintained in an issue fork or a patch.

This step is need so that Provision will call the correct bits of code at the right time, as far as I can see, these are largely the same as Drupal 9 versions of the engines.

Custom Drupal 10

Now for the big compromise.

The main problem here is that Drupal 10 uses Symfony 6, which has type hints on various interfaces and methods, and Drush 8 uses Symfony 2, which does not.

So, if you load one before the other, then as soon as PHP tries to load the second, it'll die because either the types are there, or they aren't.

This is a bit of a showstopper and there's no decent way to get it to work nicely. Instead, Omega8cc has discovered some band-aids you can slap on and while it'll work, it's brittle!

Omega8cc's fork of Provision automatically tries to apply some of these patches to Drupal 10 platforms, and gives you a nice way to add/remove them. But again, also has a lot of other opinionated changes (to provision), so if you want to know what to do to Drupal 10 core...keep reading:

We need to:

  1. Remove a bunch of typehints from Drupal core's logging mechanisms.
  2. Downgrade psr/log
  3. Patch symfony/console

 

Removing the typehints

Omega8cc have got a nice patch that does this:

https://raw.githubusercontent.com/omega8cc/boa/5.x-dev/aegir/patches/drupal-ten-aegir-01.patch

And you can apply that using composer patches if you want.

Note that if you have any classes that extend these patched classes, they'll need patching too, so if you have any custom or contrib loggers, you'll need to go sort those out.

Downgrading psr/log

Composer makes this one super easy:

composer require 'psr/log:1.1.4 as 3.0.0'

Will do what you want. It's the companion to the first step, those classes implement these interfaces, so they need to get downgraded too. This might need to get adjusted if Drupal 10 core requires psr/log 3.1.0 or something like that, but the principles should still work.

If your Drupal 10 codebase isn't managed by Composer...well...getta out here and get that sorted first.

Patching symfony/console

Drush 8 only uses part of this package, so we can get away with patching just a tiny bit of it. Essentially you want to remove the 'Input' directory within the package. If you have a build system you could delete the files as part of your build process. Omega8cc's approach is to make the directory essentially unreadable.

Either way the result is that when PHP tries to load some code that uses version 6 of Symfony\console\Input it'll fail to find the code in Drupal core, and instead fallback to the version that came with Drush 8. Luckily this code isn't used by Drupal core, but you'll need to check that your custom and contrib code doesn't use it either, or handles the case when it magically loads code from Symfony 2.

For me and my codebase this was fine. None of our custom or contrib code used the classes or interfaces, so all good.

That's it

For Drupal 10 support in Aegir, that should be it. You can run Aegir 3 in PHP 8.1 and Drupal 7 and Drupal 10 on the same box. Magic.

Make sure you don't have a site-local Drush in your composer require, otherwise, Drush 8 being the great tool that it is will find it, and pass execution over to it, but it's not the same Drush that Aegir has all it's claws/hooks in, so things will go badly quite quickly.

Gotchas

Probably many, we've not actually rolled this out into our production environment yet, but we're close.

The main thing I can think of is that Drupal 10 contrib modules are very much going to assume that there's a modern version of Drush running commands, and not Drush 8, so it's likely that they aren't going to provide Drush 8 commands. You might need to write your own shims that copy/paste large lumps of code, or call through the new style Drush commandfiles, but that means that Drush command hooks won't be working quite right etc.

So yeah, danger if you're doing anything interesting using Drush commands on your sites.

Oh, and I guess it's possible that this will all break hard in the Drupal 10 lifecycle. I mean, it probably won't because it'll always be a foundation of Symfony 6, but you never know, the Drop is always moving and all that.

Thanks to Omega8cc

This was all shown to be possible, and documented in code by the great team at Omega8cc, so thanks very much for the work they are doing. I have nothing against there heavy forks of Aegir, they just aren't for me, hence why I've tried to pull out just the bits you need into this post.

Future

I still think that Aegir 3 could be decoupled from hosting Drupal sites. So that it was hosting 'sites' and then one could have some well-defined way to interact with those sites via some command line tool depending on what they were. However, that's a big effort, and Aegir 3 is essentially unmaintained now, so that's not going to happen. 

A number of others in the #aegir Drupal.org Slack channel have mentioned other alternatives, such as Aegir 5, or getting Drush 12 running Provision commands and running everything with Drush 12 instead of Drush 8, or using some other tool as the outer runner.
I think they are all going to run into the same issues/have to deal with the same thing: abstracting the notion of the 'site'. Provision 3 takes a number of shortcuts to make it really easy to pass data around between itself and the site, and those shortcuts simply aren't possible in Modern Drupal.

However, in case there's someone out there with a big ol' budget, and a desire to keep Aegir 3 going, I think the 'decoupled' Aegir would look something like:

  • A provision where the places that it calls through to functions executed in the Drupal context abstracted out into some kind of site specific 'plugin'. Instead of trying to use the nice Drush functions for calling a 'inner' Drush command, instead the usual command line interface would be used and data simply encoded on stdin/stdout/stderr in a format not tightly coupled to Drush 8 or Drush 12/13 etc.
  • Provision calls into the Drupal site a lot and because it's never needed to be explicit about doing it, it's sometimes hard to spot where this is happening.
  • Some kind of shim package that can be composer required into sites hosted on Aegir that would provide some way for the Provision plugins to call into the Drupal site and get the response it needs. Maybe this would merely provide some Drush commands.

Good luck if anyone ever embarks on such a project! Or contact us if you want a shoulder to cry on to hire us for a project!

Categories: FLOSS Project Planets

Real Python: Duck Typing in Python: Writing Flexible and Decoupled Code

Planet Python - Mon, 2024-02-26 09:00

Python makes extensive use of a type system known as duck typing. The system is based on objects’ behaviors and interfaces. Many built-in classes and tools support this type system, which makes them pretty flexible and decoupled.

Duck typing is a core concept in Python. Learning about the topic will help you understand how the language works and, more importantly, how to use this approach in your own code.

In this tutorial, you’ll learn:

  • What duck typing is and what its pros and cons are
  • How Python’s classes and tools take advantage of duck typing
  • How special methods and protocols support duck typing
  • What alternatives to duck typing you’ll have in Python

To get the most out of this tutorial, you should be familiar with several Python concepts, including object-oriented programming, classes, special methods, inheritance, and interfaces.

Get Your Code: Click here to download the free sample code that shows you how to use duck typing in Python.

Getting to Know Duck Typing in Python

In object-oriented programming, classes mainly aim to encapsulate data and behaviors. Following this idea, you can replace any object with another if the replacement provides the same behaviors. This is true even if the implementation of the underlying behavior is radically different.

The code that uses the behaviors will work no matter what object provides it. This principle is the basis of a type system known as duck typing.

Duck Typing: Behaving Like a Duck

You’ll find many different definitions of duck typing out there. At its core, this coding style is based on a well-known saying:

If it walks like a duck and it quacks like a duck, then it must be a duck.

Extrapolating this to programming, you can have objects that quack like a duck and walk like a duck rather than asking whether those objects are ducks. In this context, quack and walk represent specific behaviors, which are part of the objects’ public interface (API).

Duck typing is a type system where an object is considered compatible with a given type if it has all the methods and attributes that the type requires. This type system supports the ability to use objects of independent and decoupled classes in a specific context as long as they adhere to some common interface.

Duck typing is pretty popular in Python. The language documentation defines duck typing as shown below:

A programming style which does not look at an object’s type to determine if it has the right interface; instead, the method or attribute is simply called or used (“If it looks like a duck and quacks like a duck, it must be a duck.”) By emphasizing interfaces rather than specific types, well-designed code improves its flexibility by allowing polymorphic substitution.

Duck-typing avoids tests using type() or isinstance(). (Note, however, that duck-typing can be complemented with abstract base classes.) Instead, it typically employs hasattr() tests or EAFP programming. (Source)

Here’s a quick example that involves birds that can swim and fly:

Python birds_v1.py class Duck: def swim(self): print("The duck is swimming") def fly(self): print("The duck is flying") class Swan: def swim(self): print("The swan is swimming") def fly(self): print("The swan is flying") class Albatross: def swim(self): print("The albatross is swimming") def fly(self): print("The albatross is flying") Copied!

In this example, your three birds can swim and fly. However, they’re completely independent classes. Because they share the same interface, you can use them in a flexible manner:

Python >>> from birds_v1 import Duck, Swan, Albatross >>> birds = [Duck(), Swan(), Albatross()] >>> for bird in birds: ... bird.fly() ... bird.swim() ... The duck is flying The duck is swimming The swan is flying The swan is swimming The albatross is flying The albatross is swimming Copied!

Python doesn’t care about what object bird is holding at a given time. It just calls the expected methods. If the object provides the method, then the code works without breaking. That’s the flexibility that duck typing offers.

The duck typing system is pretty popular in Python. In most cases, you shouldn’t worry about making sure that an object is of the right type for using it in a certain piece of code. Instead, you can rely on objects that quack like ducks and walk like ducks.

Duck Typing and Polymorphism

In object-oriented programming, polymorphism allows you to treat objects of different types as the same general type. Polymorphism aims to enable code to work with objects of various types through a uniform interface (API), which helps you write more general and reusable code.

You’ll find different forms of polymorphism in object-oriented programming. Duck typing is one of them.

Read the full article at https://realpython.com/duck-typing-python/ »

[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short & sweet Python Trick delivered to your inbox every couple of days. >> Click here to learn more and see examples ]

Categories: FLOSS Project Planets

Maui Release Briefing #5

Planet KDE - Mon, 2024-02-26 07:55

Today, we bring you a report on the brand-new release of the Maui Project.

We are excited to announce the latest release of MauiKit version 3.1.0, our comprehensive user interface toolkit specifically designed for convergent interfaces, the complying frameworks, an in-house developed set of convergent applications, and the upcoming convergent shell environment for desktop and mobile devices.

Built on the foundations of Qt Quick Controls, QML, and the power and stability of C++, MauiKit empowers developers to create adaptable and seamless user interfaces across a range of devices, and with this release, we are a step closer to finalizing the migration to a new major version – the upcoming MauiKit4 release.

Join us on this journey as we unveil the potential of MauiKit3 for building convergent interfaces, the roadmap towards MauiKit4 and its new additions, and finally discover the possibilities offered by the enhanced Maui App stack.

Community

To follow the Maui Project’s development or to just say hi, you can join us on Telegram @mauiproject

We are present on Twitter and Mastodon:

Thanks to the KDE contributors who have helped to translate the Maui Apps and Frameworks!

Downloads & Sources

You can get the stable release packages [APKs, AppImage, TARs] directly from the KDE downloads server at https://download.kde.org/stable/maui/

All of the Maui repositories have the newly released branches and tags. You can get the sources right from the Maui group: https://invent.kde.org/maui

MauiKit4 & Documentation

MauiKit Calendar, Accounts, and Image Tools have now been ported to Qt6, joining MauiMan, MauiKit, and File Browsing frameworks. Alongside with the porting efforts, the frameworks are now documented, and available on the KDE API documentation site [HERE]. The remaining frameworks to be ported to Qt6 are MauiKit Terminal, Documents, and Text Editor, which should be fully ported and documented by the upcoming release in May.

The porting also involved updating the framework CMake code to the latest ECM changes introduced for creating QML plugins.

For the upcoming porting of MauiKit Text Editor, there are plans to move to a different backend for rendering the text more efficiently, and for Documents, the comics and ebooks backends will be reviewed and refactored to address crashing issues under Android.

You can find more information about the roadmap and plans for the migration to Qt6 at: https://invent.kde.org/maui/mauikit/-/issues/35

MauiKit Frameworks & Apps

A quick overview of the issues addressed and updates are covered in the following list:

  • Updated translations and support for more languages
  • Rebase MauiKit ApplicationWindow to QQC2 ApplicationWindow to resolve focus-stealing issues in Android
  • Update all the applications’ source code syntax in QML for the upcoming Qt6 port
  • Pick up the system light/dark preference for Android in MauiKit3, and move the handling of the Android status bar color from each app to MauiKit’s ApplicationWindow control. For MauiKit4 relay in the QStyleHints new properties
  • Split the  MauiApp code from the CSDControls. Thus register CSDControls as a new attached property: Maui.CSD [link to docs]
  • Expose the MauiKit Application root element via the attached property MauiApp, as Maui.App.rootComponent [link to docs]
  • Station fixes for handling the “terminate-session” shortcut and fixes to crashing issues when closing tabs, coming from MauiKit Terminal
  • The MauiKit’s PageLayout control has been backported from MauiKit4 to MauiKit3, and its implementation has gained new features, such as moving the collapsable elements to the footer. [link to docs]
  • Index app is now using MauiKit’s PageLayout control for splitting the toolbar actions for constrained spaces, the same as Pix
  • Pix fix the tags hot-reloading on new tags created
  • Fixes to nota syncing the terminal working directory
https://mauikit.org/wp-content/uploads/2024/02/Peek-2024-02-13-11-53.mp4
  • Vvave has gained a new option to quickly start a playlist in shuffle mode and a sleep timer: to stop playback and/or close the app after a certain time or end of the playlist
  • MauiKit’s AboutDialog has been revised and organized
  • MauiKit FileBrowsing control for creating a new file now picks the icon from the name extension
  • MauiKit Terminal and Text Editor now have a custom control exposing configurations for selecting custom color schemes
  • Index now has options to tweak the embedded terminal in Linux, such as custom color schemes, and reorganized setting entries for the terminal configurations
  • Nota now reuses the new Text Editor control for picking the color scheme and new options for  tweaking the embedded terminal
  • All of the apps now use an exported definition or the copyright notice
  • Fixes for all of the apps where the names of developers and other non-translatable strings were being marked as such
  • Fixed keyboard shortcuts for Station, Vvave, and other apps
  • Added style for the ComboBox component
  • MauiKit corrects the usage of singleton instances across threads for all the frameworks, which avoids the double instantiation from the CPP and QML side
  • Fixes to MauiKit TextEditor long press actions on touch screens
  • Fixes to style hints for the scrollbar policy coming from MauiMan
  • Fixes to Nota’s recent view selection mode
  • On mobile devices do not cache image or icon previews for the thumbnail delegates
[Known Bugs]
  • Nota crashes when opening a new file from the recent view under Android.
  • MauiKit Documents fails to open large comic books on Android, causing the app to crash due to the current design of using multiple threads for different pages. This is planned to be solved at MauiKitDocuments4 porting
  • MauiKit Text Editor TextArea has a flickering issue, which makes content jumpy on Android only. This is from upstream and should be solved on MauiKitTextEditor4 porting when moving to a different backend.
  • MauiKit FileBrowsing support for browsing SD cards on Android is currently disabled due to missing bindings to the “new” Android storage API
[What’s Next?]

For the next release, we plan to work on stabilizing the Maui Shell experience, by adding  XWayland support, and a few more things:

  • Finalize the porting of the MauiKit Frameworks to Qt6
  • Finalize and review the MauiKit documentation
  • Start the porting process of the Maui Apps to MauiKit4 AKA Qt6
  • Review MauiKit4 on Android
  • Review the migration of TextEditor to a new backend
  • Fixes to bugs on the Maui Apps stack
  • Update the Maui Apps features that are still pending

 

Maui Shell

For this release, Maui Shell and its components have received minimal updates coming from:

  • MauiCore and Maui Settings new modules for Audio and Network
  • Updated Maui Settings for MauiKit4 changes
  • Review shell aka Cask elements to be up to date with the MauiKit4 changes

 

That’s it for now. Until the next blog post, that will be a bit closer to the 3.1.1 stable release.

To follow the Maui Project’s development or say hi, you can join us on Telegram: https://t.me/mauiproject.

We are present on Twitter and Mastodon:

New release schedule

The post Maui Release Briefing #5 appeared first on MauiKit — #UIFramework.

Categories: FLOSS Project Planets

LN Webworks: Drupal Integration with Enterprise Systems: All You Need To Know

Planet Drupal - Mon, 2024-02-26 04:56

Using different systems in a company is important for success. Today, in a world full of changing technologies and IT tools, Drupal is notable. It's an open-source software that's always getting better with the help of a big community. 

Drupal is flexible because it has modules written in PHP, and you can use tools like Composer with it. This makes Drupal an ideal choice for integrating different programs in an organization. It adapts well to the evolving needs of a company's IT infrastructure.

In this guide, we will have a close look at the right way to perform seamless Drupal integration with enterprise systems. 

Why is Drupal a Great Choice for Integration? 

Drupal works well for integration due to a few key reasons. First, it's highly flexible and comes with a vast collection of modules available on Drupal.org. 

These modules, which are like pre-built pieces of software, keep growing and often offer ready-to-use solutions for integration.

Categories: FLOSS Project Planets

libredwg @ Savannah: libredwg-0.13.3 released

GNU Planet! - Mon, 2024-02-26 04:46

A minor bugfix release, mostly fixes missing dwg2ps.1

See https://www.gnu.org/software/libredwg/ and https://git.savannah.gnu.org/cgit/libredwg.git/tree/NEWS?h=0.13.3

Here are the compressed sources:
http://ftp.gnu.org/gnu/libredwg/libredwg-0.13.3.tar.gz (20.1MB)
http://ftp.gnu.org/gnu/libredwg/libredwg-0.13.3.tar.xz (10.1MB)

Here are the GPG detached signatures[*]:
http://ftp.gnu.org/gnu/libredwg/libredwg-0.13.3.tar.gz.sig
http://ftp.gnu.org/gnu/libredwg/libredwg-0.13.3.tar.xz.sig

Use a mirror for higher download bandwidth:
https://www.gnu.org/order/ftp.html

Here are more binaries:
https://github.com/LibreDWG/libredwg/releases/tag/0.13.3

Here are the SHA256 checksums:


[*] Use a .sig file to verify that the corresponding file (without the
.sig suffix) is intact. First, be sure to download both the .sig file
and the corresponding tarball. Then, run a command like this:

gpg --verify libredwg-0.13.3.tar.gz.sig

If that command fails because you don't have the required public key,
then run this command to import it:

gpg --recv-keys B4F63339E65D6414

and rerun the gpg --verify command.

Categories: FLOSS Project Planets

Golems GABB: Ways to Optimize Carousel Sliders in Drupal for Faster Page Loading

Planet Drupal - Mon, 2024-02-26 03:49
Ways to Optimize Carousel Sliders in Drupal for Faster Page Loading Editor Mon, 02/26/2024 - 13:28

The rule of thumb is straightforward — the faster, the better. The speed of carousel sliders in Drupal has a huge impact on how users interact with your content. If adjusted correctly, it will surely drive your platform to the top of SERPs. 
Drupal carousel slider optimization, among other design elements, helps you entice your audience to stay on your site and speeds it up. Customers quickly abandon pages if they don’t satisfy their needs. As research shows, 7% and 11% drops in conversions and pageviews, respectfully, can happen because of a one-second lag between page loads.

Categories: FLOSS Project Planets

Python GUIs: Which Python GUI library should you use? — Comparing the Python GUI libraries available in 2024

Planet Python - Mon, 2024-02-26 01:00

Python is a popular programming used for everything from scripting routine tasks to building websites and performing complex data analysis. While you can accomplish a lot with command line tools, some tasks are better suited to graphical interfaces. You may also find yourself wanting to build a desktop front-end for an existing tool to improve usability for non-technical users. Or maybe you're building some hardware or a mobile app and want an intuitive touchscreen interface.

To create graphical user interfaces with Python, you need a GUI library. Unfortunately, at this point things get pretty confusing -- there are many different GUI libraries available for Python, all with different capabilities and licensing. Which Python GUI library should you use for your project?

In this article, we will look at a selection of the most popular Python GUI frameworks currently available and why you should consider using them for your own projects. You'll learn about the relative strengths of each library, understand the licensing limitations and see a simple Hello, World! application written in each. By the end of the article you should feel confident choosing the right library for your project.

tldr If you're looking to build professional quality software, start with PySide6 or PyQt6. The Qt framework is batteries-included — whatever your project, you'll be able to get it done. We have a complete PySide6 tutorial and PyQt6 tutorial as well as a Github respository full of Python GUI examples to get you started.

Table of Contents Tkinter

Best for simple tool GUIs, small portable applications

Tkinter is the defacto GUI framework for Python. It comes bundled with Python on both Windows and macOS. (On Linux, it may require downloading an additional package from your distribution's repo.) Tkinter is a wrapper written around the Tk GUI toolkit. Its name is an amalgamation of the words Tk and Interface.

Tkinter is a simple library with support for standard layouts and widgets, as well as more complex widgets such as tabbed views & progressbars. Tkinter is a pure GUI library, not a framework. There is no built-in support for GUIs driven from data sources, databases, or for displaying or manipulating multimedia or hardware. However, if you need to make something simple that doesn't require any additional dependencies, Tkinter may be what you are looking for. Tkinter is cross-platform however the widgets can look outdated, particularly on Windows.

Installation Already installed with Python on Windows and macOS. Ubuntu/Debian Linux sudo apt install python3-tk

A simple hello world application in Tkinter is shown below.

python import tkinter as tk window = tk.Tk() window.title("Hello World") def handle_button_press(event): window.destroy() button = tk.Button(text="My simple app.") button.bind("", handle_button_press) button.pack() # Start the event loop. window.mainloop() python from tkinter import Tk, Button class Window(Tk): def __init__(self): super().__init__() self.title("Hello World") self.button = Button(text="My simple app.") self.button.bind("", self.handle_button_press) self.button.pack() def handle_button_press(self, event): self.destroy() # Start the event loop. window = Window() window.mainloop()

Hello world application built using Tkinter, running on Windows 11

Tkinter was originally developed by Steen Lumholt and Guido Van Rossum, who designed Python itself. Both the GUI framework and the language are licensed under the same Python Software Foundation (PSF) License. While the license is compatible with the GPL, it is a 'permissive' license (similar to the MIT License) that allows it to be used for proprietary applications and modifications.

PyQt or PySide

Best for commercial, multimedia, scientific or engineering desktop applications

PyQt and PySide are wrappers around the Qt framework. They allow you to easily create modern interfaces that look right at home on any platform, including Windows, macOS, Linux and even Android. They also have solid tooling with the most notable being Qt Creator, which includes a WYSIWYG editor for designing GUI interfaces quickly and easily. Being backed by a commercial project means that you will find plenty of support and online learning resources to help you develop your application.

Qt (and by extension PyQt & PySide) is not just a GUI library, but a complete application development framework. In addition to standard UI elements, such as widgets and layouts, Qt provides MVC-like data-driven views (spreadsheets, tables), database interfaces & models, graph plotting, vector graphics visualization, multimedia playback, sound effects & playlists and built-in interfaces for hardware such as printing. The Qt signals and slots models allows large applications to be built from re-usable and isolated components.

While other toolkits can work great when building small & simple tools, Qt really comes into its own for building real commercial-quality applications where you will benefit from the pre-built components. This comes at the expense of a slight learning curve. However, for smaller projects Qt is not really any more complex than other libraries. Qt Widgets-based applications use platform native widgets to ensure they look and feel at home on Windows, macOS and Qt-based Linux desktops.

Installation pip install pyqt6 or pip install pyside6

A simple hello world application in PyQt6, using the Qt Widgets API is shown below.

python from PyQt6.QtWidgets import QMainWindow, QApplication, QPushButton import sys class MainWindow(QMainWindow): def __init__(self): super().__init__() self.setWindowTitle("Hello World") button = QPushButton("My simple app.") button.pressed.connect(self.close) self.setCentralWidget(button) self.show() app = QApplication(sys.argv) w = MainWindow() app.exec() python from PySide6.QtWidgets import QMainWindow, QApplication, QPushButton import sys class MainWindow(QMainWindow): def __init__(self): super().__init__() self.setWindowTitle("Hello World") button = QPushButton("My simple app.") button.pressed.connect(self.close) self.setCentralWidget(button) self.show() app = QApplication(sys.argv) w = MainWindow() app.exec()

As you can see, the code is almost identical between PyQt & PySide, so it's not something to be concerned about when you start developing with either: you can always migrate easily if you need to.

Hello world application built using PyQt6, running on Windows 11

Before the Qt Company (under Nokia) released the officially supported PySide library in 2009, Riverbank Computing had released PyQt in 1998. The main difference between these two libraries is in licensing. The free-to-use version of PyQt is licensed under GNU General Public License (GPL) v3 but PySide is licensed under GNU Lesser General Public License (LGPL). This means that PyQt is limited GPL-licensed applications unless you purchase its commercial version, while PySide may be used in non-GPL applications without any additional fee. However, note that both these libraries are separate from Qt itself which also has a free-to-use, open source version and a paid, commercial version.

For a more information see our article on PyQt vs PySide licensing.

PyQt/PySide with QML

Best for Raspberry Pi, microcontrollers, industrial and consumer electronics

When using PyQt and PySide you actually have two options for building your GUIs. We've already introduced the Qt Widgets API which is well-suited for building desktop applications. But Qt also provides a declarative API in the form of Qt Quick/QML.

Using Qt Quick/QML you have access to the entire Qt framework for building your applications. Your UI consists of two parts: the Python code which handles the business logic and the QML which defines the structure and behavior of the UI itself. You can control the UI from Python, or use embedded Javascript code to handle events and animations.

Qt Quick/QML is ideally suited for building modern touchscreen interfaces for microcontrollers or device interfaces -- for example, building interfaces for microcontrollers like the Raspberry Pi. However you can also use it on desktop to build completely customized application experiences, like those you find in media player applications like Spotify, or to desktop games.

Installation pip install pyqt6 or pip install pyside6

A simple Hello World app in PyQt6 with QML. Save the QML file in the same folder as the Python file, and run as normally.

python import sys from PyQt6.QtGui import QGuiApplication from PyQt6.QtQml import QQmlApplicationEngine app = QGuiApplication(sys.argv) engine = QQmlApplicationEngine() engine.quit.connect(app.quit) engine.load('main.qml') sys.exit(app.exec()) qml import QtQuick 2.15 import QtQuick.Controls 2.15 ApplicationWindow { visible: true width: 600 height: 500 title: "HelloApp" Text { anchors.centerIn: parent text: "Hello World" font.pixelSize: 24 } }

Licensing for Qt Quick/QML applications is the same as for other PyQt/PySide apps.

Hello world application built using PyQt6 & QML, running on Windows 11

Kivy

Best for Python mobile app development

While most other GUI frameworks are bindings to toolkits written in other programming languages, Kivy is perhaps the only framework which is primarily written in pure Python. If you want to create touchscreen-oriented interfaces with a focus on mobile platforms such as Android and iOS, this is the way to go. This does run on desktop platforms (Windows, macOS, Linux) as well but note that your application may not look and behave like a native application. However, there is a pretty large community around this framework and you can easily find resources to help you learn it online.

The look and feel of Kivy is extremely customizable, allowing it to be used as an alternative to libraries like Pygame (for making games with Python). The developers have also released a number of separate libraries for Kivy. Some provide Kivy with better integration and access to certain platform-specific features, or help package your application for distribution on platforms like Android and iOS. Kivy has it's own design language called Kv, which is similar to QML for Qt. It allows you to easily separate the interface design from your application's logic.

There is a 3rd party add-on for Kivy named KivyMD that replaces Kivy's widgets with ones that are compliant with Google's Material Design.

A simple hello world application in Kivy is shown below.

Installation pip install kivy

A simple hello world application in Kivy is shown below.

python from kivy.app import App from kivy.uix.boxlayout import BoxLayout from kivy.uix.button import Button from kivy.core.window import Window Window.size = (300, 200) class MainWindow(BoxLayout): def __init__(self): super().__init__() self.button = Button(text="Hello, World?") self.button.bind(on_press=self.handle_button_clicked) self.add_widget(button) def handle_button_clicked(self, event): self.button.text = "Hello, World!" class MyApp(App): def build(self): self.title = "Hello, World!" return MainWindow() app = MyApp() app.run()

Hello world application built using Kivy, running on Windows 11

An equivalent application built using the Kv declarative language is shown below.

python import kivy kivy.require('1.0.5') from kivy.uix.floatlayout import FloatLayout from kivy.app import App from kivy.properties import ObjectProperty, StringProperty class Controller(FloatLayout): '''Create a controller that receives a custom widget from the kv lang file. Add an action to be called from the kv lang file. ''' def button_pressed(self): self.button_wid.text = 'Hello, World!' class ControllerApp(App): def build(self): return Controller() if __name__ == '__main__': ControllerApp().run() python #:kivy 1.0 : button_wid: custom_button BoxLayout: orientation: 'vertical' padding: 20 Button: id: custom_button text: 'Hello, World?' on_press: root.button_pressed()

The name of the Kv file must match the name of the class from the main application -- here Controller and controller.kv.

Hello world application built using Kivy + Kv, running on Windows 11

In February 2011, Kivy was released as the spiritual successor to a similar framework called PyMT. While they shared similar goals and was also led by the current core developers of Kivy, where Kivy differs is in its underlying design and a professional organization which actively develops and maintains it. Kivy is licensed under the MIT license, which is a 'permissive' license that allows you to use it freely in both open source and proprietary applications. As such, you are even allowed to make proprietary modifications to the framework itself.

PySimpleGUI

Best for quickly building UIs for simple tools, very portable

PySimpleGUI 5 uses a paid subscription model for commercial software. Non-commercial distribution requires both developers and recipients to have an active PySimpleGUI subscription.

PySimpleGUI aims to simplify GUI application development for Python. It doesn't reinvent the wheel but provides a wrapper around other existing frameworks such as Tkinter, Qt (PySide 2), WxPython and Remi. By doing so, it lowers the barrier to creating a GUI but also allows you to easily migrate from one GUI framework to another by simply changing the import statement.

While there is a separate port of PySimpleGUI for each of these frameworks, the Tkinter version is considered the most feature complete. Wrapping other libraries comes at a cost however — your applications will not be able to exploit the full capabilities or performance of the underlying libraries. The pure-Python event loop can also hinder performance by bottlenecking events with the GIL. However, this is only really a concern when working with live data visualization, streaming or multimedia applications.

There is a fair amount of good resources to help you learn to use PySimpleGUI, including an official Cookbook and a Udemy course offered by the developers themselves. According to their project website, PySimpleGUI was initially made (and later released in 2018) because the lead developer wanted a 'simplified' GUI framework to use in his upcoming project and wasn't able to find any that met his needs.

Installation pip install pysimplegui

python import PySimpleGUI as sg layout = [ [sg.Button("My simple app.")] ] window = sg.Window("Hello World", layout) while True: event, values = window.read() print(event, values) if event == sg.WIN_CLOSED or event == "My simple app.": break window.close()

Hello world application built using PySimpleGUI, running on Windows 11

PySimpleGUI is licensed under the same LGPL v3 license as PySide, which allows its use in proprietary applications but modifications to the framework itself must be released as open source.

WxPython

Best for simple portable desktop applications

WxPython is a wrapper for the popular, cross-platform GUI toolkit called WxWidgets. It is implemented as a set of Python extension modules that wrap the GUI components of the popular wxWidgets cross platform library, which is written in C++.

WxPython uses native widgets on most platforms, ensure that your application looks and feels at home. However, WxPython is known to have certain platform-specific quirks and it also doesn't provide the same level of abstraction between platforms as Qt for example. This may affect how easy it is to maintain cross-platform compatibility for your application.

WxPython is under active development and is also currently being reimplemented from scratch under the name 'WxPython Phoenix'. The team behind WxWidgets is also responsible for WxPython, which was initially released in 1998.

Installation pip install wxpython

python import wx class MainWindow(wx.Frame): def __init__(self, parent, title): wx.Frame.__init__(self, parent, title=title, size=(200, -1)) self.button = wx.Button(self, label="My simple app.") self.Bind( wx.EVT_BUTTON, self.handle_button_click, self.button ) self.sizer = wx.BoxSizer(wx.VERTICAL) self.sizer.Add(self.button) self.SetSizer(self.sizer) self.SetAutoLayout(True) self.Show() def handle_button_click(self, event): self.Close() app = wx.App(False) w = MainWindow(None, "Hello World") app.MainLoop()

Hello world application built using WxPython, running on Windows 11

Both WxWidgets and WxPython are licensed under a WxWindows Library License, which is a 'free software' license similar to LGPL (with a special exception). It allows both proprietary and open source applications to use and modify WxPython.

PyGObject (GTK+)

Best for developing applications for GNOME desktop

If you intend to create an application that integrates well with GNOME and other GTK-based desktop environments for Linux, PyGObject is the right choice. PyGObject itself is a language-binding to the GTK+ widget toolkit. It allows you to create modern, adaptive user interfaces that conform to GNOME's Human Interface Guidelines (HIG).

It also enables the development of 'convergent' applications that can run on both Linux desktop and mobile platforms. There are a few first-party and community-made, third-party tools available for it as well. This includes the likes of GNOME Builder and Glade, which is yet another WYSIWYG editor for building graphical interfaces quickly and easily.

Unfortunately, there aren't a whole lot of online resources to help you learn PyGObject application development, apart from this one rather well-documented tutorial. While cross-platform support does exist (e.g. Inkscape, GIMP), the resulting applications won't feel completely native on other desktops. Setting up a development environment for this, especially on Windows and macOS, also requires more steps than for most other frameworks in this article, which just need a working Python installation.

Installation Ubuntu/Debian sudo apt install python3-gi python3-gi-cairo gir1.2-gtk-4.0, macOS Homebrew brew install pygobject4 gtk+4

python import gi gi.require_version("Gtk", "4.0") from gi.repository import Gtk def on_activate(app): win = Gtk.ApplicationWindow(application=app) btn = Gtk.Button(label="Hello, World!") btn.connect('clicked', lambda x: win.close()) win.set_child(btn) win.present() app = Gtk.Application(application_id='org.gtk.Example') app.connect('activate', on_activate) app.run(None)

Hello world application built using PyGObject, running on Ubuntu Linux 21.10

PyGObject is developed and maintained under the GNOME Foundation, who is also responsible for the GNOME desktop environment. PyGObject replaces several separate Python modules, including PyGTK, GIO and python-gnome, which were previously required to create a full GNOME/GTK application. Its initial release was in 2006 and it is licensed under an older version of LGPL (v2.1). While there are some differences with the current version of LGPL (v3), the license still allows its use in proprietary applications but requires any modification to the library itself to be released as open source.

Remi

Best for web based UIs for Python applications

Remi, which stands for REMote Interface, is the ideal solution for applications that are intended to be run on servers and other headless setups. (For example, on a Raspberry Pi.) Unlike most other GUI frameworks/libraries, Remi is rendered completely in the browser using a built-in web server. Hence, it is completely platform-independent and runs equally well on all platforms.

That also makes the application's interface accessible to any computer or device with a web browser that is connected to the same network. Although access can be restricted with a username and password, it doesn't implement any security strategies by default. Note that Remi is meant to be used as a desktop GUI framework and not for serving up web pages. If more than one user connects to the application at the same time, they will see and interact with the exact same things as if a single user was using it.

Remi requires no prior knowledge of HTML or other similar web technologies. You only need to have a working understanding of Python to use it, which is then automatically translated to HTML. It also comes included with a drag n drop GUI editor that is akin to Qt Designer for PyQt and PySide.

python import remi.gui as gui from remi import start, App class MyApp(App): def main(self): container = gui.VBox(width=120, height=100) # Create a button, with the label "Hello, World!" self.bt = gui.Button('Hello, World?') self.bt.onclick.do(self.on_button_pressed) # Add the button to the container, and return it. container.append(self.bt) return container def on_button_pressed(self, widget): self.bt.set_text('Hello, World!') start(MyApp)

Remi is licensed under the Apache License v2.0, which is another 'permissive' license similar to the MIT License. The license allows using it in both open source and proprietary applications, while also allowing proprietary modifications to be made to the framework itself. Its main conditions revolve around the preservation of copyright and license notices.

Hello world application built using Remi, running on Chrome on Windows 11

Conclusion

If you're looking to build GUI applications with Python, there is probably a GUI framework/library listed here that fits the bill for your project. Try and weigh up the capabilities & licensing of the different libraries with the scale of your project, both now and in the future.

Don't be afraid to experiment a bit with different libraries, to see which feel the best fit. While the APIs of GUI libraries are very different, they share many underlying concepts in common and things you learn in one library will often apply in another.

You are only limited by your own imagination. So go out there and make something!

Categories: FLOSS Project Planets

ListenData: How to Scrape Google News with Python

Planet Python - Mon, 2024-02-26 00:43

This tutorial explains how to scrape Google News for articles related to the topic of your choice using Python.

We are interested to see the following information for each news article.

  • Title : Article Headline
  • Source : Original News Source or Blogger Name
  • Time : Publication Date/Time
  • Author : Article Author
  • Link : Article Link
To read this article in full, please click hereThis post appeared first on ListenData
Categories: FLOSS Project Planets

Pages