Add logic for <!--more--> and translation plug.

pull/1/head
Simon Quigley 6 years ago
parent 7000fad4d9
commit fc9ca85525

@ -1,5 +1,7 @@
At Lubuntu we decided it was a good idea to create a weekly newsletter detailing the work that has been happening. So, here we are. :) At Lubuntu we decided it was a good idea to create a weekly newsletter detailing the work that has been happening. So, here we are. :)
NOTICE
# Changes # Changes
## General ## General

@ -1,5 +1,7 @@
Here is the second issue of This Week in Lubuntu Development. You can read last week's issue [here](https://lubuntu.me/this-week-in-lubuntu-development-1/). Here is the second issue of This Week in Lubuntu Development. You can read last week's issue [here](https://lubuntu.me/this-week-in-lubuntu-development-1/).
NOTICE
# Changes # Changes
## General ## General

@ -1,5 +1,7 @@
Here is the third issue of This Week in Lubuntu Development. You can read last week's issue [here](https://lubuntu.me/this-week-in-lubuntu-development-2/). Here is the third issue of This Week in Lubuntu Development. You can read last week's issue [here](https://lubuntu.me/this-week-in-lubuntu-development-2/).
NOTICE
# Changes # Changes
## General ## General

@ -1,5 +1,7 @@
Here is the fourth issue of This Week in Lubuntu Development. You can read last week's issue [here](https://lubuntu.me/this-week-in-lubuntu-development-3/). Here is the fourth issue of This Week in Lubuntu Development. You can read last week's issue [here](https://lubuntu.me/this-week-in-lubuntu-development-3/).
NOTICE
# Changes # Changes
## General ## General

@ -1,5 +1,7 @@
Here is the fifth issue of This Week in Lubuntu Development. You can read the previous issue [here](https://lubuntu.me/this-week-in-lubuntu-development-4/). Here is the fifth issue of This Week in Lubuntu Development. You can read the previous issue [here](https://lubuntu.me/this-week-in-lubuntu-development-4/).
NOTICE
# Changes # Changes
## General ## General

@ -1,5 +1,7 @@
Here is the sixth issue of This Week in Lubuntu Development. You can read the last issue [here](https://lubuntu.me/this-week-in-lubuntu-development-5/). Here is the sixth issue of This Week in Lubuntu Development. You can read the last issue [here](https://lubuntu.me/this-week-in-lubuntu-development-5/).
NOTICE
# Changes # Changes
## Lubuntu 17.10 reaches End of Life on July 19, 2018 ## Lubuntu 17.10 reaches End of Life on July 19, 2018

@ -1,5 +1,7 @@
Here is the seventh issue of This Week in Lubuntu Development. You can read the last issue [here](https://lubuntu.me/this-week-in-lubuntu-development-6/). Here is the seventh issue of This Week in Lubuntu Development. You can read the last issue [here](https://lubuntu.me/this-week-in-lubuntu-development-6/).
NOTICE
# Changes # Changes
## General ## General

@ -1,6 +1,6 @@
Here is the eighth issue of This Week in Lubuntu Development. You can read the last issue [here](https://lubuntu.me/this-week-in-lubuntu-development-7/). Here is the eighth issue of This Week in Lubuntu Development. You can read the last issue [here](https://lubuntu.me/this-week-in-lubuntu-development-7/).
<!--more--> NOTICE
# Changes # Changes

@ -1,6 +1,7 @@
Thanks to all the hard work from our contributors, we are pleased to announce that Lubuntu 16.04.5 LTS has been released! Thanks to all the hard work from our contributors, we are pleased to announce that Lubuntu 16.04.5 LTS has been released!
<!--more--> NOTICE
# What is Lubuntu? # What is Lubuntu?
Lubuntu is an official Ubuntu flavor which uses the Lightweight X11 Desktop Environment (LXDE). The projects goal is to provide a lightweight yet functional Linux distribution based on a rock solid Ubuntu base. Lubuntu specifically targets older machines with lower resources, but also runs great on newer hardware. Along with a simple but usable graphical user interface, Lubuntu comes with a wide variety of applications chosen for their small footprint so you can browse, email, chat, play, and be productive. Lubuntu is an official Ubuntu flavor which uses the Lightweight X11 Desktop Environment (LXDE). The projects goal is to provide a lightweight yet functional Linux distribution based on a rock solid Ubuntu base. Lubuntu specifically targets older machines with lower resources, but also runs great on newer hardware. Along with a simple but usable graphical user interface, Lubuntu comes with a wide variety of applications chosen for their small footprint so you can browse, email, chat, play, and be productive.

@ -19,6 +19,7 @@
import sys import sys
import yaml import yaml
from os import path from os import path
from babel import Locale
from markdown import markdown from markdown import markdown
from wordpress_xmlrpc import Client from wordpress_xmlrpc import Client
from wordpress_xmlrpc.methods import posts from wordpress_xmlrpc.methods import posts
@ -68,6 +69,24 @@ def updatepost(infoyaml, md, post=None, title=None, slug=None):
title = title.replace("POUND", "#") title = title.replace("POUND", "#")
if "l10n" in infoyaml:
l10nstr = ""
for lang in infoyaml["l10n"]:
try:
locale = Locale(lang)
except:
break
langname = locale.display_name
if l10nstr != "":
l10nstr = l10nstr + ", "
else:
l10nstr = "Translated into: "
l10nstr = l10nstr + "<a href=\"https://l10n.lubuntu.me/" + infoyaml["slug"] + "/" + lang + "/\">" + langname + "</a>"
md = md.replace("NOTICE", "<!--more-->\n\n" + l10nstr)
else:
md = md.replace("NOTICE", "<!--more-->")
print(md)
post.title = title post.title = title
post.content = md post.content = md
post.post_status = "publish" post.post_status = "publish"
@ -80,7 +99,7 @@ def updatepost(infoyaml, md, post=None, title=None, slug=None):
post.terms = tags post.terms = tags
wp.call(posts.EditPost(post.id, post)) #wp.call(posts.EditPost(post.id, post))
def main(): def main():
posts = loadposts() posts = loadposts()

Loading…
Cancel
Save