#! /usr/bin/env python
# -*- coding: utf8 -*-
#
# Copyright (C) 2018 The Mana World 2
# Author: Jonatas N. (Jesusalva)
import datetime
date=str(datetime.date.today())
fulldate=str(datetime.datetime.utcnow().isoformat())
#date="2020-01-31"
#fulldate="2020-01-31T11:45:20.543750"
# Open file (Dt) and export to "old". (Src) is current news
dt=open("nf_main.xml", "r")
old=[]
for line in dt:
old.append(line)
dt.close()
dt=open("nf_main.xml", "w")
src=open("../update/news.txt", "r")
# Read news and prepare header
ns=open("../update/news.txt", "r")
# Function to markup it, and strip new lines
def markup(r):
r=r.replace('##0', '')
r=r.replace('##1', '')
r=r.replace('##2', '')
r=r.replace('##3', '')
r=r.replace('##4', '')
r=r.replace('##5', '')
r=r.replace('##6', '')
r=r.replace('##7', '')
r=r.replace('##8', '')
r=r.replace('##9', '')
r=r.replace('##B', '')
r=r.replace('##b', '')
r=r.replace('[@@', '')
r=r.replace('@@]', '')
return r
def nn(r):
return r.replace('\n', '')
# Write the news, and close that file
dt.write('