Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
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
@jaredly 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
View
4 .gitignore
@@ -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/
View
0  import_tool/__init__.py
No changes.
View
23 backend.py → import_tool/backend.py 100755 → 100644
@@ -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
View
25 backend_config.py → import_tool/backend_config.py
@@ -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))
View
0  helper_scripts/__init__.py → import_tool/helper_scripts/__init__.py
File renamed without changes
View
0  helper_scripts/modify_db.py → import_tool/helper_scripts/modify_db.py
File renamed without changes
View
0  helper_scripts/name_schemes/__init__.py → ...l/helper_scripts/name_schemes/__init__.py
File renamed without changes
View
0  helper_scripts/name_schemes/tf_itf.py → ...ool/helper_scripts/name_schemes/tf_itf.py
File renamed without changes
View
0  helper_scripts/name_schemes/top_n.py → ...tool/helper_scripts/name_schemes/top_n.py
File renamed without changes
View
0  helper_scripts/pmidb.py → import_tool/helper_scripts/pmidb.py
File renamed without changes
View
0  helper_scripts/pmidb2.py → import_tool/helper_scripts/pmidb2.py
File renamed without changes
View
0  helper_scripts/reindex_wp_counts.py → ..._tool/helper_scripts/reindex_wp_counts.py
File renamed without changes
View
0  import_scripts/__init__.py → import_tool/import_scripts/__init__.py
File renamed without changes
View
0  import_scripts/analysis_import.py → ...rt_tool/import_scripts/analysis_import.py
File renamed without changes
View
0  import_scripts/dataset_import.py → import_tool/import_scripts/dataset_import.py
File renamed without changes
View
0  import_scripts/metadata.py → import_tool/import_scripts/metadata.py
File renamed without changes
View
0  import_scripts/ngram_convert.py → import_tool/import_scripts/ngram_convert.py
File renamed without changes
View
0  java/.project → import_tool/java/.project
File renamed without changes
View
0  java/build.xml → import_tool/java/build.xml
File renamed without changes
View
BIN  import_tool/java/lib/gephi-toolkit.jar
Binary file not shown
View
0  java/lib/mysql-connector-java-5.1.18-bin.jar → ...a/lib/mysql-connector-java-5.1.18-bin.jar
File renamed without changes
View
0  java/lib/sqlitejdbc-v056.jar → import_tool/java/lib/sqlitejdbc-v056.jar
File renamed without changes
View
0  java/lib/xercesImpl.jar → import_tool/java/lib/xercesImpl.jar
File renamed without changes
View
0  java/src/edu/byu/nlp/topicvis/Bijection.java → ...a/src/edu/byu/nlp/topicvis/Bijection.java
File renamed without changes
View
0  ...u/nlp/topicvis/DistanceFilterBuilder.java → ...u/nlp/topicvis/DistanceFilterBuilder.java
File renamed without changes
View
0  ...u/nlp/topicvis/NeighborFilterBuilder.java → ...u/nlp/topicvis/NeighborFilterBuilder.java
File renamed without changes
View
0  ...yu/nlp/topicvis/TopicMapGraphBuilder.java → ...yu/nlp/topicvis/TopicMapGraphBuilder.java
File renamed without changes
View
0  ...is/TopicMetricDistanceGraphGenerator.java → ...is/TopicMetricDistanceGraphGenerator.java
File renamed without changes
View
0  .../edu/byu/nlp/topicvis/TopicSVGLinker.java → .../edu/byu/nlp/topicvis/TopicSVGLinker.java
File renamed without changes
View
0  ...c/edu/byu/nlp/topicvis/YambaDatabase.java → ...c/edu/byu/nlp/topicvis/YambaDatabase.java
File renamed without changes
View
0  topic_modeling/local_settings.py.sample → import_tool/local_settings.py.sample
File renamed without changes
View
0  metric_scripts/__init__.py → import_tool/metric_scripts/__init__.py
File renamed without changes
View
0  metric_scripts/analyses/__init__.py → ..._tool/metric_scripts/analyses/__init__.py
File renamed without changes
View
0  metric_scripts/analyses/entropy.py → ...t_tool/metric_scripts/analyses/entropy.py
File renamed without changes
View
0  metric_scripts/datasets/__init__.py → ..._tool/metric_scripts/datasets/__init__.py
File renamed without changes
View
0  metric_scripts/datasets/counts.py → ...rt_tool/metric_scripts/datasets/counts.py
File renamed without changes
View
0  metric_scripts/documents/__init__.py → ...tool/metric_scripts/documents/__init__.py
File renamed without changes
View
0  ...ic_scripts/documents/pairwise/__init__.py → ...ic_scripts/documents/pairwise/__init__.py
File renamed without changes
View
0  ...s/documents/pairwise/topic_correlation.py → ...s/documents/pairwise/topic_correlation.py
File renamed without changes
View
0  ...ts/documents/pairwise/word_correlation.py → ...ts/documents/pairwise/word_correlation.py
File renamed without changes
View
0  metric_scripts/documents/token_count.py → ...l/metric_scripts/documents/token_count.py
File renamed without changes
View
0  metric_scripts/documents/topic_entropy.py → ...metric_scripts/documents/topic_entropy.py
File renamed without changes
View
0  metric_scripts/documents/type_count.py → ...ol/metric_scripts/documents/type_count.py
File renamed without changes
View
0  metric_scripts/metric_set.py → import_tool/metric_scripts/metric_set.py
File renamed without changes
View
0  metric_scripts/topics/__init__.py → ...rt_tool/metric_scripts/topics/__init__.py
File renamed without changes
View
0  metric_scripts/topics/alpha.py → import_tool/metric_scripts/topics/alpha.py
File renamed without changes
View
0  metric_scripts/topics/attribute_entropy.py → ...etric_scripts/topics/attribute_entropy.py
File renamed without changes
View
0  metric_scripts/topics/centroid.py → ...rt_tool/metric_scripts/topics/centroid.py
File renamed without changes
View
0  metric_scripts/topics/coherence.py → ...t_tool/metric_scripts/topics/coherence.py
File renamed without changes
View
0  metric_scripts/topics/document_entropy.py → ...metric_scripts/topics/document_entropy.py
File renamed without changes
View
0  metric_scripts/topics/import_all.py → ..._tool/metric_scripts/topics/import_all.py
File renamed without changes
View
0  metric_scripts/topics/pairwise/__init__.py → ...etric_scripts/topics/pairwise/__init__.py
File renamed without changes
View
0  ...s/topics/pairwise/document_correlation.py → ...s/topics/pairwise/document_correlation.py
File renamed without changes
View
0  ...pts/topics/pairwise/pairwise_coherence.py → ...pts/topics/pairwise/pairwise_coherence.py
File renamed without changes
View
0  ...ripts/topics/pairwise/word_correlation.py → ...ripts/topics/pairwise/word_correlation.py
File renamed without changes
View
0  metric_scripts/topics/sentiment.py → ...t_tool/metric_scripts/topics/sentiment.py
File renamed without changes
View
0  ...scripts/topics/subset_document_entropy.py → ...scripts/topics/subset_document_entropy.py
File renamed without changes
View
0  metric_scripts/topics/subset_token_count.py → ...tric_scripts/topics/subset_token_count.py
File renamed without changes
View
0  metric_scripts/topics/token_count.py → ...tool/metric_scripts/topics/token_count.py
File renamed without changes
View
0  metric_scripts/topics/type_count.py → ..._tool/metric_scripts/topics/type_count.py
File renamed without changes
View
0  metric_scripts/topics/word_entropy.py → ...ool/metric_scripts/topics/word_entropy.py
File renamed without changes
View
28 run_import.py
@@ -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
View
1  run_server.sh
@@ -0,0 +1 @@
+python topic_modeling/manage.py runserver_plus
View
4 topic_modeling/settings.py
@@ -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.