From 3df45019fa108a1384be93a543399f95f68f35a6 Mon Sep 17 00:00:00 2001 From: jesusalva Date: Fri, 16 Feb 2018 00:49:26 -0200 Subject: Update news generator --- web/backup.bin | 68 ----------------------------------------------------- web/index.bin | 2 ++ web/news.html | 6 +++-- web/news_to_html.py | 27 +++++++++++++++++++-- 4 files changed, 31 insertions(+), 72 deletions(-) delete mode 100644 web/backup.bin create mode 100644 web/index.bin (limited to 'web') diff --git a/web/backup.bin b/web/backup.bin deleted file mode 100644 index 5a4da16..0000000 --- a/web/backup.bin +++ /dev/null @@ -1,68 +0,0 @@ - -

2018-02-14

- - Actual Release: Pilot-I Testing -
-
Welcome to The Mana World 2! -
-
By playing you agree and abide to the Terms of Service of The Mana World 2, available at: -
- https://gitlab.com/TMW2/TheManaWorld_Wiki/wikis/Rules -
- -
- Our Staff will never ask for your password. You are the sole responsible for -
- its safety! -
- If you ever run in trouble, try contacting a GM with @request Help me! -
- Please enjoy our server, and have fun! -
- -
- The adventure begins! -
- -
- Release 1: Candy! -
- -
-
The work which started at mid-january is currently advancing. -
-
You can travel with Nard to Candor and later, you'll be able to visit Tulishmar. -
-
Remember that this is not TMW:rEvolt, even if many aspects are similar. -
- -
-
Due the very early stages of development, we may need to do a full account reset -
-
before next release, so do not get too attached to it :> -
-
The early stage also means constant server resets and updates. Sorry. -
- -
-
This is a Pilot Release, and therefore, not much content is present. -
-
We welcome all contributors who are willing to join. -
- -
-
Have fun, the adventure starts now! -
- -
- -- Your TMW2 Team -
- February 2018 -
- -
-
You can check out this page for older entries: -
- http://tmw2.org/news -
-

diff --git a/web/index.bin b/web/index.bin new file mode 100644 index 0000000..a22eb99 --- /dev/null +++ b/web/index.bin @@ -0,0 +1,2 @@ +2018-02-16 +2018-02-14 diff --git a/web/news.html b/web/news.html index 6ecfe08..c7c714f 100644 --- a/web/news.html +++ b/web/news.html @@ -1,4 +1,6 @@ -Server News +Server News
Archive
2018-02-16
2018-02-14

+ +

2018-02-16

Actual Release: Pilot-II Testing @@ -167,4 +169,4 @@ http://tmw2.org/news

- \ No newline at end of file + diff --git a/web/news_to_html.py b/web/news_to_html.py index 0f0b7c1..22ddb4c 100755 --- a/web/news_to_html.py +++ b/web/news_to_html.py @@ -7,6 +7,21 @@ import datetime date=str(datetime.date.today()) +# Update the INDEX +i1=open("index.bin", "r") +i2=open("1index.bin", "w") +for i in i1: + i2.write(i) +i2.close() +i1.close() +i1=open("index.bin", "w") +i2=open("1index.bin", "r") +i1.write(date+'\n') +for i in i2: + i1.write(i) +i2.close() +i1.close() +i1=open("index.bin", "r") # Prepare to sort from newest to oldest dt=open("all_news.bin", "r") @@ -22,7 +37,7 @@ dc=open("backup.bin", "r") ns=open("../update/news.txt", "r") dt.write("\n

"+date+"

\n\n") -# Function to markup it +# Function to markup it, and strip new lines def markup(r): r=r.replace('##0', '') r=r.replace('##1', '') @@ -40,6 +55,8 @@ def markup(r): r=r.replace('|', '">') r=r.replace('@@]', '') return r +def nn(r): + return r.replace('\n', '') # Write the news at all_news.bin, and then reload the backup. Finally, close the file for i in ns: @@ -57,10 +74,16 @@ wp=open("news.html", "w") dt=open("all_news.bin", "r") wp.write("Server News") +wp.write("") +for i in i1: + wp.write('') +wp.write('
Archive
'+nn(i)+'

') + for line in dt: - wp.write(line) + wp.write(nn(line)) wp.write("") wp.close() dt.close() +i1.close() -- cgit v1.2.3-70-g09d2