<commit_before>/*
 * Screenwerk main executable. Arguments:
 *
 * argv[0]        Screen's Entu ID
 *
 */

// 1. core modules
var gui     = require('nw.gui')
var assert  = require('assert')
var util    = require('util')
var fs      = require('fs')
var https   = require('https')
var events  = require('events')
var uuid    = require('node-uuid')
var domain  = require('domain').create()


// 2. public modules from npm
var os      = require('os-utils')


// 3. Own modules
var EntuLib     = require('./entulib.js')
var stringifier = require('./stringifier.js')


domain.on('error', function(err){
	console.log(err)
})


assert.equal(typeof(gui.App.argv[0]), 'string'
			, "Screen ID should be passed as first argument.")
assert.ok(Number(gui.App.argv[0]) > 0
			, "Screen ID must be number greater than zero.")

console.log ( "= ScreenWerk v." + __VERSION + " ==================================")
console.log ( os.platform(), 'SYSTEM')

__VERSION = '0.2-alpha.9'
__HOSTNAME = 'piletilevi.entu.ee'
__SCREEN_ID = Number(gui.App.argv[0])
__META_DIR = 'sw-meta/'
__MEDIA_DIR = 'sw-media/'
__STRUCTURE = {"name":"screen","reference":{"name":"screen-group","reference":{"name":"configuration","child":{"name":"schedule","reference":{"name":"layout","child":{"name":"layout-playlist","reference":{"name":"playlist","child":{"name":"playlist-media","reference":{"name":"media"}}}}}}}}}
__HIERARCHY = {'child_of': {}, 'parent_of': {}}
function recurseHierarchy(structure, parent_name) {
	if (parent_name) {
		__HIERARCHY.child_of[parent_name] = structure.name
		__HIERARCHY.parent_of[structure.name] = parent_name
	}
	if (structure.child !== undefined)
		recurseHierarchy(structure.child, structure.name)
	else if (structure.reference !== undefined)
		recurseHierarchy(structure.reference, structure.name)
}
recurseHierarchy(__STRUCTURE)
__DEFAULT_UPDATE_INTERVAL_MINUTES = 10
__UPDATE_INTERVAL_SECONDS = __DEFAULT_UPDATE_INTERVAL_MINUTES * 60
__DEFAULT_DELAY_MS = 0
__DEBUG_MODE = (gui.App.argv.length > 1 && gui.App.argv[1] === 'debug')<commit_msg>reversion version<commit_after>/*
 * Screenwerk main executable. Arguments:
 *
 * argv[0]        Screen's Entu ID
 *
 */

// 1. core modules
var gui     = require('nw.gui')
var assert  = require('assert')
var util    = require('util')
var fs      = require('fs')
var https   = require('https')
var events  = require('events')
var uuid    = require('node-uuid')
var domain  = require('domain').create()


// 2. public modules from npm
var os      = require('os-utils')


// 3. Own modules
var EntuLib     = require('./entulib.js')
var stringifier = require('./stringifier.js')


domain.on('error', function(err){
	console.log(err)
})


assert.equal(typeof(gui.App.argv[0]), 'string'
			, "Screen ID should be passed as first argument.")
assert.ok(Number(gui.App.argv[0]) > 0
			, "Screen ID must be number greater than zero.")

__VERSION = '0.2-alpha.10'

console.log ( "= ScreenWerk v." + __VERSION + " ==================================")
console.log ( os.platform(), 'SYSTEM')

__HOSTNAME = 'piletilevi.entu.ee'
__SCREEN_ID = Number(gui.App.argv[0])
__META_DIR = 'sw-meta/'
__MEDIA_DIR = 'sw-media/'
__STRUCTURE = {"name":"screen","reference":{"name":"screen-group","reference":{"name":"configuration","child":{"name":"schedule","reference":{"name":"layout","child":{"name":"layout-playlist","reference":{"name":"playlist","child":{"name":"playlist-media","reference":{"name":"media"}}}}}}}}}
__HIERARCHY = {'child_of': {}, 'parent_of': {}}
function recurseHierarchy(structure, parent_name) {
	if (parent_name) {
		__HIERARCHY.child_of[parent_name] = structure.name
		__HIERARCHY.parent_of[structure.name] = parent_name
	}
	if (structure.child !== undefined)
		recurseHierarchy(structure.child, structure.name)
	else if (structure.reference !== undefined)
		recurseHierarchy(structure.reference, structure.name)
}
recurseHierarchy(__STRUCTURE)
__DEFAULT_UPDATE_INTERVAL_MINUTES = 10
__UPDATE_INTERVAL_SECONDS = __DEFAULT_UPDATE_INTERVAL_MINUTES * 60
__DEFAULT_DELAY_MS = 0
__DEBUG_MODE = (gui.App.argv.length > 1 && gui.App.argv[1] === 'debug')
{'fraction_non_alphanumeric': 0.19334312285854136, 'fraction_numerical': 0.009055310817425355, 'mean_word_length': 5.336434108527132, 'pattern_counts': {'":': 34, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1582624', 'n_tokens_mistral': 1415, 'n_tokens_neox': 1347, 'n_words': 262}