Feeds

Chapter Three: Hell is Programming a Calendar (Part 2 - Time in Drupal)

Planet Drupal - Thu, 2022-06-23 16:41
​Welcome to part two of Hell is Programming a Calendar, where I will dive into some of the more nitty-gritty details about handling time specifically in Drupal. If you haven’t already, I highly recommend checking out part one where I explain why time, in a more general programming sense, is so complicated in the first place. Anatomy of a date field Let’s start by breaking down Drupal’s core date field into its smaller components to examine how it works. In my mind, the core date field can be broken down into four major components.
Categories: FLOSS Project Planets

Mike Driscoll: An Intro to Kivy Layouts (Video)

Planet Python - Thu, 2022-06-23 14:24

Learn how to layout your widgets in Kivy, a mobile GUI framework for Python. Kivy is a cross-platform GUI framework that also works on iOS and Android.

The examples in this video are based on the code from Kivy 101: How to Use BoxLayouts

 

The post An Intro to Kivy Layouts (Video) appeared first on Mouse Vs Python.

Categories: FLOSS Project Planets

Evolving Web: The Most Important Criteria When Selecting Drupal or WordPress

Planet Drupal - Thu, 2022-06-23 11:08

Choosing which platform to use to manage your website or web platform can be a daunting task, especially if you have stakeholders with different priorities and skills, existing technologies, tools, and processes to take into account. Whatever your goals are when building or improving your website, your choice of technology will have many organizational impacts.

For many years now, Drupal and WordPress have been the two most popular content management systems(CMS), used by a large number of organizations. Both CMS offer a comprehensive, widely adopted, open source solution. In this article, we will take a deeper dive into the differences between these two popular options, and which factors to consider when doing your evaluation. While it's likely that either option could get you to your goal, choosing one option or the other will impact how you get there, what investments you'll need to make, and what options you'll have in the future.

Let's dive in.

Choosing your CMS

Before making a decision, here are a few factors to keep in mind:

  • Your team's skills (if you are building your website in-house),
  • Your website's technical requirements today and what added features it might need in the future.
  • Your budget for this project
Choosing a platform your team will love to use

Let's start with WordPress. Originally designed as a blog publishing platform, WordPress has always been touted as a more beginner-friendly option. The platform makes it easy to get from a fresh install to a finished website. If you're willing to pay for premium plugins, you can get most things done without writing any code.

Creating a page in with the Gutenberg editor in WordPress

Drupal, on the other hand, is more than a content management system. The platform allows you to integrate content and functionality in a myriad of ways. Not only is the functionality modular, but the front-end can be completely decoupled, and the back-end can be seamlessly integrated with third-party data sources.

🗺️ Just getting started with Drupal? Download our free guide: Get Started with Drupal

Defining your content structure

Let's say you're building a recipe website. Sometimes your visitors will be searching for a specific type of recipe, but other times they'll be in the mood to browse. You want people to be able to filter recipes by main ingredient, course, meal, dietary restriction, cultural origin, etc. You'd also like to recommend related recipes based on the one currently being viewed.

This type of functionality is made possible by taxonomies and content types in a CMS. Drupal's taxonomy implementation is more intuitive and extensive for sites that handle a lot of multifaceted content. You can create the vocabularies that are used to organize terms, and easily use taxonomy terms to tag content. This enables the creation of advanced search interfaces, dynamic landing pages, and content recommendations.

In Drupal, you can easily create custom content types or templates for your content—such as "Recipe"—and control what they look like and how they get displayed.

To do the same in WordPress, you can use plugins available to extend the built-in content model (made up of Posts and Pages). This is recommended for websites with a simpler content structure and it makes migrating content from one WordPress site to another much easier.

Assessing your media needs

WordPress has had its media library functionality for longer than Drupal, but the latter caught up nicely with its built-in Media module.

Media handling within WordPress

Drupal is more flexible when it comes to what can be considered "media", so you can add new media sources, like remote or local videos, add metadata to media content, and if a digital asset management (DAM) system already exists, it can easily be integrated into a Drupal site.

An example of this: Tourism Montreal has a massive library of images and videos that they use not only online, but also in brochures, on billboards, and across all sorts of other channels. To help them centralize these assets and easily use them on their Drupal site, Evolving Web created an integration for DAM system Bynder.

What's more, in Drupal, media items have fields just like content, meaning you can customize how they're displayed on a really granular level, or categorize media items so they're easier to find and reuse later. Like other aspects of Drupal, this requires careful customization through the admin UI.

Anticipating your website's needs in the future Extensibility and Plugins

Drupal and WordPress come with many features out-of-the-box. But as your company's needs evolve, you'll want to add more features to your website. As open-source projects, they both have a ton of extensions available to add to your project, as seen in the WordPress plugin directory and Drupal's module list. WordPress offers significantly more themes (free and paid), whereas most Drupal sites use a custom theme to define the look and feel.

The main difference is the model for managing contributed integrations: while virtually all Drupal modules are free and available on Drupal.org, you can find WordPress plugins all over the web, many of which are paid or freemium.

Multilingual Capabilities

Site content that needs to be translated into multiple languages often falls victim to discrepancies that slip between the cracks.

Drupal has always offered multilingual management built into the core—it's one of the main reasons Evolving Web, being based in bilingual Montreal, chose to focus on Drupal back in 2008.

WordPress, on the other hand, handles multiple languages through third-party plugins, which may be inconsistent when combined with other plugins.

Version Control and Workflow Integration

WordPress tool simply allows you to manage content versions, draft and publish content. If you have a small team and publish blog posts every other day, WordPress will certainly do the job. But if you have a big team and want to have approval processes in place, Drupal would be more in line with your needs.

Content and page view in WordPress

With Drupal, you can create content states and transitions from scratch, making it easy to implement more publishing and approval workflows. Revisions are tracked every time content is saved, and you can draft content while the existing, approved version remains visible on the website.

Content view in Drupal

Security

No platform is 100% immune to security vulnerabilities, but the handling of security updates varies greatly from one system to another. Drupal is well-positioned to manage complicated security issues and offers database encryption. Drupal also has a security team providing a streamlined process for handling security vulnerabilities for core and contributed modules. Drupal's strong coding standards make it a favourite amongst organizations looking for a secure enterprise platform.

Whichever platform you're using, selecting modules or plugins that are vetted and reviewing custom code for vulnerabilities is a must.

So, in terms of security, no tool is better than the other, it all depends on how you configure each system and what plugins or modules you install.

How much is it going to cost you?

When looking at the cost of Drupal and WordPress, it's important to consider what you're getting for your money. WordPress and Drupal are both open-source, which means they're free to download, customize, and use. But in order to create a website, you'll need to factor in the cost of custom design, development, the QA and deployment process, and any paid plugins or third-party integrations. Figuring out the actual cost of implementation for each platform is an important step in your evaluation. Keep in mind that it might cost more to develop a flexible platform, but that this can save money in the long run as your needs evolve.

The Bottom Line

If WordPress aims to help you create a website, Drupal's goal is to let you build whatever you can dream of - which explains why it's often seen as the "developer-focused" option. Both have made significant improvements to the user experience over two decades of development, and they often strive to make the experience even better.

More importantly, Drupal and WordPress are active open source projects with large communities and a wealth of resources to get started. Both communities host meetups and events around the world; here are some WordPress ones, and here's where to find Drupal-related events.

At Evolving Web, although we are long-time Drupal contributors, we design and develop for both platforms. Some of our clients stick with WordPress for new projects because they've always used it, which is often a smart decision—don't underestimate the cost of switching.

Just getting started with Drupal? Check out our content editor training!

+ more awesome articles by Evolving Web
Categories: FLOSS Project Planets

PyBites: Common Python developer pitfalls and the 80/20 that really matters

Planet Python - Thu, 2022-06-23 10:50

Listen here:

Welcome back to another Pybites podcast episode. In this episode we talk about common pitfalls you want to avoid when becoming a Python developer:

Pitfall #1: Tutorial paralysis
Pitfall #2: Improper sequencing
Pitfall #3: Obsessing over Pythonic code
Pitfall #4: Going on your own for too long

… after that we look at the 80/20 (aka “Pareto”) to focus on  to become a well-rounded Python developer:

80/20 Rule #1: Work on bigger projects
80/20 Rule #2: Build a portfolio
80/20 Rule #3: Work with experienced developers
80/20 Rule #4: Become a content provider


If this resonates with you and you want to better your career as a Pythonista, book us in for a career chathttps://go.oncehub.com/pybites

Thanks for listening,  Any feedback, write us an email to info@pybit.es

We’ll be back next week!

Categories: FLOSS Project Planets

Raphaël Hertzog: Freexian’s report about Debian Long Term Support, May 2022

Planet Debian - Thu, 2022-06-23 08:15

Like each month, have a look at the work funded by Freexian’s Debian LTS offering.

Debian project funding

Two [1, 2] projects are in the pipeline now. Tryton project is in a final phase. Gradle projects is fighting with technical difficulties.

In May, we put aside 2233 EUR to fund Debian projects.

We’re looking forward to receive more projects from various Debian teams! Learn more about the rationale behind this initiative in this article.

Debian LTS contributors

In May, 14 contributors have been paid to work on Debian LTS, their reports are available:

  • Abhijith PA did 14.0h (out of 14h assigned).
  • Andreas Rönnquist did 14.5h (out of 25.0h assigned), thus carrying over 10.5h to June.
  • Anton Gladky did 19h (out of 19h assigned).
  • Ben Hutchings did 8h (out of 11h assigned and 13h from April), thus carrying over 16h to June.
  • Chris Lamb did 18h (out of 18h assigned).
  • Dominik George did 2h (out of 20.0h assigned), thus carrying over 18h to June.
  • Enrico Zini did 9.5h (out of 16.0h assigned), thus carrying over 6.5h to June.
  • Emilio Pozuelo Monfort did 28h (out of 13.75h assigned and 35.25h from April), thus carrying over 21h to June.
  • Markus Koschany did 40h (out of 40h assigned).
  • Roberto C. Sánchez did 13.5h (out of 32h assigned), thus carrying over 18.5h to June.
  • Sylvain Beucler did 23.5h (out of 20h assigned and 20h from April), thus carrying over 16.5h to June.
  • Stefano Rivera did 5h in April and 14h in May (out of 17.5h assigned), thus anticipating 1.5h for June.
  • Thorsten Alteholz did 40h (out of 40h assigned).
  • Utkarsh Gupta did 35h (out of 19h assigned and 30h from April), thus carrying over 14h to June.
Evolution of the situation

In May we released 30 DLAs. The security tracker currently lists 71 packages with a known CVE and the dla-needed.txt file has 65 packages needing an update.

The number of paid contributors increased significantly, we are pleased to welcome our latest team members: Andreas Rönnquist, Dominik George, Enrico Zini and Stefano Rivera.

It is worth pointing out that we are getting close to the end of the LTS period for Debian 9. After June 30th, no new security updates will be made available on security.debian.org. We are preparing to overtake Debian 10 Buster for the next two years and to make this process as smooth as possible.

But Freexian and its team of paid Debian contributors will continue to maintain Debian 9 going forward for the customers of the Extended LTS offer. If you have Debian 9 servers to keep secure, it’s time to subscribe!

You might not have noticed, but Freexian formalized a mission statement where we explain that our purpose is to help improve Debian. For this, we want to fund work time for the Debian developers that recently joined Freexian as collaborators. The Extended LTS and the PHP LTS offers are built following a model that will help us to achieve this if we manage to have enough customers for those offers. So consider subscribing: you help your organization but you also help Debian!

Thanks to our sponsors

Sponsors that joined recently are in bold.

Categories: FLOSS Project Planets

Niels de Feyter: Is Drupal Still the Leading CMS in 2022 and 2023?

Planet Drupal - Thu, 2022-06-23 06:14
The question we want to answer in this blog post is whether Drupal is still the leading CMS platform in 2022 and beyond. If you have been thinking of trying out Drupal, this article will help you decide whether it is still worth it in 2022. Let’s jump right in!
Categories: FLOSS Project Planets

parallel @ Savannah: GNU Parallel 20220622 ('Bongbong') released

GNU Planet! - Thu, 2022-06-23 04:29

GNU Parallel 20220622 ('Bongbong') has been released. It is available for download at: http://ftpmirror.gnu.org/parallel/

Quote of the month:

  Parallel has been (and still is) super useful and simple tool for speeding up all kinds of shell tasks during my career.
    -- ValtteriL@ycombinator

New in this release:

  • , can be used in --sshlogin if quoted as \, or ,,
  • --plus {/#regexp/str} replace ^regexp with str.
  • --plus {/%regexp/str} replace regexp$ with str.
  • --plus {//regexp/str} replace every regexp with str.
  • 'make install' installs bash+zsh completion files.
  • Bug fixes and man page updates.

GNU Parallel - For people who live life in the parallel lane.

If you like GNU Parallel record a video testimonial: Say who you are, what you use GNU Parallel for, how it helps you, and what you like most about it. Include a command that uses GNU Parallel if you feel like it.

About GNU Parallel

GNU Parallel is a shell tool for executing jobs in parallel using one or more computers. A job can be a single command or a small script that has to be run for each of the lines in the input. The typical input is a list of files, a list of hosts, a list of users, a list of URLs, or a list of tables. A job can also be a command that reads from a pipe. GNU Parallel can then split the input and pipe it into commands in parallel.

If you use xargs and tee today you will find GNU Parallel very easy to use as GNU Parallel is written to have the same options as xargs. If you write loops in shell, you will find GNU Parallel may be able to replace most of the loops and make them run faster by running several jobs in parallel. GNU Parallel can even replace nested loops.

GNU Parallel makes sure output from the commands is the same output as you would get had you run the commands sequentially. This makes it possible to use output from GNU Parallel as input for other programs.

For example you can run this to convert all jpeg files into png and gif files and have a progress bar:

  parallel --bar convert {1} {1.}.{2} ::: *.jpg ::: png gif

Or you can generate big, medium, and small thumbnails of all jpeg files in sub dirs:

  find . -name '*.jpg' |
    parallel convert -geometry {2} {1} {1//}/thumb{2}_{1/} :::: - ::: 50 100 200

You can find more about GNU Parallel at: http://www.gnu.org/s/parallel/

You can install GNU Parallel in just 10 seconds with:

    $ (wget -O - pi.dk/3 || lynx -source pi.dk/3 || curl pi.dk/3/ || \
       fetch -o - http://pi.dk/3 ) > install.sh
    $ sha1sum install.sh | grep 883c667e01eed62f975ad28b6d50e22a
    12345678 883c667e 01eed62f 975ad28b 6d50e22a
    $ md5sum install.sh | grep cc21b4c943fd03e93ae1ae49e28573c0
    cc21b4c9 43fd03e9 3ae1ae49 e28573c0
    $ sha512sum install.sh | grep ec113b49a54e705f86d51e784ebced224fdff3f52
    79945d9d 250b42a4 2067bb00 99da012e c113b49a 54e705f8 6d51e784 ebced224
    fdff3f52 ca588d64 e75f6033 61bd543f d631f592 2f87ceb2 ab034149 6df84a35
    $ bash install.sh

Watch the intro video on http://www.youtube.com/playlist?list=PL284C9FF2488BC6D1

Walk through the tutorial (man parallel_tutorial). Your command line will love you for it.

When using programs that use GNU Parallel to process data for publication please cite:

O. Tange (2018): GNU Parallel 2018, March 2018, https://doi.org/10.5281/zenodo.1146014.

If you like GNU Parallel:

  • Give a demo at your local user group/team/colleagues
  • Post the intro videos on Reddit/Diaspora*/forums/blogs/ Identi.ca/Google+/Twitter/Facebook/Linkedin/mailing lists
  • Get the merchandise https://gnuparallel.threadless.com/designs/gnu-parallel
  • Request or write a review for your favourite blog or magazine
  • Request or build a package for your favourite distribution (if it is not already there)
  • Invite me for your next conference

If you use programs that use GNU Parallel for research:

  • Please cite GNU Parallel in you publications (use --citation)

If GNU Parallel saves you money:

About GNU SQL

GNU sql aims to give a simple, unified interface for accessing databases through all the different databases' command line clients. So far the focus has been on giving a common way to specify login information (protocol, username, password, hostname, and port number), size (database and table size), and running queries.

The database is addressed using a DBURL. If commands are left out you will get that database's interactive shell.

When using GNU SQL for a publication please cite:

O. Tange (2011): GNU SQL - A Command Line Tool for Accessing Different Databases Using DBURLs, ;login: The USENIX Magazine, April 2011:29-32.

About GNU Niceload

GNU niceload slows down a program when the computer load average (or other system activity) is above a certain limit. When the limit is reached the program will be suspended for some time. If the limit is a soft limit the program will be allowed to run for short amounts of time before being suspended again. If the limit is a hard limit the program will only be allowed to run when the system is below the limit.

Categories: FLOSS Project Planets

Submit a Goal and Help Shape the Future of KDE

Planet KDE - Thu, 2022-06-23 04:24

By Adam Szopa



I'm super excited to finally announce the start of the submission process for the brand new KDE Goals!

KDE sets goals that help the community focus on important things that need to get done in collaboration across many teams. Over the years, the community has set goals to tackle issues with usability, made it easier for new contributors to start working on KDE projects, implemented new tech that will serve us for years to come, and much more.

KDE Goals set a direction for the community and help concentrate efforts in areas deemed important by the KDE community itself. Every couple of years, new goals are selected to reflect the community's current priorities.





Jonathan Riddell and Niccolò Venerandi explain their ideas for the KDE goals during Akademy 2019.

To submit a new goal proposal, you can use the dedicated workboard and shape the future direction of the KDE community.

This stage in the process lasts until July 16th, but don’t wait until the last moment! Submit early, and use the remaining time to listen to the feedback, refine and update your proposal. Only submissions with good descriptions will move to the next stage: the community vote.

To make things easier, we provide a template ticket that you have to copy and fill out with your content. This way, none of the important parts of a good proposal will be skipped, and there will be consistency between the different proposals.

You will need an account to create a new proposal, and then use the arrow in the “Not ready for voting” column to create a new task. Don’t forget to copy the description from the template!

Remember, by submitting a Goal proposal, you are also submitting yourself as the Goal’s Champion! A Goal Champion is the face of the goal and the motivator of the initiative, but not necessarily the one that implements most of the tasks. After all, this is a community goal, so a good champion will motivate others to join in and help achieve amazing things.

If you want to learn more about the whole process, see the wiki for more details.

Don’t wait! Submit your proposal and, who knows? Perhaps your idea will be announced as one of the new goals during Akademy 2022!

Categories: FLOSS Project Planets

First Beta for Krita 5.1.0 Released

Planet KDE - Thu, 2022-06-23 04:00

We’re releasing the first beta for Krita 5.1.0 today. Krita 5.1.0 is packed with new features! For the full list, check out the work-in-progress full release notes!


Krita is a free and open source project. Please consider supporting the project by joining the Krita Dev Fund, donations or by buying training videos! With your support, we can keep the core team working on Krita full-time.

Highlights
  • Even more operations can handle multiple selected layers
  • We’ve improved support for the WebP, Photoshop layered TIFF and Photoshop files, and there’s new support for the JPEG-XL file format. (See the warning below, though!)
  • We’re now using XSIMD instead of VC, improving painting performance, especially on Android where vectorization now is used for the first time.
  • The fill tools have been extended with continuous fill and a new Enclose and fill tool.
  • For Windows, we’re using a newer version of Angle to improve compatibility with video drivers and improve performance.
  • You can now configure touch controls in canvas input settings, like “Tap to Undo”.

And of course, there are hundreds of bug fixes, performance improvements, user interface refinements, improvements to the animation system (though the revamped audio system sadly didn’t make it, that’s for 5.2).

Known Issues
  • Touch gestures can be customized now, however if you were previously using touch gestures, you will now have to add them to the canvas input settings before they work again.
  • Though this release add support for the new JPEG-XL format, which supports animation, exporting and importing animations in this format gives incorrect results. A fix is pending.

Download Windows

If you’re using the portable zip files, just open the zip file in Explorer and drag the folder somewhere convenient, then double-click on the krita icon in the folder. This will not impact an installed version of Krita, though it will share your settings and custom resources with your regular installed version of Krita. For reporting crashes, also get the debug symbols folder.

Note that we are not making 32 bits Windows builds anymore.

Linux

The separate gmic-qt appimage is no longer needed.

(If, for some reason, Firefox thinks it needs to load this as text: to download, right-click on the link.)

macOS

Note: if you use macOS Sierra or High Sierra, please check this video to learn how to enable starting developer-signed binaries, instead of just Apple Store binaries.

Android

The Android releases are made from the release tarball, so there are translations. We consider Krita on ChromeOS and Android still beta.

Source code

The post First Beta for Krita 5.1.0 Released appeared first on Krita.

Categories: FLOSS Project Planets

ImageX: Control How Your Drupal Content Looks on Facebook and Twitter Shares

Planet Drupal - Wed, 2022-06-22 20:23
Social shares can significantly increase your brand exposure, expand your reach, boost your website traffic, and benefit your SEO. Of course, all this works much better if your shared content looks attractive, relevant, and well-formatted on social media.  Content preview snippets are built automatically when someone shares a link on Facebook, Twitter, LinkedIn, and so on. They include a title, a description, an image, or other details. Can you control how they look and make them so irresistibly clickable? Yes, sure, you can do this by setting up social media meta tags on your website. 
Categories: FLOSS Project Planets

Matt Layman: Refactoring and New Features - Building SaaS with Python and Django #137

Planet Python - Wed, 2022-06-22 20:00
In this episode, I continued on the teacher checklist for the homeschooling app. We added data to the context and this required some refactoring to be able to reuse data from other parts of the app.
Categories: FLOSS Project Planets

Reproducible Builds (diffoscope): diffoscope 217 released

Planet Debian - Wed, 2022-06-22 20:00

The diffoscope maintainers are pleased to announce the release of diffoscope version 217. This version includes the following changes:

* Update test fixtures for GNU readelf 2.38 (now in Debian unstable). * Be more specific about the minimum required version of readelf (ie. binutils) as it appears that this "patch" level version change resulted in a change of output, not the "minor" version. (Closes: #1013348) * Don't leak the (likely-temporary) pathname when comparing PDF documents.

You find out more by visiting the project homepage.

Categories: FLOSS Project Planets

John Goerzen: I Finally Found a Solid Debian Tablet: The Surface Go 2

Planet Debian - Wed, 2022-06-22 19:46

I have been looking for a good tablet for Debian for… well, years. I want thin, light, portable, excellent battery life, and a servicable keyboard.

For a while, I tried a Lenovo Chromebook Duet. It meets the hardware requirements, well sort of. The problem is with performance and the OS. I can run Debian inside the ChromeOS Linux environment. That works, actually pretty well. But it is slow. Terribly, terribly, terribly slow. Emacs takes minutes to launch. apt-gets also do. It has barely enough RAM to keep its Chrome foundation happy, let alone a Linux environment also. But basically it is too slow to be servicable. Not just that, but I ran into assorted issues with having it tied to a Google account – particularly being unable to login unless I had Internet access after an update. That and my growing concern over Google’s privacy practices led me sort of write it off.

I have a wonderful System76 Lemur Pro that I’m very happy with. Plenty of RAM, a good compromise size between portability and screen size at 14.1″, and so forth. But a 10″ goes-anywhere it’s not.

I spent quite a lot of time looking at thin-and-light convertible laptops of various configurations. Many of them were quite expensive, not as small as I wanted, or had dubious Linux support. To my surprise, I wound up buying a Surface Go 2 from the Microsoft store, along with the Type Cover. They had a pretty good deal on it since the Surface Go 3 is out; the highest-processor model of the Go 2 is roughly similar to the Go 3 in terms of performance.

There is an excellent linux-surface project out there that provides very good support for most Surface devices, including the Go 2 and 3.

I put Debian on it. I had a fair bit of hassle with EFI, and wound up putting rEFInd on it, which mostly solved those problems. (I did keep a Windows partition, and if it comes up for some reason, the easiest way to get it back to Debian is to use the Windows settings tool to reboot into advanced mode, and then select the appropriate EFI entry to boot from there.)

Researching on-screen keyboards, it seemed like Gnome had the most mature. So I wound up with Gnome (my other systems are using KDE with tiling, but I figured I’d try Gnome on it.) Almost everything worked without additional tweaking, the one exception being the cameras. The cameras on the Surfaces are a known point of trouble and I didn’t bother to go to all the effort to get them working.

With 8GB of RAM, I didn’t put ZFS on it like I do on other systems. Performance is quite satisfactory, including for Rust development. Battery life runs about 10 hours with light use; less when running a lot of cargo builds, of course.

The 1920×1280 screen is nice at 10.5″. Gnome with Wayland does a decent job of adjusting to this hi-res configuration.

I took this as my only computer for a trip from the USA to Germany. It was a little small at times; though that was to be expected. It let me take a nicely small bag as a carryon, and being light, it was pleasant to carry around in airports. It served its purpose quite well.

One downside is that it can’t be powered by a phone charger like my Chromebook Duet can. However, I found a nice slim 65W Anker charger that could charge it and phones simultaneously that did the job well enough (I left the Microsoft charger with the proprietary connector at home).

The Surface Go 2 maxes out at a 128GB SSD. That feels a bit constraining, especially since I kept Windows around. However, it also has a micro SD slot, so you can put LUKS and ext4 on that and use it as another filesystem. I popped a micro SD I had lying around into there and that felt a lot better storage-wise. I could also completely zap Windows, but that would leave no way to get firmware updates and I didn’t really want to do that. Still, I don’t use Windows and that could be an option also.

All in all, I’m pretty pleased with it. Around $600 for a fully-functional Debian tablet, with a keyboard is pretty nice.

I had been hoping for months that the Pinetab would come back into stock, because I’d much rather support a Linux hardware vendor, but for now I think the Surface Go series is the most solid option for a Linux tablet.

Categories: FLOSS Project Planets

ItsMyCode: [Solved] AttributeError: ‘tuple’ object has no attribute ‘get’

Planet Python - Wed, 2022-06-22 17:05

The AttributeError: ‘tuple’ object has no attribute ‘get’ mainly occurs when you try to call the get() method on the tuple value. The attribute get() method is present in the dictionary and must be called on the dictionary data type.

In this tutorial, we will look at what exactly is AttributeError: ‘tuple’ object has no attribute ‘get’ and how to resolve this error with examples.

What is AttributeError: ‘tuple’ object has no attribute ‘get’?

If we call the get() method on the tuple value, Python will raise an AttributeError: ‘tuple’ object has no attribute ‘get’. The error can also happen if you have a method which returns an tuple instead of a dictionary.

Let us take a simple example to reproduce this error.

# Method return None instead of dict def fetch_data(): output = ("Audi", "BMW") return output data = fetch_data() print(data.get("name"))

Output

AttributeError: 'tuple' object has no attribute 'get'

In the above example, we have a method fetch_data() which returns an tuple instead of a dictionary.

Since we call the get() method on the tuple value, we get AttributeError.

We can also check if the variable type using the type() method, and using the dir() method, we can also print the list of all the attributes of a given object.

# Method return None instead of dict def fetch_data(): output = ("Audi", "BMW") return output data = fetch_data() print("The type of the object is ", type(data)) print("List of valid attributes in this object is ", dir(data))

Output

The type of the object is <class 'tuple'> List of valid attributes in this object is ['__add__', '__class__', '__class_getitem__', '__contains__', '__delattr__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__', '__getnewargs__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__iter__', '__le__', '__len__', '__lt__', '__mul__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__rmul__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', 'count', 'index'] How to fix AttributeError: ‘tuple’ object has no attribute ‘get’?

Let us see how we can resolve the error.

Solution 1 – Call the get() method on valid dictionary

We can resolve the error by calling the get() method on the valid dictionary object instead of the tuple type.

The dict.get() method returns the value of the given key. The get() method will not throw KeyError if the key is not present; instead, we get the None value or the default value that we pass in the get() method.

# Method returns dict def fetch_data(): output = {"name": "Audi", "price": "$45000"} return output data = fetch_data() # Get the car Name print(data.get("name"))

Output

Audi Solution 2 – Check if the object is of type dictionary using type

Another way is to check if the object is of type dictionary; we can do that using the type() method. This way, we can check if the object is of the correct data type before calling the get() method.

# Method returns dict def fetch_data(): output = {"name": "Audi", "price": "$45000"} return output data = fetch_data() # Check if the object is dict if (type(data) == dict): print(data.get("name")) softwares = ("Audi", "BMW") if (type(softwares) == dict): print(softwares.get("name")) else: print("The object is not dictionary and it is of type ", type(softwares))

Output

Audi The object is not dictionary and it is of type <class 'tuple'> Solution 3 – Check if the object has get attribute using hasattr

Before calling the get() method, we can also check if the object has a certain attribute. Even if we call an external API which returns different data, using the hasattr() method, we can check if the object has an attribute with the given name.

# Method returns dict def fetch_data(): output = {"name": "Audi", "price": "$45000"} return output data = fetch_data() # Check if the object is dict if (hasattr(data, 'get')): print(data.get("name")) # Incase of None value softwares = ("Audi", "BMW") if (hasattr(softwares, 'get')): print(softwares.get("name")) else: print("The object does not have get attribute")

Output

Audi The object does not have get attribute Conclusion

The AttributeError: ‘tuple’ object has no attribute ‘get’ occurs when you try to call the get() method on the None type. The error also occurs if the calling method returns an tuple instead of a dictionary object.

We can resolve the error by calling the get() method on the dictionary object instead of an tuple. We can check if the object is of type dictionary using the type() method, and also, we can check if the object has a valid get attribute using hasattr() before performing the get operation.

Categories: FLOSS Project Planets

ItsMyCode: [Solved] AttributeError: &#8216;NoneType&#8217; object has no attribute &#8216;get&#8217;

Planet Python - Wed, 2022-06-22 16:56

The AttributeError: ‘NoneType’ object has no attribute ‘get’ mainly occurs when you try to call the get() method on the None value. The attribute get() method is present in the dictionary and must be called on the dictionary data type.

In this tutorial, we will look at what exactly is AttributeError: ‘NoneType’ object has no attribute ‘get’ and how to resolve this error with examples.

What is AttributeError: ‘NoneType’ object has no attribute ‘get’?

If we call the get() method on the None value, Python will raise an AttributeError: ‘NoneType’ object has no attribute ‘get’. The error can also happen if you have a method which returns an None instead of a dictionary or if we forget the return statement in the function as shown below.

Let us take a simple example to reproduce this error.

# Method return None instead of dict def fetch_data(): output = {"name": "Audi", "price": "$45000"} data = fetch_data() print(data.get("name"))

Output

AttributeError: 'NoneType' object has no attribute 'get'

In the above example, we have a method fetch_data() which returns an None instead of a dictionary because the return statement is missing.

Since we call the get() method on the None value, we get AttributeError.

We can also check if the variable type using the type() method, and using the dir() method, we can also print the list of all the attributes of a given object.

# Method return None instead of dict def fetch_data(): output = {"name": "Audi", "price": "$45000"} data = fetch_data() print("The type of the object is ", type(data)) print("List of valid attributes in this object is ", dir(data))

Output

The type of the object is <class 'NoneType'> List of valid attributes in this object is ['__bool__', '__class__', '__delattr__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__'] PS C:\Personal\IJS\Code> How to fix AttributeError: ‘NoneType’ object has no attribute ‘get’?

Let us see how we can resolve the error.

Solution 1 – Call the get() method on valid dictionary

We can resolve the error by calling the get() method on the valid dictionary object instead of the None type.

The dict.get() method returns the value of the given key. The get() method will not throw KeyError if the key is not present; instead, we get the None value or the default value that we pass in the get() method.

# Method return None instead of dict def fetch_data(): output = {"name": "Audi", "price": "$45000"} return output data = fetch_data() # Get the car Name print(data.get("name"))

Output

Audi Solution 2 – Check if the object is of type dictionary using type

Another way is to check if the object is of type dictionary; we can do that using the type() method. This way, we can check if the object is of the correct data type before calling the get() method.

# Method return None instead of dict def fetch_data(): output = {"name": "Audi", "price": "$45000"} return output data = fetch_data() # Check if the object is dict if (type(data) == dict): print(data.get("name")) softwares = None if (type(softwares) == dict): print(softwares.get("name")) else: print("The object is not dictionary and it is of type ", type(softwares))

Output

Audi The object is not dictionary and it is of type <class 'NoneType'> Solution 3 – Check if the object has get attribute using hasattr

Before calling the get() method, we can also check if the object has a certain attribute. Even if we call an external API which returns different data, using the hasattr() method, we can check if the object has an attribute with the given name.

# Method return None instead of dict def fetch_data(): output = {"name": "Audi", "price": "$45000"} return output data = fetch_data() # Check if the object is dict if (hasattr(data, 'get')): print(data.get("name")) # Incase of None value softwares = None if (hasattr(softwares, 'get')): print(softwares.get("name")) else: print("The object does not have get attribute")

Output

Audi The object does not have get attribute Conclusion

The AttributeError: ‘NoneType’ object has no attribute ‘get’ occurs when you try to call the get() method on the None type. The error also occurs if the calling method returns an None instead of a dictionary object.

We can resolve the error by calling the get() method on the dictionary object instead of an None. We can check if the object is of type dictionary using the type() method, and also, we can check if the object has a valid get attribute using hasattr() before performing the get operation.

Categories: FLOSS Project Planets

ItsMyCode: [Solved] AttributeError: &#8216;str&#8217; object has no attribute &#8216;get&#8217;

Planet Python - Wed, 2022-06-22 16:48

The AttributeError: ‘str’ object has no attribute ‘get’ mainly occurs when you try to call the get() method on the string data type. The attribute get() method is present in the dictionary and must be called on the dictionary data type.

In this tutorial, we will look at what exactly is AttributeError: ‘str’ object has no attribute ‘get’ and how to resolve this error with examples.

What is AttributeError: ‘str’ object has no attribute ‘get’?

If we call the get() method on the string data type, Python will raise an AttributeError: ‘str’ object has no attribute ‘get’. The error can also happen if you have a method which returns an string instead of a dictionary.

Let us take a simple example to reproduce this error.

# Method return string instead of dict def fetch_data(): output = "Toyota Car" return output data = fetch_data() print(data.get("name"))

Output

AttributeError: 'str' object has no attribute 'get'

In the above example, we have a method fetch_data() which returns an string instead of a dictionary.

Since we call the get() method on the string type, we get AttributeError.

We can also check if the variable type using the type() method, and using the dir() method, we can also print the list of all the attributes of a given object.

# Method return string instead of dict def fetch_data(): output = "Toyota Car" return output data = fetch_data() print("The type of the object is ", type(data)) print("List of valid attributes in this object is ", dir(data))

Output

The type of the object is <class 'str'> List of valid attributes in this object is ['__add__', '__class__', '__contains__', '__delattr__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__', '__getnewargs__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__iter__', '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', 'capitalize', 'casefold', 'center', 'count', 'encode', 'endswith', 'expandtabs', 'find', 'format', 'format_map', 'index', 'isalnum', 'isalpha', 'isascii', 'isdecimal', 'isdigit', 'isidentifier', 'islower', 'isnumeric', 'isprintable', 'isspace', 'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'maketrans', 'partition', 'removeprefix', 'removesuffix', 'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip', 'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title', 'translate', 'upper', 'zfill'] How to fix AttributeError: ‘str’ object has no attribute ‘get’?

Let us see how we can resolve the error.

Solution 1 – Call the get() method on valid dictionary

We can resolve the error by calling the get() method on the valid dictionary object instead of the string type.

The dict.get() method returns the value of the given key. The get() method will not throw KeyError if the key is not present; instead, we get the None value or the default value that we pass in the get() method.

# Method returns dict def fetch_data(): output = {"Name": "Audi", "Release_Date": "2022", "Price": "$45000"} return output data = fetch_data() # Get the car Name print(data.get("Name"))

Output

Audi Solution 2 – Check if the object is of type dictionary using type

Another way is to check if the object is of type dictionary; we can do that using the type() method. This way, we can check if the object is of the correct data type before calling the get() method.

# Method returns dict def fetch_data(): output = {"Name": "Audi", "Release_Date": "2022", "Price": "$45000"} return output data = fetch_data() # Check if the object is dict if (type(data) == dict): print(data.get("Name")) softwares = "Norton, Bit Defender" if (type(softwares) == dict): print(softwares.get("Name")) else: print("The object is not dictionary and it is of type ", type(softwares))

Output

Audi The object is not dictionary and it is of type <class 'str'> Solution 3 – Check if the object has get attribute using hasattr

Before calling the get() method, we can also check if the object has a certain attribute. Even if we call an external API which returns different data, using the hasattr() method, we can check if the object has an attribute with the given name.

# Method returns dict def fetch_data(): output = {"Name": "Audi", "Release_Date": "2022", "Price": "$45000"} return output data = fetch_data() # Check if the object has get attribute if (hasattr(data, 'get')): print(data.get("Name"))

Output

Audi Conclusion

The AttributeError: ‘str’ object has no attribute ‘get’ occurs when you try to call the get() method on the string data type. The error also occurs if the calling method returns an string instead of a dictionary object.

We can resolve the error by calling the get() method on the dictionary object instead of an string. We can check if the object is of type dictionary using the type() method, and also, we can check if the object has a valid get attribute using hasattr() before performing the get operation.

Categories: FLOSS Project Planets

ItsMyCode: [Solved] AttributeError: &#8216;float&#8217; object has no attribute &#8216;get&#8217;

Planet Python - Wed, 2022-06-22 16:07

The AttributeError: ‘float’ object has no attribute ‘get’ mainly occurs when you try to call the get() method on the float data type. The attribute get() method is present in the dictionary and must be called on the dictionary data type.

In this tutorial, we will look at what exactly is AttributeError: ‘float’ object has no attribute ‘get’ and how to resolve this error with examples.

What is AttributeError: ‘float’ object has no attribute ‘get’?

If we call the get() method on the float data type, Python will raise an AttributeError: ‘float’ object has no attribute ‘get’. The error can also happen if you have a method which returns an float instead of a dictionary.

Let us take a simple example to reproduce this error.

# Method return float instead of dict def fetch_data(): output = 44.55 return output data = fetch_data() print(data.get("price"))

Output

AttributeError: 'float' object has no attribute 'get'

In the above example, we have a method fetch_data() which returns an float instead of a dictionary.

Since we call the get() method on the float type, we get AttributeError.

We can also check if the variable type using the type() method, and using the dir() method, we can also print the list of all the attributes of a given object.

# Method return float instead of dict def fetch_data(): output = "Toyota Car" return output data = fetch_data() print("The type of the object is ", type(data)) print("List of valid attributes in this object is ", dir(data))

Output

The type of the object is <class 'float'> List of valid attributes in this object is ['__abs__', '__add__', '__bool__', '__ceil__', '__class__', '__delattr__', '__dir__', '__divmod__', '__doc__', '__eq__', '__float__', '__floor__', '__floordiv__', '__format__', '__ge__', '__getattribute__', '__getformat__', '__getnewargs__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__int__', '__le__', '__lt__', '__mod__', '__mul__', '__ne__', '__neg__', '__new__', '__pos__', '__pow__', '__radd__', '__rdivmod__', '__reduce__', '__reduce_ex__', '__repr__', '__rfloordiv__', '__rmod__', '__rmul__', '__round__', '__rpow__', '__rsub__', '__rtruediv__', '__set_format__', '__setattr__', '__sizeof__', '__str__', '__sub__', '__subclasshook__', '__truediv__', '__trunc__', 'as_integer_ratio', 'conjugate', 'fromhex', 'hex', 'imag', 'is_integer', 'real'] How to fix AttributeError: ‘float’ object has no attribute ‘get’?

Let us see how we can resolve the error.

Solution 1 – Call the get() method on valid dictionary

We can resolve the error by calling the get() method on the valid dictionary object instead of the float type.

The dict.get() method returns the value of the given key. The get() method will not throw KeyError if the key is not present; instead, we get the None value or the default value that we pass in the get() method.

# Method returns dict def fetch_data(): output = {"Name": "NordVPN", "Price": "22.22"} return output data = fetch_data() # Get the Price print(data.get("Price"))

Output

22.22 Solution 2 – Check if the object is of type dictionary using type

Another way is to check if the object is of type dictionary; we can do that using the type() method. This way, we can check if the object is of the correct data type before calling the get() method.

# Method returns dict def fetch_data(): output = {"Name": "NordVPN", "Price": "22.22"} return output data = fetch_data() # Get the Price if (type(data) == dict): print(data.get("Price")) else: print("The object is not dictionary and it is of type ", type(data))

Output

22.22 Solution 3 – Check if the object has get attribute using hasattr

Before calling the get() method, we can also check if the object has a certain attribute. Even if we call an external API which returns different data, using the hasattr() method, we can check if the object has an attribute with the given name.

# Method returns dict def fetch_data(): output = {"Name": "NordVPN", "Price": "22.22"} return output data = fetch_data() # Get the Price if (hasattr(data, 'get')): print(data.get("Price")) else: print("The object does not have get attribute")

Output

22.22 Conclusion

The AttributeError: ‘float’ object has no attribute ‘get’ occurs when you try to call the get() method on the floatdata type. The error also occurs if the calling method returns an float instead of a dictionary object.

We can resolve the error by calling the get() method on the dictionary object instead of an float. We can check if the object is of type dictionary using the type() method, and also, we can check if the object has a valid get attribute using hasattr() before performing the get operation.

Categories: FLOSS Project Planets

ItsMyCode: [Solved] AttributeError: &#8216;list&#8217; object has no attribute &#8216;get&#8217;

Planet Python - Wed, 2022-06-22 15:56

The AttributeError: ‘list’ object has no attribute ‘get’ mainly occurs when you try to call the get() method on the list data type. The attribute get() method is present in the dictionary and must be called on the dictionary data type.

In this tutorial, we will look at what exactly is AttributeError: ‘list’ object has no attribute ‘get’ and how to resolve this error with examples.

What is AttributeError: ‘list’ object has no attribute ‘get’?

If we call the get() method on the list data type, Python will raise an AttributeError: ‘list’ object has no attribute ‘get’. The error can also happen if you have a method which returns an list instead of a dictionary.

Let us take a simple example to reproduce this error.

# Method return list of dict def fetch_data(): cars = [ {'name': 'Audi', 'price': 45000}, {'name': 'Ferrari', 'price': 450000}, {'name': 'BMW', 'price': 55000}, ] return cars data = fetch_data() print(data.get("name"))

Output

AttributeError: 'list' object has no attribute 'get'

In the above example, we have a method fetch_data() which returns an list of dictionary object instead of a dictionary.

Since we call the get() method directly on the list type, we get AttributeError.

We can also check if the variable type using the type() method, and using the dir() method, we can also print the list of all the attributes of a given object.

# Method return list of dict def fetch_data(): cars = [ {'name': 'Audi', 'price': 45000}, {'name': 'Ferrari', 'price': 450000}, {'name': 'BMW', 'price': 55000}, ] return cars data = fetch_data() print("The type of the object is ", type(data)) print("List of valid attributes in this object is ", dir(data))

Output

The type of the object is <class 'list'> List of valid attributes in this object is ['__add__', '__class__', '__class_getitem__', '__contains__', '__delattr__', '__delitem__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__', '__gt__', '__hash__', '__iadd__', '__imul__', '__init__', '__init_subclass__', '__iter__', '__le__', '__len__', '__lt__', '__mul__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__reversed__', '__rmul__', '__setattr__', '__setitem__', '__sizeof__', '__str__', '__subclasshook__', 'append', 'clear', 'copy', 'count', 'extend', 'index', 'insert', 'pop', 'remove', 'reverse', 'sort'] How to fix AttributeError: ‘list’ object has no attribute ‘get’?

Let us see how we can resolve the error.

Solution 1 – Call the get() method on valid dictionary

We can resolve the error by calling the get() method on the valid dictionary object instead of the list type.

Since the data has a valid dictionary object inside the list, we can loop through the list and use the get() method on the dictionary elements.

The dict.get() method returns the value of the given key. The get() method will not throw KeyError if the key is not present; instead, we get the None value or the default value that we pass in the get() method.

# Method return list of dict def fetch_data(): cars = [ {'name': 'Audi', 'price': 45000}, {'name': 'Ferrari', 'price': 450000}, {'name': 'BMW', 'price': 55000}, ] return cars data = fetch_data() for item in data: print(item.get("name"))

Output

Audi Ferrari BMW

We can also use the generator expression, filter function to get specific dictionary element, or directly use the index of the list. Let us look at each of these with examples.

# Method return list instead of dict def fetch_data(): cars = [ {'name': 'Audi', 'price': 45000}, {'name': 'Ferrari', 'price': 450000}, {'name': 'BMW', 'price': 55000}, ] return cars data = fetch_data() # Generator expression to get specific element car_obj = next( (x for x in data if x['name'] == 'BMW'), {} ) print(car_obj) print("Car Name is ", car_obj.get("name")) print("Car Price is ", car_obj.get("price")) # Directly access the dictionary using the index of list print("The car name in index 0 is ", data[0].get("name"))

Output

{'name': 'BMW', 'price': 55000} Car Name is BMW Car Price is 55000 The car name in index 0 is Audi Solution 2 – Check if the object is of type dictionary using type

Another way is to check if the object is of type dictionary; we can do that using the type() method. This way, we can check if the object is of the correct data type before calling the get() method.

# Method return list of dict def fetch_data(): cars = [ {'name': 'Audi', 'price': 45000}, {'name': 'Ferrari', 'price': 450000}, {'name': 'BMW', 'price': 55000}, ] return cars # assigns the list of dict data = fetch_data() if (type(data) == dict): print(data.get("name")) else: print("The object is not dictionary and it is of type ", type(data)) # assign the index 0 dict my_car =data[0] if (type(my_car) == dict): print(my_car.get("name")) else: print("The object is not dictionary and it is of type ", type(my_car))

Output

The object is not dictionary and it is of type <class 'list'> Audi Solution 3 – Check if the object has get attribute using hasattr

Before calling the get() method, we can also check if the object has a certain attribute. Even if we call an external API which returns different data, using the hasattr() method, we can check if the object has an attribute with the given name.

# Method return list of dict def fetch_data(): cars = [ {'name': 'Audi', 'price': 45000}, {'name': 'Ferrari', 'price': 450000}, {'name': 'BMW', 'price': 55000}, ] return cars # assigns the list of dict data = fetch_data() if (hasattr(data, 'get')): print(data.get("name")) else: print("The object does not have get attribute") # assign the index 0 dict my_car = data[0] if (hasattr(my_car, 'get')): print(my_car.get("name")) else: print("The object does not have get attribute")

Output

The object does not have get attribute Audi Conclusion

The AttributeError: ‘list’ object has no attribute ‘get’ occurs when you try to call the get() method directly on the list data type. The error also occurs if the calling method returns an list instead of a dictionary object.

We can resolve the error by calling the get() method on the dictionary object by iterating the list instead of directly calling the get() method on an list. We can check if the object is of type dictionary using the type() method, and also, we can check if the object has a valid get attribute using hasattr() before performing the get operation.

Categories: FLOSS Project Planets

MiTubo comes to macOS

Planet KDE - Wed, 2022-06-22 15:44

I just released MiTubo 1.2. New in this version:

  • As suggested by alphas12 in the comments, I added the author name in the YouTube search results.
  • In the same results list, there's now a clickable link to the channel, which makes it easier to subscribe to it.
  • Improve layout of some pages on narrow displays (though there's still much to be done!).
  • Skip invoking youtube-dl if the video information is already encoded in the page HEAD meta properties.
  • Remember the preferred playback resolution; this can be helpful on low bandwith connections.
  • First macOS release!

While bringing in the macOS version, I updated the QScreenSaver library to support inhibiting the screensaver on macOS too.

I also tested the AppImage on openSUSE, and it seems to work fine there too. So, fewer and fewer people have valid excuses not to try out MiTubo!

Categories: FLOSS Project Planets

Pages