From 32d3f6e4b0b562a415ad7a63adbe0427eda558d5 Mon Sep 17 00:00:00 2001 From: wes Date: Sat, 6 May 2017 19:51:35 -0400 Subject: [PATCH] remove unnecessary modules now that the crawler is separate --- src/goasearch.py | 20 -------------------- src/mapping.py | 39 --------------------------------------- src/mcmaster/classes.csv | 0 3 files changed, 59 deletions(-) delete mode 100755 src/goasearch.py delete mode 100644 src/mapping.py delete mode 100644 src/mcmaster/classes.csv diff --git a/src/goasearch.py b/src/goasearch.py deleted file mode 100755 index 4723b1e..0000000 --- a/src/goasearch.py +++ /dev/null @@ -1,20 +0,0 @@ -#! /usr/bin/python3 -from search import indexListing -from textbookExceptions import UnIndexable -from mcmaster.classes import allCourses -from search import indexListing, createIndex -from itertools import imap - -try: - print("Trying to create the index if it does not exist already") - createIndex("oersearch") -except Exception as e: - print(e) - -print("Downloading course info") -for c in allCourses(): - try: - print(c) - print(indexListing(c)) - except UnIndexable as e: - print(e) diff --git a/src/mapping.py b/src/mapping.py deleted file mode 100644 index 8181e50..0000000 --- a/src/mapping.py +++ /dev/null @@ -1,39 +0,0 @@ -#! /usr/bin/python2 - -from elasticsearch_dsl import DocType, Date, Nested, Boolean, \ - analyzer, InnerObjectWrapper, Completion, Keyword, Text, Object - -from elasticsearch_dsl.connections import connections - -connections.create_connection(hosts=["localhost"]) - -class TextBook(InnerObjectWrapper): - pass - -class Section(InnerObjectWrapper): - pass - -class Course(DocType): - textbook = Object( - doc_class=TextBook, - properties = { - "author" : Text(), - "title" : Text(), - "price" : Text() - } - ) - - sections = Object( - doc_class=Section, - properties = { - "sem" : Keyword(), - "title" : Text(), - "prof" : Text(), - "loc" : Text(), - "time" : Text(), - "day" : Text() - } - ) - - class Meta: - index = "course_test" diff --git a/src/mcmaster/classes.csv b/src/mcmaster/classes.csv deleted file mode 100644 index e69de29..0000000