From 297dc95835d46c0615202ce8cbcb93cc160c7d07 Mon Sep 17 00:00:00 2001 From: Alexander Popov Date: Tue, 14 Feb 2017 01:59:15 +0300 Subject: [PATCH] add notabenoid export tool --- .gitignore | 2 ++ notabenoid_split.py | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 .gitignore create mode 100644 notabenoid_split.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..efa9dff --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +strings.dat +result.txt diff --git a/notabenoid_split.py b/notabenoid_split.py new file mode 100644 index 0000000..7dd886b --- /dev/null +++ b/notabenoid_split.py @@ -0,0 +1,32 @@ +#!/usr/bin/env python3 + +import json + +__author__ = 'Alexander Popov' +__version__ = '0.1.0' +__license__ = 'Unlicense' + +exportData = list() + + +def loadStrings(): + with open('strings.dat', 'r', encoding='utf-8') as f: + jsonData = json.loads(f.read()) + + for string in jsonData: + exportData.append(jsonData[string]['localizedName']) + + return('Complete!') + + +def saveStrings(): + with open('result.txt', 'w+', encoding='utf-8') as f: + for string in exportData: + f.write('%s\n' % string) + + return('Complete!') + +if __name__ == '__main__': + print('Loading strings...', loadStrings()) + print('Save strings for notabenoid...', saveStrings()) + print('\nComplete!')