added cleaner and precompiler
authorjosuer08 <josuer08@gmail.com>
Mon, 21 Oct 2019 20:46:15 +0000 (16:46 -0400)
committerGitHub <noreply@github.com>
Mon, 21 Oct 2019 20:46:15 +0000 (16:46 -0400)
cleaner.sh [new file with mode: 0644]
precompiler.py [new file with mode: 0644]

diff --git a/cleaner.sh b/cleaner.sh
new file mode 100644 (file)
index 0000000..c19f589
--- /dev/null
@@ -0,0 +1,4 @@
+#!/bin/bash
+cat $1 | grep -E "[sh]+[0-9]{1,3}:[sh]+[0-9]{1,3}" > $1_clean
+cat $1 | grep -vE "[sh]+[0-9]{1,3}:[sh]+[0-9]{1,3}" > $1_dirt
+
diff --git a/precompiler.py b/precompiler.py
new file mode 100644 (file)
index 0000000..2e2cf56
--- /dev/null
@@ -0,0 +1,26 @@
+#!/usr/bin/env python3
+import sys
+import os
+import time
+cmd = './cleaner.sh '+sys.argv[1]
+os.system(cmd)
+time.sleep(.300)
+document = open(sys.argv[1] + "_clean" ,"r+")
+links = document.readlines()
+document.close
+
+#clean the \n in the colected data
+a = 0
+for linkline in links:
+       links[a] = linkline.rstrip()
+       a+=1
+
+# get a list of non repeating devices
+devices = []
+for value in links:
+       value_split = value.split(':')
+       devices.append(value_split[0])
+       devices.append(value_split[1])
+devices = list(dict.fromkeys(devices))
+print devices
+print links