Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

moving things around, such that the backend stuff is all in the "impo…

…rt_tool" directory.
  • Loading branch information...
commit cb77fb1381932403c9fbc47609fe225d52fd34d8 1 parent 2fd53fa
Jared Forsyth jaredly authored
Showing with 61 additions and 24 deletions.
  1. +2 −2 .gitignore
  2. 0  import_tool/__init__.py
  3. +5 −18 { → import_tool}/backend.py
  4. +23 −2 { → import_tool}/backend_config.py
  5. 0  { → import_tool}/helper_scripts/__init__.py
  6. 0  { → import_tool}/helper_scripts/modify_db.py
  7. 0  { → import_tool}/helper_scripts/name_schemes/__init__.py
  8. 0  { → import_tool}/helper_scripts/name_schemes/tf_itf.py
  9. 0  { → import_tool}/helper_scripts/name_schemes/top_n.py
  10. 0  { → import_tool}/helper_scripts/pmidb.py
  11. 0  { → import_tool}/helper_scripts/pmidb2.py
  12. 0  { → import_tool}/helper_scripts/reindex_wp_counts.py
  13. 0  { → import_tool}/import_scripts/__init__.py
  14. 0  { → import_tool}/import_scripts/analysis_import.py
  15. 0  { → import_tool}/import_scripts/dataset_import.py
  16. 0  { → import_tool}/import_scripts/metadata.py
  17. 0  { → import_tool}/import_scripts/ngram_convert.py
  18. 0  { → import_tool}/java/.project
  19. 0  { → import_tool}/java/build.xml
  20. BIN  import_tool/java/lib/gephi-toolkit.jar
  21. 0  { → import_tool}/java/lib/mysql-connector-java-5.1.18-bin.jar
  22. 0  { → import_tool}/java/lib/sqlitejdbc-v056.jar
  23. 0  { → import_tool}/java/lib/xercesImpl.jar
  24. 0  { → import_tool}/java/src/edu/byu/nlp/topicvis/Bijection.java
  25. 0  { → import_tool}/java/src/edu/byu/nlp/topicvis/DistanceFilterBuilder.java
  26. 0  { → import_tool}/java/src/edu/byu/nlp/topicvis/NeighborFilterBuilder.java
  27. 0  { → import_tool}/java/src/edu/byu/nlp/topicvis/TopicMapGraphBuilder.java
  28. 0  { → import_tool}/java/src/edu/byu/nlp/topicvis/TopicMetricDistanceGraphGenerator.java
  29. 0  { → import_tool}/java/src/edu/byu/nlp/topicvis/TopicSVGLinker.java
  30. 0  { → import_tool}/java/src/edu/byu/nlp/topicvis/YambaDatabase.java
  31. 0  {topic_modeling → import_tool}/local_settings.py.sample
  32. 0  { → import_tool}/metric_scripts/__init__.py
  33. 0  { → import_tool}/metric_scripts/analyses/__init__.py
  34. 0  { → import_tool}/metric_scripts/analyses/entropy.py
  35. 0  { → import_tool}/metric_scripts/datasets/__init__.py
  36. 0  { → import_tool}/metric_scripts/datasets/counts.py
  37. 0  { → import_tool}/metric_scripts/documents/__init__.py
  38. 0  { → import_tool}/metric_scripts/documents/pairwise/__init__.py
  39. 0  { → import_tool}/metric_scripts/documents/pairwise/topic_correlation.py
  40. 0  { → import_tool}/metric_scripts/documents/pairwise/word_correlation.py
  41. 0  { → import_tool}/metric_scripts/documents/token_count.py
  42. 0  { → import_tool}/metric_scripts/documents/topic_entropy.py
  43. 0  { → import_tool}/metric_scripts/documents/type_count.py
  44. 0  { → import_tool}/metric_scripts/metric_set.py
  45. 0  { → import_tool}/metric_scripts/topics/__init__.py
  46. 0  { → import_tool}/metric_scripts/topics/alpha.py
  47. 0  { → import_tool}/metric_scripts/topics/attribute_entropy.py
  48. 0  { → import_tool}/metric_scripts/topics/centroid.py
  49. 0  { → import_tool}/metric_scripts/topics/coherence.py
  50. 0  { → import_tool}/metric_scripts/topics/document_entropy.py
  51. 0  { → import_tool}/metric_scripts/topics/import_all.py
  52. 0  { → import_tool}/metric_scripts/topics/pairwise/__init__.py
  53. 0  { → import_tool}/metric_scripts/topics/pairwise/document_correlation.py
  54. 0  { → import_tool}/metric_scripts/topics/pairwise/pairwise_coherence.py
  55. 0  { → import_tool}/metric_scripts/topics/pairwise/word_correlation.py
  56. 0  { → import_tool}/metric_scripts/topics/sentiment.py
  57. 0  { → import_tool}/metric_scripts/topics/subset_document_entropy.py
  58. 0  { → import_tool}/metric_scripts/topics/subset_token_count.py
  59. 0  { → import_tool}/metric_scripts/topics/token_count.py
  60. 0  { → import_tool}/metric_scripts/topics/type_count.py
  61. 0  { → import_tool}/metric_scripts/topics/word_entropy.py
  62. +28 −0 run_import.py
  63. +1 −0  run_server.sh
  64. +2 −2 topic_modeling/settings.py
4 .gitignore
View
@@ -3,7 +3,7 @@
.project
*.pyc
*.swp
-java/bin
+import_tool/java/bin
.dbs
yamba
*.nfs*
@@ -14,5 +14,5 @@ yamba
datasets/
/Main.vim.sess
/tg.sqlite3
-/topic_modeling/local_settings.py
+/import_tool/local_settings.py
/working/
0  import_tool/__init__.py
View
No changes.
23 backend.py → import_tool/backend.py 100755 → 100644
View
@@ -41,6 +41,10 @@
# Allow specification of multiple num_topics
#
+if __name__ == "__main__":
+ raise Exception("This file is only meant to be run by doit. "
+ "use ./run_import.py to run the backend import")
+
import codecs
import datetime
import hashlib
@@ -82,29 +86,12 @@
setup_logging()
try:
- from topic_modeling.local_settings import LOCAL_DIR, build
+ from import_tool.local_settings import LOCAL_DIR, build
except ImportError:
print >> sys.stderr, "Import error looking for local_settings.py."\
"Look at topic_modeling/local_settings.py.sample for help"
raise
-#If this file is invoked directly, pass it in to the doit system for processing.
-# TODO(matt): Pretty hackish, but it's a starting place. This should be
-# cleaned up when we have time.
-if __name__ == "__main__":
- DB_BASE = os.path.join(LOCAL_DIR, '.dbs')
- if not os.path.exists(DB_BASE): os.mkdir(DB_BASE)
- sys.path.append("tools/doit")
- from doit.doit_cmd import cmd_main
- path = os.path.abspath(sys.argv[0])
-
- #The database file where we'll store info about this build
- db_name = os.path.join(DB_BASE, "{0}.db".format(build.replace('/','_')))
-
- args = ['-f', path] + ['--db', db_name] + sys.argv[1:]
- res = cmd_main(args)
- sys.exit(res)
-
class DoitTask:
'''A class to organize our tasks more sanely'''
name = None
25 backend_config.py → import_tool/backend_config.py
View
@@ -1,4 +1,25 @@
#!/usr/bin/env python
+# The Topical Guide
+# Copyright 2010-2011 Brigham Young University
+#
+# This file is part of the Topical Guide <http://nlp.cs.byu.edu/topic_browser>.
+#
+# The Topical Guide is free software: you can redistribute it and/or modify it
+# under the terms of the GNU Affero General Public License as published by the
+# Free Software Foundation, either version 3 of the License, or (at your
+# option) any later version.
+#
+# The Topical Guide is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License
+# for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with the Topical Guide. If not, see <http://www.gnu.org/licenses/>.
+#
+# If you have inquiries regarding any further use of the Topical Guide, please
+# contact the Copyright Licensing Office, Brigham Young University, 3760 HBLL,
+# Provo, UT 84602, (801) 422-9339 or 422-3821, e-mail copyright@byu.edu.
import os
import imp
@@ -7,7 +28,7 @@
from helper_scripts.name_schemes.top_n import TopNTopicNamer
from topic_modeling import settings
-from topic_modeling.local_settings import LOCAL_DIR, build
+from import_tool.local_settings import LOCAL_DIR, build
class Config(dict):
overrides = {}
@@ -28,7 +49,7 @@ def required(self, key):
if key not in self: raise Exception("Configuration key '%s' is required")
def get_buildscript(build):
- path = join(os.path.dirname(__file__), 'build')
+ path = join(os.path.dirname(__file__), '../build')
fname = join(path, '{0}.py'.format(build))
fobj = open(fname)
return imp.load_module(build, fobj, fname, ('.py', 'r', imp.PY_SOURCE))
0  helper_scripts/__init__.py → import_tool/helper_scripts/__init__.py
View
File renamed without changes
0  helper_scripts/modify_db.py → import_tool/helper_scripts/modify_db.py
View
File renamed without changes
0  helper_scripts/name_schemes/__init__.py → import_tool/helper_scripts/name_schemes/__init__.py
View
File renamed without changes
0  helper_scripts/name_schemes/tf_itf.py → import_tool/helper_scripts/name_schemes/tf_itf.py
View
File renamed without changes
0  helper_scripts/name_schemes/top_n.py → import_tool/helper_scripts/name_schemes/top_n.py
View
File renamed without changes
0  helper_scripts/pmidb.py → import_tool/helper_scripts/pmidb.py
View
File renamed without changes
0  helper_scripts/pmidb2.py → import_tool/helper_scripts/pmidb2.py
View
File renamed without changes
0  helper_scripts/reindex_wp_counts.py → import_tool/helper_scripts/reindex_wp_counts.py
View
File renamed without changes
0  import_scripts/__init__.py → import_tool/import_scripts/__init__.py
View
File renamed without changes
0  import_scripts/analysis_import.py → import_tool/import_scripts/analysis_import.py
View
File renamed without changes
0  import_scripts/dataset_import.py → import_tool/import_scripts/dataset_import.py
View
File renamed without changes
0  import_scripts/metadata.py → import_tool/import_scripts/metadata.py
View
File renamed without changes
0  import_scripts/ngram_convert.py → import_tool/import_scripts/ngram_convert.py
View
File renamed without changes
0  java/.project → import_tool/java/.project
View
File renamed without changes
0  java/build.xml → import_tool/java/build.xml
View
File renamed without changes
BIN  import_tool/java/lib/gephi-toolkit.jar
View
Binary file not shown
0  java/lib/mysql-connector-java-5.1.18-bin.jar → ...tool/java/lib/mysql-connector-java-5.1.18-bin.jar
View
File renamed without changes
0  java/lib/sqlitejdbc-v056.jar → import_tool/java/lib/sqlitejdbc-v056.jar
View
File renamed without changes
0  java/lib/xercesImpl.jar → import_tool/java/lib/xercesImpl.jar
View
File renamed without changes
0  java/src/edu/byu/nlp/topicvis/Bijection.java → ...tool/java/src/edu/byu/nlp/topicvis/Bijection.java
View
File renamed without changes
0  ...c/edu/byu/nlp/topicvis/DistanceFilterBuilder.java → ...c/edu/byu/nlp/topicvis/DistanceFilterBuilder.java
View
File renamed without changes
0  ...c/edu/byu/nlp/topicvis/NeighborFilterBuilder.java → ...c/edu/byu/nlp/topicvis/NeighborFilterBuilder.java
View
File renamed without changes
0  ...rc/edu/byu/nlp/topicvis/TopicMapGraphBuilder.java → ...rc/edu/byu/nlp/topicvis/TopicMapGraphBuilder.java
View
File renamed without changes
0  ...p/topicvis/TopicMetricDistanceGraphGenerator.java → ...p/topicvis/TopicMetricDistanceGraphGenerator.java
View
File renamed without changes
0  java/src/edu/byu/nlp/topicvis/TopicSVGLinker.java → ...java/src/edu/byu/nlp/topicvis/TopicSVGLinker.java
View
File renamed without changes
0  java/src/edu/byu/nlp/topicvis/YambaDatabase.java → .../java/src/edu/byu/nlp/topicvis/YambaDatabase.java
View
File renamed without changes
0  topic_modeling/local_settings.py.sample → import_tool/local_settings.py.sample
View
File renamed without changes
0  metric_scripts/__init__.py → import_tool/metric_scripts/__init__.py
View
File renamed without changes
0  metric_scripts/analyses/__init__.py → import_tool/metric_scripts/analyses/__init__.py
View
File renamed without changes
0  metric_scripts/analyses/entropy.py → import_tool/metric_scripts/analyses/entropy.py
View
File renamed without changes
0  metric_scripts/datasets/__init__.py → import_tool/metric_scripts/datasets/__init__.py
View
File renamed without changes
0  metric_scripts/datasets/counts.py → import_tool/metric_scripts/datasets/counts.py
View
File renamed without changes
0  metric_scripts/documents/__init__.py → import_tool/metric_scripts/documents/__init__.py
View
File renamed without changes
0  metric_scripts/documents/pairwise/__init__.py → ...ool/metric_scripts/documents/pairwise/__init__.py
View
File renamed without changes
0  ...c_scripts/documents/pairwise/topic_correlation.py → ...c_scripts/documents/pairwise/topic_correlation.py
View
File renamed without changes
0  ...ic_scripts/documents/pairwise/word_correlation.py → ...ic_scripts/documents/pairwise/word_correlation.py
View
File renamed without changes
0  metric_scripts/documents/token_count.py → import_tool/metric_scripts/documents/token_count.py
View
File renamed without changes
0  metric_scripts/documents/topic_entropy.py → ...rt_tool/metric_scripts/documents/topic_entropy.py
View
File renamed without changes
0  metric_scripts/documents/type_count.py → import_tool/metric_scripts/documents/type_count.py
View
File renamed without changes
0  metric_scripts/metric_set.py → import_tool/metric_scripts/metric_set.py
View
File renamed without changes
0  metric_scripts/topics/__init__.py → import_tool/metric_scripts/topics/__init__.py
View
File renamed without changes
0  metric_scripts/topics/alpha.py → import_tool/metric_scripts/topics/alpha.py
View
File renamed without changes
0  metric_scripts/topics/attribute_entropy.py → ...t_tool/metric_scripts/topics/attribute_entropy.py
View
File renamed without changes
0  metric_scripts/topics/centroid.py → import_tool/metric_scripts/topics/centroid.py
View
File renamed without changes
0  metric_scripts/topics/coherence.py → import_tool/metric_scripts/topics/coherence.py
View
File renamed without changes
0  metric_scripts/topics/document_entropy.py → ...rt_tool/metric_scripts/topics/document_entropy.py
View
File renamed without changes
0  metric_scripts/topics/import_all.py → import_tool/metric_scripts/topics/import_all.py
View
File renamed without changes
0  metric_scripts/topics/pairwise/__init__.py → ...t_tool/metric_scripts/topics/pairwise/__init__.py
View
File renamed without changes
0  ...c_scripts/topics/pairwise/document_correlation.py → ...c_scripts/topics/pairwise/document_correlation.py
View
File renamed without changes
0  metric_scripts/topics/pairwise/pairwise_coherence.py → ...ric_scripts/topics/pairwise/pairwise_coherence.py
View
File renamed without changes
0  metric_scripts/topics/pairwise/word_correlation.py → ...etric_scripts/topics/pairwise/word_correlation.py
View
File renamed without changes
0  metric_scripts/topics/sentiment.py → import_tool/metric_scripts/topics/sentiment.py
View
File renamed without changes
0  metric_scripts/topics/subset_document_entropy.py → .../metric_scripts/topics/subset_document_entropy.py
View
File renamed without changes
0  metric_scripts/topics/subset_token_count.py → ..._tool/metric_scripts/topics/subset_token_count.py
View
File renamed without changes
0  metric_scripts/topics/token_count.py → import_tool/metric_scripts/topics/token_count.py
View
File renamed without changes
0  metric_scripts/topics/type_count.py → import_tool/metric_scripts/topics/type_count.py
View
File renamed without changes
0  metric_scripts/topics/word_entropy.py → import_tool/metric_scripts/topics/word_entropy.py
View
File renamed without changes
28 run_import.py
View
@@ -0,0 +1,28 @@
+#!/usr/bin/env python
+
+import os
+import sys
+
+try:
+ from import_tool.local_settings import LOCAL_DIR, build
+except ImportError:
+ raise Exception("Import error looking for local_settings.py. "
+ "Look at import_tool/local_settings.py.sample for help")
+
+if __name__ == '__main__':
+ DB_BASE = os.path.join(LOCAL_DIR, '.dbs')
+ if not os.path.exists(DB_BASE):
+ os.mkdir(DB_BASE)
+ sys.path.append("tools/doit")
+ from doit.doit_cmd import cmd_main
+ path = os.path.abspath('import_tool/backend.py')
+
+ #The database file where we'll store info about this build
+ db_name = os.path.join(DB_BASE, "{0}.db".format(build.replace('/','_')))
+
+ args = ['-f', path] + ['--db', db_name] + sys.argv[1:]
+ res = cmd_main(args)
+
+print 'done'
+
+# vim: et sw=4 sts=4
1  run_server.sh
View
@@ -0,0 +1 @@
+python topic_modeling/manage.py runserver_plus
4 topic_modeling/settings.py
View
@@ -35,11 +35,11 @@
)
try:
- from local_settings import DB_FILE
+ from import_tool.local_settings import DB_FILE
except ImportError:
print >> sys.stderr, "Import error looking for local_settings.py."\
"Look at local_settings.py.sample for help"
- raise
+ raise Exception("You need to set up your local_settings.py")
MANAGERS = ADMINS
Please sign in to comment.
Something went wrong with that request. Please try again.