FLOSS Project Planets

Michal Čihař: Weblate 2.18

Planet Debian - Fri, 2017-12-15 08:30

Weblate 2.18 has been released today. The biggest improvement is probably reviewer based workflow, but there are some other enhancements as well.

Full list of changes:

  • Extended contributor stats.
  • Improved configuration of special chars virtual keyboard.
  • Added support for DTD file format.
  • Changed keyboard shortcuts to less likely collide with browser/system ones.
  • Improved support for approved flag in Xliff files.
  • Added support for not wrapping long strings in Gettext po files.
  • Added button to copy permalink for current translation.
  • Dropped support for Django 1.10 and added support for Django 2.0.
  • Removed locking of translations while translating.
  • Added support for adding new units to monolingual translations.
  • Added support for translation workflows with dedicated reviewers.

If you are upgrading from older version, please follow our upgrading instructions.

You can find more information about Weblate on https://weblate.org, the code is hosted on Github. If you are curious how it looks, you can try it out on demo server. You can login there with demo account using demo password or register your own user. Weblate is also being used on https://hosted.weblate.org/ as official translating service for phpMyAdmin, OsmAnd, Turris, FreedomBox, Weblate itself and many other projects.

Should you be looking for hosting of translations for your project, I'm happy to host them for you or help with setting it up on your infrastructure.

Further development of Weblate would not be possible without people providing donations, thanks to everybody who have helped so far! The roadmap for next release is just being prepared, you can influence this by expressing support for individual issues either by comments or by providing bounty for them.

Filed under: Debian English SUSE Weblate

Categories: FLOSS Project Planets

Agiledrop.com Blog: AGILEDROP: What makes Drupal SEO friendly

Planet Drupal - Fri, 2017-12-15 06:51
To achieve the highest ranking in the search engine, the website has to be SEO friendly. Google SERP (Search Engine Results Page) has one of the most important roles growing businesses with the help of a website. Drupal is a very powerful system that ensures search website optimization with its modules. It gives us the ability to control all the elements of the web pages with the help of already installed automation tools for SEO, which places it at the very top of SEO friendly CMSs. Let's look at some examples.   SEO-friendly URLs Because search engines search for keywords in URLs, they… READ MORE
Categories: FLOSS Project Planets

Amazee Labs: Estimations - Amazee Agile Agency Survey Results - Part 7

Planet Drupal - Fri, 2017-12-15 05:46
Estimations - Amazee Agile Agency Survey Results - Part 7

This is part 7 of our series processing the results of the Amazee Agile Agency Survey. Previously I wrote about defining work, this time let’s focus on estimations. How do you estimate and who does estimations in your teams?

Josef Dabernig Fri, 12/15/2017 - 11:46

First, we asked about how teams estimate. 43.3% of the contestants answered “Estimation is done in days/hours”, 20% say “Estimation is done in story points based on complexity” and 16.7% mentioned, “Estimations in done in story points based on effort”. The remaining answers of 3% each varied in different degrees of combined estimations, i.e. teams would estimate on a higher level using story points and compare then against hour based task estimations. Also one of the 30 contestants answered that they don’t do estimates at all. For some background information, you can refer to this article on story points.

At Amazee we do two different kinds of estimations. We estimate in days for the offers that we create and put a general price tag below the contract. This is intended to fix a budget but not to guarantee an exact feature set to be delivered. When we go to the implementation phase, teams estimate Jira tickets using story points. The story points are based both on complexity and effort, based on our velocity we can related story points to a price tag and compare against the initial offer and how much budget is left.

We also asked about who is involved in estimation. 50% say that “the entire team does all estimations”, 36.7% mentioned that “a tech lead does high-level estimates, the team estimates on a lower level”. 6.7% say that “a tech lead does all estimates”.

For us, at Amazee we tend towards having a tech lead doing high-level estimates and having the team estimate on individual stories and tasks which get prepared for a sprint to work. The tech lead role can be fulfilled by any developer of a Scrum team and may change however the team and the team lead decide it would work best. More complex offers get challenged by multiple developers, more straightforward suggestions will be estimated by only one developer together with the PO. All proposals get reviewed by management. When the team does estimations, we do them along with the entire Scrum team. In some instances, we will limit the number of people in estimation meetings to find a balance between shared knowledge and how much time can be spent discussing as a group of people.

How do you estimate? Please leave us a comment below. If you are interested in Agile Scrum training, don’t hesitate to contact us.

Stay tuned for the next post where we’ll look at client interactions.

Categories: FLOSS Project Planets

Programiz: Python Arrays

Planet Python - Fri, 2017-12-15 05:15
In this article, you’ll learn about python array. Before getting started, you should be familiar with python, variables and datatypes.
Categories: FLOSS Project Planets

Dimitri John Ledkov: What does FCC Net Neutrality repeal mean to you?

Planet Debian - Fri, 2017-12-15 04:09
Sorry, the web page you have requested is not available through your internet connection.We have received an order from the Courts requiring us to prevent access to this site in order to help protect against Lex Julia Majestatis infridgement.If you are a home broadband customer, for more information on why certain web pages are blocked, please click here.If you are a business customer, or are trying to view this page through your company's internet connection, please click here.
Categories: FLOSS Project Planets

Kdenlive 17.12.0 released

Planet KDE - Fri, 2017-12-15 03:45

We are happy to announce the latest Kdenlive version, part of the KDE Applications 17.12 release, making it the last major release using the current code base. This is a maintenance release focused on stability, while feature development is going in next year’s 18.04 version. Proxy clips were given some attention and should give you better seeking experience as well as reduced memory usage for images. Other fixes include fixes in timeline preview, a crash when using a Library clip and smoother seeking on rewind playback.

We have been pushing the AppImage packages lately because it allow us to put all required dependencies inside one file that can easily be downloaded and run on all linux distros. Today, we can also announce the immediate availability of the Kdenlive 17.12 AppImage, downloadable here :

AppImage related fixes:

  • Fix audio distortion affecting the 17.08.3 AppImage
  • Include Breeze style

Vincent Pinon is also continuing the support for the Windows version, and you can get Kdenlive 17.12 for Windows here: https://files.kde.org/kdenlive/release/Kdenlive-17.12.0-w64.7z.mirrorlist

We are also making available the first usable “preview” AppImage of the refactoring branch which will receive all development focus from now and will be released as 18.04. It is not ready for production but allows you to have a look at Kdenlive’s future. You may follow the development progress here.

Kdenlive 18.04 alpha 2 release: https://files.kde.org/kdenlive/unstable/kdenlive-18.04-alpha2.AppImage.mirrorlist

Meet us:
Next Kdenlive Café is tonight on #kdenlive at 21PM (CET), so feel free to join us for some feedback!



  • Packagers must take note that libsamplerate is now a dependency due to recent changes in FFMPEG.
  • It is recommended for Ubuntu (and derivatives) users to use the AppImage version until further notice.


Full list of changes

  • Remove useless audio bitrate on pcm proxy encoding. Commit.
  • Update proxy profiles. Commit.
  • Make sure playlist proxies have an even height. Commit.
  • Fix crash on playlists concurrent jobs using library clips. Commit. See bug #386616
  • Timeline preview fixes: Don’t invalidate on expand/collapse effect, invalidate on master clip edit. Commit.
  • Don’t restart clip if trying to play backwards from clip monitor end. Commit.
  • Use smaller size for image proxies. Commit. Fixes bug #353577
  • Fix playing backwards forwards one second. Commit. Fixes bug #375634
  • Fix extension in transcode file dialog. Commit.
  • Sort clip zones by position instead of name. Commit.
  • Set a proper desktop file name to fix an icon under Wayland. Commit.
  • FreeBSD does not have sys/asm.h — for what is this include needed on linux?. Commit.
  • Doc: fix option (qwindowtitle instead of caption). Commit.
  • Fix terminology: mimetype(s) -> MIME type(s). Commit.
  • Fix UI string: Control Center -> System Settings. Commit.
  • Const’ify code. Commit.
  • Fix import image sequence. Commit.
Categories: FLOSS Project Planets

Urvika Gola: KubeCon + CloudNativeCon, Austin

Planet Debian - Fri, 2017-12-15 02:50

KubeCon + CloudNativeCon, North America took place in Austin, Texas from 6th to 8th December. But before that, I stumbled upon this great opportunity by Linux Foundation which would make it possible for me to attend and expand my knowledge about cloud computing, containers and all things cloud native!

I would like to thank the diversity committee members – @michellenoorali ,  @Kris__Nova, @jessfraz , @evonbuelow and everyone (+Wendy West!!) behind this for making it possible for me and others by going extra miles to achieve the greatest initiative for diversity inclusion. It gave me an opportunity to learn from experts and experience the power of Kubernetes.

After travelling 23+ in flight, I was able to attend the pre-conference sessions on 5th December. The day concluded with amazing Empower Her Evening Event where I met some amazing bunch of people! We had some great discussions and food, Thanks

With diversity scholarship recipients at EmpowerHer event (credits – Radhika Nair)

On 6th December, I was super excited to attend Day 1 of the conference, when I reached at the venue, Austin Convention Center, there was a huge hall with *4100* people talking about all things cloud native!

It started with informational KeyNote by Dan Kohn, the Executive Director of Cloud Native Computing Foundation. He pointed out how CNCF has grown over the year, from having 4 projects in 2016 to 14 projects in 2017. From having 1400 Attendees in March 2017 to 4100 Attendees in December 2017. It was really thrilling to know about the growth and power of Kubernetes, which really inspired me to contribute towards this project.

Dan Kohn Keynote talk at KubeCon+CloudNativeCon

It was hard to choose what session to attend because there was just so much going on!! I attended sessions mostly which were beginner & intermediate level. Missed out on the ones which required technical expertise I don’t possess, yet! Curious to know more about other tech companies working on, I made sure I visited all sponsor booths and learn what technology they are building. Apart from that they had cool goodies and stickers, the place where people are labelled at sticker-person or non-sticker-person!

Categories: FLOSS Project Planets

Mike Driscoll: Flask 101: Filtering Searches and Deleting Data

Planet Python - Fri, 2017-12-15 01:05

Last time we got our Flask based music database application partially functional. It could now add data to the database, edit said data and also display everything in the database. But we didn’t cover how to filter the data by using the user’s filter choice (Artist, Album name or publisher name) and search string. We also didn’t cover how to delete items from the database. That is the two-fold goal of this article.

Filtering Search Results

Filtering search results using SQLAlchemy (via Flask-SQLAlchemy) is actually quite easy. All you need to do is create some very simple query objects. Open up the main.py file that we were editing last time and replace the search_results() function with the following version of the code:

@app.route('/results') def search_results(search): results = [] search_string = search.data['search']   if search_string: if search.data['select'] == 'Artist': qry = db_session.query(Album).filter( Artist.name.contains(search_string)) elif search.data['select'] == 'Album': qry = db_session.query(Album).filter( Album.title.contains(search_string)) elif search.data['select'] == 'Publisher': qry = db_session.query(Album).filter( Album.publisher.contains(search_string)) else: qry = db_session.query(Album) else: qry = db_session.query(Album)   results = qry.all()   if not results: flash('No results found!') return redirect('/') else: # display results table = Results(results) table.border = True return render_template('results.html', table=table)

Here we added a somewhat lengthy conditional if statement. We first check to see if the user has entered a search string in the search text box. If so, then we check to see which filter the user has chosen from the combobox: Artist, Album or Publisher. Depending on the user’s choice, we create a custom SQLAlchemy query. If the user doesn’t enter a search term or if our web application gets confused and doesn’t recognize the user’s filter choice, then we do a query against the full database. This is something that probably shouldn’t be done in production as if the database gets really large, then doing a query against your database will end up making your web application unresponsive. You can simply add some validation to your form’s input to prevent this from happening (i.e. don’t query the database with an empty search string). However we won’t be covering that here.

Anyway, go ahead and try this code out and see how it works. I tried several different search terms and it seemed to work fine for my use cases. You will note that I simply used the contains method which is great for looking up a string in a table’s column. You can always index your database and do other various optimizations to it including making these queries a lot more focused if you want to. Feel free to play around with this code and see how you can improve it.

Now we will move on and learn how to delete items from the database!

Deleting Data

There are times when you enter something into the database that you just want to delete. Technically you could use our editing functionality to just edit the entry to whatever you want, but sometimes you just need to purge data permanently. So the first thing we need to do is add a Delete column to our results table. You will want to open up tables.py and add a new LinkCol instance to the Results class:

from flask_table import Table, Col, LinkCol   class Results(Table): id = Col('Id', show=False) artist = Col('Artist') title = Col('Title') release_date = Col('Release Date') publisher = Col('Publisher') media_type = Col('Media') edit = LinkCol('Edit', 'edit', url_kwargs=dict(id='id')) delete = LinkCol('Delete', 'delete', url_kwargs=dict(id='id'))

Just as we did when we created the link for editing our data, we add a new link for deleting the data. You will note that the second argument, which is the endpoint, points to a delete function. So the next step is to open up our main.py file and add said delete() function:

@app.route('/delete/<int:id>', methods=['GET', 'POST']) def delete(id): """ Delete the item in the database that matches the specified id in the URL """ qry = db_session.query(Album).filter( Album.id==id) album = qry.first()   if album: form = AlbumForm(formdata=request.form, obj=album) if request.method == 'POST' and form.validate(): # delete the item from the database db_session.delete(album) db_session.commit()   flash('Album deleted successfully!') return redirect('/') return render_template('delete_album.html', form=form) else: return 'Error deleting #{id}'.format(id=id)

This code is actually pretty similar to our edit() function from the last article. You will note that we updated the route though. So instead of specifying ‘/item/‘, we made it ‘/delete/‘. This makes the URLS between the two functions different so they actually execute the correct function when the link is clicked on. The other difference is that we don’t need to create a special saving function here. We just reference the db_session object directly and tell it to remove the album if it’s found in the database and then commit our changes.

If you run the code, you should see something like the following when doing an empty string search:

The last thing we need to do is create the delete_album.html that we referenced above. Let’s create that file and save it to our templates folder. Once that file is created, just add the following:

<doctype html> <title>Delete Album - Flask Music Database</title> <h2>Delete Album</h2>   {% from "_formhelpers.html" import render_field %} <form method=post> <dl> {{ render_field(form.artist) }} {{ render_field(form.title) }} {{ render_field(form.release_date) }} {{ render_field(form.publisher) }} {{ render_field(form.media_type) }} </dl> <p><input type=submit value=Delete> </form>

This code will render our form to show the user what they are deleting. Let’s try clicking on the delete link for one of the duplicates in our table. You should see a screen like this appear:

When you press the Delete button, it will redirect you to the home page where you will see a message that the item was deleted successfully:

To verify that the deletion worked, just do another empty string search. Your results should show one less item in the table:

Wrapping Up

Now you should know how to do some basic filtering of search results from the database. You also have learned how to successfully delete items from the database in your Flask application. There are several places in the code that could use a refactoring and general cleanup. You could also add some CSS styling to your application to make it look prettier. Those are exercises that I will leave for the reader. Have fun playing around with the code and giving Flask a try. It’s a neat little web framework and well worth a look!

Download Code

Download a tarball of the code from this article: flask_music_db_v.tar

Other Articles in the Series

Categories: FLOSS Project Planets

Bryan Pendleton: Yes

Planet Apache - Thu, 2017-12-14 22:55

Yes, yes, yes, yes, yes, yes.


Yes, yes, yes.

And, at the very end, the very last line, most definitely: yes.

Categories: FLOSS Project Planets

Bryan Pendleton: The Likeness: a very short review

Planet Apache - Thu, 2017-12-14 21:54

The Likeness is the second in Tana French's Dublin Murder Squad series of mystery novels.

Although The Likeness is not quite as great as French's thoroughly superb first book, it is still quite good indeed, and I devoured it apace.

The characters are fascinating; the scenario is very intriguing; the pacing and reveal is just right.

But perhaps most importantly, French's wonderfully lyrical touch again does not fail her.

Here we are, mid-story, just as our hero is learning something new about a crucial character:

The garden dumbstruck, in the fading gold light. The birds hushed, the branches caught in midsway; the house, a great silence poised over us, listening. I had stopped breathing. Lexie blew down the grass like a silver shower of wind, she rocked in the hawthorn trees and balanced light as a leaf on the wall beside me, she slipped along my shoulder and blazed down my back like fox fire.

I love the way this passage depicts how "time stops" sometimes, when you suddenly realize something new.

I love the way this passage depicts the way that evidence can have a voice of its own, making inanimate artifacts come to life.

I love the way this passage evokes the spirit of a departed human soul, simultaneously here and not here.

And I love the beautiful way she makes us feel our own spine tingle.

There's plenty of good solid policework, of course. And plenty of action, and plenty of evidence, and plenty of mystery.

But there's a wonderful amount of this, too:

I listened to the static echoing in my ear and thought of those herds of horses you get in the vast wild spaces of America and Australia, the ones running free, fighting off bobcats or dingoes and living lean on what they find, gold and tangled in the fierce sun. My friend Alan from when I was a kid, he worked on a ranch in Wyoming one summer, on a J1 visa. He watched guys breaking those horses. He told me that every now and then there was one that couldn't be broken, one wild to the bone. Those horses fought the bridle and the fence till they were ripped up and streaming blood, till they smashed their legs or their necks to splinters, till they died of fighting to run.

Of course, she isn't really talking about horses at all.

I can't wait to read more of her books.

Categories: FLOSS Project Planets

KDE Partition Manager 3.3 and future work

Planet KDE - Thu, 2017-12-14 20:04

KDE Partition Manager 3.3 is now ready. It includes some improvements for Btrfs, F2FS, NTFS file systems. I even landed the first bits of new LUKS2 on-disk format support, now KDE Partition Manager can display LUKS2 labels. More LUKS2 work will follow in KPM 3.4. There were changes in how LVM devices are detected. So now Calamares installer should be able to see LVM logical volumes. Once my pull request lands, Calamares should also support partitioning operations on LVM logical volumes (although Calamares would need more work before installation and booting from root file system on LVM works. I tested Calamares with KPMcore 3.3 and it successfully installed rootfs in LVM volume and successfully booted). KPMcore library now only depends on Tier 1 Frameworks instead of Tier 3 (although, we will later require Tier 2).

Most of the work is now done in sfdisk branch.  Currently, the only functional KDE Partition Manager backend uses libparted but sfdisk backend is now fully working (I would say RC quality). I would have merged in already but it requires util-linux 2.32 which is not yet released.

Yet another branch on top of sfdisk is KAuth branch which allows KPM to run as unprivileged user and uses Polkit when necessary to gain root rights. Everything except SMART support is working. To get SMART working too we would have to port away from (unmaintained) libatasmart to calling smartctl. Feel free to help! It should be fairly easy task but somebody has to do the work. Other than that you can already perform all partitioning operations using KAuth with one caveat. Right now KPM calls KAuth helper many times while performing partitioning operations. It can happen that KAuth authorization will expire in the meantime (KAuth remembers it for about 5 minutes) and KAuth will request a user to enter root password. If the user enters correct password, operation would finish. However, if authorization is not granted we may end up with half completed operation. And of course we don’t want to leave partition half moved, the data will almost surely be lost (half-resized partition is probably okay…). I suppose we can fix this by refactoring KPM operation runner, so that it calls KAuth helper just once with a list of all commands that have to be run. Unfortunately, this KPM Operation Runner refactoring might be bigger than what I would like, as significant changes would be necessary in partition data copying code. Maybe GSoC project then… Or ar there any better ideas on how to prevent KAuth authorization dialog in the middle of partitioning operations?

You can grab tarballs from standard locations on download.kde.org server.

Categories: FLOSS Project Planets

Sean Whitton: A second X server on vt8, running a different Debian suite

Planet Debian - Thu, 2017-12-14 19:18
Two tensions
  1. Sometimes the contents of the Debian archive isn’t yet sufficient for working in a software ecosystem in which I’d like to work, and I want to use that ecosystem’s package manager which downloads the world into $HOME – e.g. stack, pip, lein and friends.

    But I can’t use such a package manager when $HOME contains my PGP subkeys and other valuable files, and my X session includes Firefox with lots of saved passwords, etc.

  2. I want to run Debian stable on my laptop for purposes of my day job – if I can’t open Emacs on a Monday morning, it’s going to be a tough week.

    But I also want to do Debian development on my laptop, and most of that’s a pain without either Debian testing or Debian unstable.

The solution

Have Propellor provision and boot a systemd-nspawn(1) container running Debian unstable, and start a window manager in that container with $DISPLAY pointing at an X server in vt8. Wooo!

In more detail:

  1. Laptop runs Debian stable. Main account is spwhitton.
  2. Achieve isolation from /home/spwhitton by creating a new user account, spw, that can’t read /home/spwhitton. Also, in X startup scripts for spwhitton, run xhost -local:.
  3. debootstrap a Debian unstable chroot into /var/lib/container/develacc.
  4. Install useful desktop things like task-british-desktop into /var/lib/container/develacc.
  5. Boot /var/lib/container/develacc as a systemd-nspawn container called develacc.
  6. dm-tool switch-to-greeter to start a new X server on vt8. Login as spw.
  7. Propellor installs a script enter-develacc which uses nsenter(1) to run commands in the develacc container. Create a further script enter-develacc-i3 which does

    /usr/local/bin/enter-develacc sh -c "cd ~spw; DISPLAY=$1 su spw -c i3"
  8. Finally, /home/spw/.xsession starts i3 in the chroot pointed at vt8’s X server:

    sudo /usr/local/bin/enter-develacc-i3 $DISPLAY
  9. Phew. May now pip install foo. And Ctrl-Alt-F7 to go back to my secure session. That session can read and write /home/spw, so I can dgit push etc.

The Propellor configuration develaccProvisioned :: Property (HasInfo + DebianLike) develaccProvisioned = propertyList "develacc provisioned" $ props & User.accountFor (User "spw") & Dotfiles.installedFor (User "spw") & User.hasDesktopGroups (User "spw") & withMyAcc "Sean has 'spw' group" (\u -> tightenTargets $ User.hasGroup u (Group "spw")) & withMyHome "Sean's homedir chmodded" (\h -> tightenTargets $ File.mode h 0O0750) & "/home/spw" `File.mode` 0O0770 & "/etc/sudoers.d/spw" `File.hasContent` ["spw ALL=(root) NOPASSWD: /usr/local/bin/enter-develacc-i3"] & "/usr/local/bin/enter-develacc-i3" `File.hasContent` [ "#!/bin/sh" , "" , "echo \"$1\" | grep -q -E \"^:[0-9.]+$\" || exit 1" , "" , "/usr/local/bin/enter-develacc sh -c \\" , "\t\"cd ~spw; DISPLAY=$1 su spw -c i3\"" ] & "/usr/local/bin/enter-develacc-i3" `File.mode` 0O0755 -- we have to start xss-lock outside of the container in order that it -- can interface with host logind & "/home/spw/.xsession" `File.hasContent` [ "if [ -e \"$HOME/local/wallpaper.png\" ]; then" , " xss-lock -- i3lock -i $HOME/local/wallpaper.png &" , "else" , " xss-lock -- i3lock -c 3f3f3f -n &" , "fi" , "sudo /usr/local/bin/enter-develacc-i3 $DISPLAY" ] & Systemd.nspawned develAccChroot & "/etc/network/if-up.d/develacc-resolvconf" `File.hasContent` [ "#!/bin/sh" , "" , "cp -fL /etc/resolv.conf \\" ,"\t/var/lib/container/develacc/etc/resolv.conf" ] & "/etc/network/if-up.d/develacc-resolvconf" `File.mode` 0O0755 where develAccChroot = Systemd.debContainer "develacc" $ props -- Prevent propellor passing --bind=/etc/resolv.conf which -- - won't work when system first boots as WLAN won't be up yet, -- so /etc/resolv.conf is a dangling symlink -- - doesn't keep /etc/resolv.conf up-to-date as I move between -- wireless networks ! Systemd.resolvConfed & osDebian Unstable X86_64 & Apt.stdSourcesList & Apt.suiteAvailablePinned Experimental 1 -- use host apt cacher (we assume I have that on any system with -- develaccProvisioned) & Apt.proxy "http://localhost:3142" & Apt.installed [ "i3" , "task-xfce-desktop" , "task-british-desktop" , "xss-lock" , "emacs" , "caffeine" , "redshift-gtk" , "gnome-settings-daemon" ] & Systemd.bind "/home/spw" -- note that this won't create /home/spw because that is -- bind-mounted, which is what we want & User.accountFor (User "spw") -- ensure that spw inside the container can read/write ~spw & scriptProperty [ "usermod -u $(stat --printf=\"%u\" /home/spw) spw" , "groupmod -g $(stat --printf=\"%g\" /home/spw) spw" ] `assume` NoChange Comments

I first tried using a traditional chroot. I bound lots of /dev into the chroot and then tried to start lightdm on vt8. This way, the whole X server would be within the chroot; this is in a sense more straightforward and there is not the overhead of booting the container. But lightdm refuses to start.

It might have been possible to work around this, but after reading a number of reasons why chroots are less good under systemd as compared with sysvinit, I thought I’d try systemd-nspawn, which I’ve used before and rather like in general. I couldn’t get lightdm to start inside that, either, because systemd-nspawn makes it difficult to mount enough of /dev for X servers to be started. At that point I realised that I could start only the window manager inside the container, with the X server started from the host’s lightdm, and went from there.

The security isn’t that good. You shouldn’t be running anything actually untrusted, just stuff that’s semi-trusted.

  • chmod 750 /home/spwhitton, xhost -local: and the argument validation in enter-develacc-i3 are pretty much the extent of the security here. The containerisation is to get Debian sid on a Debian stable machine, not for isolation

  • lightdm still runs X servers as root even though it’s been possible to run them as non-root in Debian for a few years now (there’s a wishlist bug against lightdm)

I now have a total of six installations of Debian on my laptop’s hard drive … four traditional chroots, one systemd-nspawn container and of course the host OS. But this is easy to manage with propellor!


Screen locking is weird because logind sessions aren’t shared into the container. I have to run xss-lock in /home/spw/.xsession before entering the container, and the window manager running in the container cannot have a keybinding to lock the screen (as it does in my secure session). To lock the spw X server, I have to shut my laptop lid, or run loginctl lock-sessions from my secure session, which requires entering the root password.

Categories: FLOSS Project Planets

Justin Mason: Links for 2017-12-14

Planet Apache - Thu, 2017-12-14 18:58
Categories: FLOSS Project Planets

Last Weeks Activity in Elisa

Planet KDE - Thu, 2017-12-14 15:26

Elisa is a music player designed to be simple and nice to use. It allows to browse music by album, artist or all tracks. You can build and play your own playlist. We aim to build a fluid interface that is easy to use.

Alexander has made yet another round of improvements to the UI and especially improved a lot the playlist by making it more fluid. It really feels much better now (at least for me).

I have added the possibility to load or save playlists. It is currently restricted to tracks already known to Elisa. More work is needed to support any audio files.

Current state of the interface.

The following things have been integrated in Elisa git repository:

  • delete outdated todo list by Alexander Stippich ;
  • fix player being stuck when same track is played in random mode by Matthieu Gallien ;
  • enhance content view navigation by Alexander Stippich:
    • The backspace key is now also accepted for back navigation in e.g. the artist album view ;
    • A mouse area is added to MediaBrowser to allow back navigation with the mouse backbutton ;
    • Focus is forced on the stackview when arist or album is opened. Without this, the back key navigation is only working when it is actively focused by the user, e.g. by a mouse click ;
  • deduplicate code for the content view and adjust visual appearance by Alexander Stippich ;
  • merge MediaPlayList and PlayListControler to reduce size of code by Matthieu Gallien ;
  • make margins consistent and remove horizontal separator in playlist by Alexander Stippich ;
  • show passive notification when a track fail to play by Matthieu Gallien ;
  • remove context menus by Alexander Stippich ;
  • overhaul RatingStar by Alexander Stippich ;
  • add possibility to load and save a playlist at format m3u from two buttons at bottom of playlist by Matthieu Gallien ;
  • fix problems with dependencies and make some optional ones be required. Require all tier1 dependencies if they are also supported on Windows and
    Android by Matthieu Gallien ;
  • more improvements to playlist by Alexander Stippich:
    • Some more improvements to the playlist. First of all, adds more animations and fixes T6295.
    • Fixes some scaling issues and makes Show Current Track also select the item to highlight it better.
    • Converts actions to use signals
  • shorten the play now and replace play list button text by Alexander Stippich;
  • add a readme for packagers following some feedback in #kde-devel by Matthieu Gallien ;

Categories: FLOSS Project Planets

Python Engineering at Microsoft: Python extension for Visual Studio Code version 0.9.0 now available

Planet Python - Thu, 2017-12-14 14:07

We’re excited to announce our first update to the Microsoft Python extension for Visual Studio Code. In this release, we’ve added additional support for conda environments and fixed numerous bugs in the editor and debugger.

Support for Conda Environments

Conda environments are now automatically detected from the Anaconda root location. You also have the option of using conda to install Pylint:

The extension now has schema support for various YAML files that conda uses: meta.yml, .condarc, and environment.yml. This means that if you use the YAML extension you will now get auto-complete in these files. Similarly, if you use the YAML Support by Red Hat extension you now get auto-complete and type checking.

Editor and Debugger Improvements

A total of 84 issues have been closed since our first release, most of these are bugs fixed in the debugger and editor that were filed by you on GitHub. A couple of notable ones are:

  • Ctrl+F5 was sometimes not working (#25)
  • IntelliSense interrupting typing in inside of strings and comments (#110, #34)

We’ve also removed the python.formatting.formatOnSave and python.linting.lintOnTextChange configuration options  in favor of the equivalent general VS Code settings. If you’re using this feature be sure to change to using the editor.formatOnSave option.

For more information, you can look at the full list of changes in the 0.9.0 release. Be sure to update to the latest VS Code extensions, and let us know if you find any problems by creating issues on our vscode-python GitHub page.

Categories: FLOSS Project Planets

DrupalBASE: The information itself is useless

Planet Drupal - Thu, 2017-12-14 13:58

The information itself is useless.

Quite original start for a web-published text, isn't it? Still the confirmation is true. Solutions don't demand information, solutions demand clearly organized data. No matter what is the domain – in every situation people tend to organize data in a readable well-understandable formats.

Multiple mechanisms of collecting and storing the data are developed, and technologies continue to progress. But the key question of data presentation often remains ignored.

Categories: FLOSS Project Planets

WeKnow: How we approached building the new weKnow site

Planet Drupal - Thu, 2017-12-14 13:39
How we approached building the new weKnow site

It’s been a little over a year since weKnow came to life as a rebranding for Anexus, which allowed me to join the company as a new business partner. My main goal within the company is directing our efforts to explore new fields and technologies (that’s right, we are not just a Drupal shop anymore!)

As a web solution provider, having a website that accurately reflects what we do is a challenging task, because usually our plate is full with client work, and it’s not uncommon to put your own website at the end of the queue. This is why last year we decided to put together a basic landing page while setting aside some time to work on the company image as part of the rebranding.

jmolivas Thu, 12/14/2017 - 18:39
Categories: FLOSS Project Planets

Codementor: How I learned Selenium

Planet Python - Thu, 2017-12-14 12:41
About me I am a Python developer based in Nepal who's been working in this stack for almost 3 years. I love new challenges when it comes to creating things and experimenting with code to make...
Categories: FLOSS Project Planets

Stack Abuse: Formatting Strings with Python

Planet Python - Thu, 2017-12-14 10:46

Sooner or later string formatting becomes a necessary evil for most programmers. More so in the past before the thick client GUI era, but the need to have a specific string representation is still a common enough use case. My first introduction was back in college when I had an old-school prof that had a impure love for making us write Java console applications with neurotic specifications for outputting with the printf(...) function. One thing that held true then and still does now is that the documentation for string formatting (practically for all languages) leaves a lot to be desired. I hope to ease this pain today by writing about how to accomplish string formatting in Python.

In Python there happens to be multiple techniques for formatting strings, four to be exact. Interestingly this kinda goes against the grain of the Python mindset that there should generally be one clear best way to accomplish a task. However, if you have spent any reasonable amount of time with the language you have likely seen these disparate array of techniques and wondered, "what's the deal with all these?".

Run-Through of the Four String Formatting Techniques

Let's start off with the most commonly seen method which uses the % operator. I say the most common simply because it has been around the longest and you see it all over the place (books, blog posts, Stack Overflow, etc...). To utilize this method you specify a placeholder in a string using %s for strings and %d for numbers.

>>> "Hello reader, welcome to the %s form of string formatting." % 'modulus' 'Hello reader, welcome to the modulus form of string formatting.' >>> >>> "Formatting multiple (%d, %d, %d, ...) values requires a %s." % (1, 2, 3, 'tuple') 'Formatting multiple (1, 2, 3, ...) values requires a tuple.' >>> >>> print("""If you prefer named placeholders for values %(one)d, %(two)d, ... %(three)d ... you can use a dict""" % {'one':1, 'two':2, 'three':3}) If you prefer named placeholders for values 1, 2, 3 ... you can use a dict

The next technique to cover is the str.format(...) method. This was intended to be the replacement for the % style shown previously. This technique uses the curly brackets {} designator to specify where and how to format a value into a string.

>>> "Hello reader, welcome to the {} form of string formatting".format('str.format(...)') 'Hello reader, welcome to the str.format(...) form of string formatting' >>> >>> print("""Formatting multiple ({0}, {1}, {2}, ...) values requires ... that you use multiple {3} brackets and optionally specify ordering ... values.""".format(1,2,3,'{}')) Formatting multiple (1, 2, 3, ...) values requires that you use multiple {} brackets and optionally specify ordering values. >>> >>> print("""The {language} str.format() method also allows you to use ... named parameters which help keep code {adjective} ... """.format(language='Python', adjective='concise')) The Python str.format() method also allows you to use named parameters which help keep code concise

Then there is the string Template technique, which is a class in the string module. This method of string formatting is a bit more verbose and doesn't support type specifiers (s, d, f, etc...), unlike the previous two. With this technique you specify the placeholder in a string by prefixing the desired value with a $ in the constructor of the Template(...) class, then you call a substitute(...) method on the instantiated object with a named parameter. This method is far less common due to its reduced power and flexibility.

>>> from string import Template >>> tmpl = Template("Hello my name is $name") >>> tmpl.substitute(name='Adam') 'Hello my name is Adam'

The last technique, and most recent implementation which is only available in Python 3.6, is known as string interpolation. This has similarities to the Javascript ES6 template string. String interpolations requires that the string literal be prefixed with an f"" and allows for both expressions and variables to be specified directly within the string as long they are surrounded by {} brackets.

>>> method="String Interpolation" >>> f"Hello reader, I am the {method} of formatting" 'Hello reader, I am the String Interpolation of formatting' >>> >>> f"With this method you can have expressions like {{1 + 1}} = {1 + 1}" 'With this method you can have expressions like {1 + 1} = 2' Digging Deeper into String Formatting

In the following sections I am going to restrict the discussion to only the str.format() method and f"" interpolation technique as they are the preferred methods for formatting strings. The topics I would like to dig deeper into include:

  1. Text alignment
  2. Formatting numerics
  3. Type conversions

Both the str.format() and interpolation techniques share the same syntax for defining the formatting between the {} brackets which make use of the : to separate named or ordinal identifiers to the left and formatting specifications to the right.

Text Alignment

You can align values within a specified length of text by using the <, >, or ^ symbols to specify left align, right align, or centering, respectively. Then you follow the those symbols with a character width you desire.

Python > 2.6:

>>> left_aligned = "Left Align" >>> center = "Centered" >>> right_aligned = "Right Align" >>> "{left_aligned:<15}{center:^10}{right_aligned:>15}".format( ... left_aligned=left_aligned, ... center=center, ... right_aligned=right_aligned) 'Left Align Centered Right Align'

You can also specify the ordinal positions rather than keywords.

>>> "{1:<15}{0:^10}{2:>15}".format(center, left_aligned, right_aligned) 'Left Align Centered Right Align'

Or, you can omit them if the order of the parameters to format(...) are the same order of the {}.

>>> "{:<15}{:^10}{:>15}".format(left_aligned, center, right_aligned) 'Left Align Centered Right Align'

Python 3.6:

>>> f"{left_aligned:<15}{center:^10}{right_aligned:>15}" 'Left Align Centered Right Align'

In the previous examples I implicitly filled the remaining padded space with blank spaces which is the default behavior. However, if this is not what you desire you can fill them with something different by specifying a character immediately after the colon.

Python > 2.6:

>>> "{:><15}|{:-^10}|{:<>15}".format(left_aligned, center, right_aligned) 'Left Align>>>>>|-Centered-|<<<<Right Align'

Python 3.6:

>>> f"{left_aligned:><15}{center:-^10}{right_aligned:<>15}" 'Left Align>>>>>-Centered-<<<<Right Align' Numbers

Formatting floating point numbers, those containing decimal places, is a cinch in Python. All you need to do is follow the colon with an f.

Python > 2.6:

>>> rounded_pi = 3.14 >>> "A rounded representation of Pi {:f}".format(rounded_pi) 'A rounded representation of Pi 3.140000'

Python 3.6:

>>> f"A rounded representation of Pi {rounded_pi:f}" 'A rounded representation of Pi 3.140000'

Notice that the string has six decimal places. This is because by default the float specifier is given six places which it will either fill with zeros or round to only contain six depending on the input. For example, if I import the longer pi constant from the math module you'll see the rounding in action.

Python > 2.6:

>>> from math import pi >>> pi 3.141592653589793 >>> "A rounded representation of Pi {:f}".format(pi) 'A rounded representation of Pi 3.141593'

Python 3.6:

>>> f"A rounded representation of Pi {pi:f}" 'A rounded representation of Pi 3.141593'

To specify a different precision (number of decimal places) simply precede the f by the number of decimal places desired like so.

Python > 2.6:

>>> "A rounded representation of Pi {:.3f}".format(pi) 'A rounded representation of Pi 3.142'

Python 3.6:

>>> f"A rounded representation of Pi {pi:.3f}" 'A rounded representation of Pi 3.142'

Another formatting use-case for floating point numbers is the percent specifier. This works by converting what is expected to be a proportion or ratio (0-1) to a value out of 100 and treats the leftover decimal portion similar to the f specifier with a default precision of six.

Python > 2.6:

>>> receptions = 17 >>> passes = 29 >>> "The completion percentage is {:.2%}".format(receptions/passes) 'The completion percentage is 58.62%'

Python 3.6:

>>> f"The completion percentage is {receptions/passes:.2%}" 'The completion percentage is 58.62%'

Ok, so that takes care of most use cases involving floating point numbers, but what about large numbers? Python also has support for formatting these by putting in commas to increase readability of large numbers. To take advantage of this simply place a , after the colon.

Python > 2.6:

>>> house_price = 299999.99 >>> "The price of the house is ${:,}".format(house_price) 'The price of the house is $299,999.99'

Python 3.6:

>>> f"The price of the house is ${house_price:,}" 'The price of the house is $299,999.99' Type Conversions

Type conversions are a bit of a less common use case but, they do come up from time to time. The major type conversions are the following for numbers:

Conversion Description b Binary o Octal x Hexadecimal d Decimal

As with the other format specifiers they work by adding them after the colon. Hopefully this general pattern of formatting syntax is becoming clear to you.

Python > 2.6:

>>> number = 157 >>> print("Binary: {:b}\nOctal {:o}\nHexadecimal: {:x}\nDecimal: {:d}".format( ... number, ... number, ... number, ... number)) Binary: 10011101 Octal 235 Hexadecimal: 9d Decimal: 157

Python 3.6:

>>> print(f"Binary: {number:b}\nOctal {number:o}\nHexadecimal: {number:x}\nDecimal: {number:d}") Binary: 10011101 Octal 235 Hexadecimal: 9d Decimal: 157 Conclusion

In this brief tutorial on string formatting I have barely scratched the surface, but I hope that I was able to give some concrete examples of common use cases that you are likely to run across in your day-to-day Python programs. My goal has been to provide a basic explanation of the string formatting syntax and implementation techniques. From here you should be armed with enough understanding to dig into the details of the documentation. Thanks for reading along and feel free to comment below.

Categories: FLOSS Project Planets

Friday Free Software Directory IRC meetup: December 15th starting at 12:00 p.m. EST/17:00 UTC

FSF Blogs - Thu, 2017-12-14 10:45

Help improve the Free Software Directory by adding new entries and updating existing ones. Every Friday we meet on IRC in the #fsf channel on irc.freenode.org.

Tens of thousands of people visit directory.fsf.org each month to discover free software. Each entry in the Directory contains a wealth of useful information, from basic category and descriptions, to providing detailed info about version control, IRC channels, documentation, and licensing info that has been carefully checked by FSF staff and trained volunteers.

When a user comes to the Directory, they know that everything in it is free software, has only free dependencies, and runs on a free OS. With almost 16,000 entries, it is a massive repository of information about free software.

While the Directory has been and continues to be a great resource to the world for many years now, it has the potential to be a resource of even greater value. But it needs your help! And since it's a MediaWiki instance, it's easy for anyone to edit and contribute to the Directory.

This week we're back to adding even more entries to the Directory, We are getting really close to 16,000 entries, and we hope to break through that barrier by the end of the year. Come join in the fun, and find out who adds the 16,000th entry!

If you are eager to help, and you can't wait or are simply unable to make it onto IRC on Friday, our participation guide will provide you with all the information you need to get started on helping the Directory today! There are also weekly Directory Meeting pages that everyone is welcome to contribute to before, during, and after each meeting.

Categories: FLOSS Project Planets
Syndicate content