Browse files

trash and move unneeded files

  • Loading branch information...
1 parent fd7a623 commit 9eeb145f489308dfbab0b2115334f121b0c32bf2 @dstufft dstufft committed May 16, 2012
Showing with 0 additions and 11,089 deletions.
  1. +0 −2 AUTHORS
  2. +0 −25 Makefile
  3. +0 −112 README.rst
  4. 0 {crateweb/conf/production → crate}/__init__.py
  5. 0 {crateweb/conf/dev → crate/pypi}/__init__.py
  6. 0 {crateweb/apps → crate}/pypi/admin.py
  7. 0 {crateweb/apps → crate}/pypi/exceptions.py
  8. 0 {crateweb/apps → crate}/pypi/migrations/0001_initial.py
  9. 0 {crateweb/apps → crate}/pypi/migrations/0002_auto__add_field_changelog_handled.py
  10. 0 {crateweb/apps → crate}/pypi/migrations/0003_auto__add_tasklog.py
  11. 0 ...apps → crate}/pypi/migrations/0004_auto__del_field_tasklog_worker__add_field_tasklog_exception.py
  12. 0 {crateweb/apps → crate}/pypi/migrations/0005_auto__add_downloadchange.py
  13. 0 ...→ crate}/pypi/migrations/0006_auto__add_pypimirrorpage__add_unique_pypimirrorpage_package_type.py
  14. 0 {crateweb/apps → crate}/pypi/migrations/0007_move_package_modified_into_redis.py
  15. 0 {crateweb/apps → crate}/pypi/migrations/0008_auto__del_tasklog__del_packagemodified.py
  16. 0 {crateweb/apps → crate}/pypi/migrations/0009_auto__del_downloadchange.py
  17. 0 {crateweb/apps → crate}/pypi/migrations/0010_auto__add_pypiserversigpage.py
  18. 0 {crateweb/apps → crate}/pypi/migrations/0011_split_serversig.py
  19. 0 ...e}/pypi/migrations/0012_auto__del_field_pypimirrorpage_type__add_unique_pypimirrorpage_package.py
  20. 0 ...e}/pypi/migrations/0013_auto__add_field_pypimirrorpage_created__add_field_pypimirrorpage_modif.py
  21. 0 {crateweb/apps → crate}/pypi/migrations/0014_auto__add_pypiindexpage.py
  22. 0 {crateweb/apps → crate}/pypi/migrations/0015_auto__del_log__del_changelog__add_pypidownloadchange.py
  23. 0 {crateweb/apps → crate}/pypi/migrations/0016_auto.py
  24. 0 {crateweb/apps → crate}/pypi/migrations/0017_auto__add_field_pypidownloadchange_integrated.py
  25. 0 {crateweb/conf → crate/pypi/migrations}/__init__.py
  26. 0 {crateweb/apps → crate}/pypi/models.py
  27. 0 {crateweb/apps → crate}/pypi/processor.py
  28. 0 {crateweb/apps/search/templatetags → crate/pypi/simple}/__init__.py
  29. 0 {crateweb/apps → crate}/pypi/simple/urls.py
  30. 0 {crateweb/apps → crate}/pypi/simple/views.py
  31. 0 {crateweb/apps → crate}/pypi/tasks.py
  32. 0 {crateweb/apps/search → crate/pypi/utils}/__init__.py
  33. 0 {crateweb/apps → crate}/pypi/utils/serversigs.py
  34. 0 crateweb/__init__.py
  35. +0 −15 crateweb/api_urls.py
  36. 0 crateweb/apps/__init__.py
  37. 0 crateweb/apps/about/__init__.py
  38. +0 −3 crateweb/apps/about/models.py
  39. +0 −10 crateweb/apps/about/urls.py
  40. +0 −1 crateweb/apps/about/views.py
  41. 0 crateweb/apps/aws_stats/__init__.py
  42. +0 −12 crateweb/apps/aws_stats/admin.py
  43. +0 −50 crateweb/apps/aws_stats/migrations/0001_initial.py
  44. +0 −45 crateweb/apps/aws_stats/migrations/0002_auto__add_logprocessed.py
  45. 0 crateweb/apps/aws_stats/migrations/__init__.py
  46. +0 −27 crateweb/apps/aws_stats/models.py
  47. +0 −88 crateweb/apps/aws_stats/tasks.py
  48. 0 crateweb/apps/core/__init__.py
  49. +0 −113 crateweb/apps/core/helpers.py
  50. 0 crateweb/apps/core/management/__init__.py
  51. 0 crateweb/apps/core/management/commands/__init__.py
  52. +0 −19 crateweb/apps/core/management/commands/dummy_passwords.py
  53. +0 −20 crateweb/apps/core/management/commands/migrate_django_openid_social_auth.py
  54. +0 −13 crateweb/apps/core/management/commands/migrate_emails_pinax_dua.py
  55. 0 crateweb/apps/core/models.py
  56. 0 crateweb/apps/core/social_auth/__init__.py
  57. +0 −47 crateweb/apps/core/social_auth/backends/__init__.py
  58. 0 crateweb/apps/core/social_auth/pipeline/__init__.py
  59. +0 −26 crateweb/apps/core/social_auth/pipeline/associate.py
  60. +0 −34 crateweb/apps/core/social_auth/pipeline/user.py
  61. +0 −7 crateweb/apps/core/social_auth/urls.py
  62. +0 −44 crateweb/apps/core/social_auth/views.py
  63. 0 crateweb/apps/crate/__init__.py
  64. +0 −1 crateweb/apps/crate/dashboard/__init__.py
  65. +0 −54 crateweb/apps/crate/dashboard/index.py
  66. +0 −44 crateweb/apps/crate/dashboard/modules.py
  67. +0 −1 crateweb/apps/crate/fields/__init__.py
  68. +0 −58 crateweb/apps/crate/fields/json.py
  69. 0 crateweb/apps/crate/management/__init__.py
  70. 0 crateweb/apps/crate/management/commands/__init__.py
  71. +0 −14 crateweb/apps/crate/management/commands/celery_status.py
  72. +0 −14 crateweb/apps/crate/management/commands/clear_celery.py
  73. +0 −18 crateweb/apps/crate/management/commands/clear_celery_meta.py
  74. +0 −16 crateweb/apps/crate/management/commands/fix_missing_files.py
  75. +0 −8 crateweb/apps/crate/management/commands/force_key_rollover.py
  76. +0 −11 crateweb/apps/crate/management/commands/get_last_sync.py
  77. +0 −15 crateweb/apps/crate/management/commands/get_pypi_serverkey.py
  78. +0 −9 crateweb/apps/crate/management/commands/migrate_releases.py
  79. +0 −10 crateweb/apps/crate/management/commands/reset_hidden.py
  80. +0 −12 crateweb/apps/crate/management/commands/set_last_sync.py
  81. +0 −24 crateweb/apps/crate/management/commands/sync_mirror.py
  82. +0 −10 crateweb/apps/crate/management/commands/trigger_bulk_sync.py
  83. 0 crateweb/apps/crate/models.py
  84. +0 −5 crateweb/apps/crate/template2.py
  85. 0 crateweb/apps/crate/templatetags/__init__.py
  86. +0 −16 crateweb/apps/crate/templatetags/pagination_utils.py
  87. 0 crateweb/apps/crate/utils/__init__.py
  88. +0 −72 crateweb/apps/crate/utils/datatools.py
  89. +0 −59 crateweb/apps/crate/utils/lock.py
  90. +0 −17 crateweb/apps/crate/views.py
  91. +0 −24 crateweb/apps/evaluator/__init__.py
  92. +0 −25 crateweb/apps/evaluator/evaluators.py
  93. 0 crateweb/apps/evaluator/models.py
  94. 0 crateweb/apps/evaluator/templatetags/__init__.py
  95. +0 −10 crateweb/apps/evaluator/templatetags/evaluators.py
  96. 0 crateweb/apps/favorites/__init__.py
  97. +0 −74 crateweb/apps/favorites/migrations/0001_initial.py
  98. +0 −94 ...vorites/migrations/0002_auto__del_field_favorite_target_id__del_field_favorite_content_type__a.py
  99. +0 −74 crateweb/apps/favorites/migrations/0003_auto__chg_field_favorite_package.py
  100. +0 −92 crateweb/apps/favorites/migrations/0004_move_to_lists.py
  101. +0 −35 crateweb/apps/favorites/migrations/0005_auto__del_favorite__del_unique_favorite_user_package.py
  102. 0 crateweb/apps/favorites/migrations/__init__.py
  103. 0 crateweb/apps/favorites/models.py
  104. +0 −8 crateweb/apps/favorites/urls.py
  105. +0 −67 crateweb/apps/favorites/views.py
  106. 0 crateweb/apps/helpdocs/__init__.py
  107. 0 crateweb/apps/helpdocs/models.py
  108. +0 −7 crateweb/apps/helpdocs/urls.py
  109. 0 crateweb/apps/history/__init__.py
  110. +0 −12 crateweb/apps/history/admin.py
  111. +0 −40 crateweb/apps/history/migrations/0001_initial.py
  112. +0 −31 crateweb/apps/history/migrations/0002_auto__chg_field_event_data.py
  113. +0 −147 crateweb/apps/history/migrations/0003_convert_changelog_to_history.py
  114. 0 crateweb/apps/history/migrations/__init__.py
  115. +0 −91 crateweb/apps/history/models.py
  116. 0 crateweb/apps/jhumanize/__init__.py
  117. +0 −31 crateweb/apps/jhumanize/helpers.py
  118. 0 crateweb/apps/jhumanize/models.py
  119. 0 crateweb/apps/ji18n/__init__.py
  120. +0 −13 crateweb/apps/ji18n/translate.py
  121. 0 crateweb/apps/jintercom/__init__.py
  122. +0 −31 crateweb/apps/jintercom/helpers.py
  123. 0 crateweb/apps/jintercom/models.py
  124. +0 −39 crateweb/apps/jintercom/templates/intercom.html
  125. 0 crateweb/apps/jmetron/__init__.py
  126. +0 −15 crateweb/apps/jmetron/helpers.py
  127. 0 crateweb/apps/jmetron/models.py
  128. +0 −13 crateweb/apps/jmetron/templates/metron/gauges.html
  129. +0 −20 crateweb/apps/jmetron/templates/metron/google.html
  130. +0 −5 crateweb/apps/jmetron/templates/metron/widget.html
  131. 0 crateweb/apps/lists/__init__.py
  132. +0 −23 crateweb/apps/lists/admin.py
  133. +0 −15 crateweb/apps/lists/forms.py
  134. +0 −16 crateweb/apps/lists/helpers.py
  135. +0 −101 crateweb/apps/lists/migrations/0001_initial.py
  136. +0 −85 crateweb/apps/lists/migrations/0002_auto__add_field_list_slug__add_unique_list_user_slug.py
  137. +0 −88 crateweb/apps/lists/migrations/0003_migrate_name_to_slug.py
  138. +0 −77 crateweb/apps/lists/migrations/0004_auto__chg_field_list_slug.py
  139. +0 −80 crateweb/apps/lists/migrations/0005_auto__add_field_list_description.py
  140. 0 crateweb/apps/lists/migrations/__init__.py
  141. +0 −47 crateweb/apps/lists/models.py
  142. +0 −12 crateweb/apps/lists/urls.py
  143. +0 −182 crateweb/apps/lists/views.py
  144. 0 crateweb/apps/packages/__init__.py
  145. +0 −91 crateweb/apps/packages/admin.py
  146. +0 −195 crateweb/apps/packages/api.py
  147. +0 −152 crateweb/apps/packages/evaluators.py
  148. +0 −11 crateweb/apps/packages/helpers.py
  149. +0 −266 crateweb/apps/packages/migrations/0001_initial.py
  150. +0 −113 crateweb/apps/packages/migrations/0003_auto__add_field_release_frequency.py
  151. +0 −128 crateweb/apps/packages/migrations/0004_auto__add_changelog.py
  152. +0 −123 crateweb/apps/packages/migrations/0005_auto__add_field_package_featured.py
  153. +0 −129 ...eb/apps/packages/migrations/0006_auto__del_field_release_frequency__del_field_package_featured.py
  154. +0 −122 crateweb/apps/packages/migrations/0007_auto__add_field_package_downloads_synced_on.py
  155. +0 −131 crateweb/apps/packages/migrations/0008_auto__add_readthedocspackageslug.py
  156. +0 −138 crateweb/apps/packages/migrations/0009_auto__add_field_release_deleted__add_field_package_deleted.py
  157. +0 −128 crateweb/apps/packages/migrations/0010_auto.py
  158. +0 −128 crateweb/apps/packages/migrations/0011_auto.py
  159. +0 −128 crateweb/apps/packages/migrations/0012_auto.py
  160. +0 −134 crateweb/apps/packages/migrations/0013_auto.py
  161. +0 −139 crateweb/apps/packages/migrations/0014_delete_deleted.py
  162. +0 −136 crateweb/apps/packages/migrations/0015_auto__del_field_release_deleted__del_field_package_deleted.py
  163. +0 −129 crateweb/apps/packages/migrations/0016_auto__add_field_package_normalized_name.py
  164. +0 −126 crateweb/apps/packages/migrations/0017_normalize_names.py
  165. +0 −128 ...ackages/migrations/0018_auto__chg_field_package_normalized_name__add_unique_package_normalized.py
  166. +0 −130 crateweb/apps/packages/migrations/0019_auto__add_field_releasefile_hidden.py
  167. +0 −131 crateweb/apps/packages/migrations/0020_auto__add_field_release_show_install_command.py
  168. +0 −125 crateweb/apps/packages/migrations/0021_migrate_plone.py
  169. +0 −142 crateweb/apps/packages/migrations/0022_auto__add_downloaddelta.py
  170. +0 −136 crateweb/apps/packages/migrations/0023_auto__add_unique_downloaddelta_date_file.py
  171. +0 −136 crateweb/apps/packages/migrations/0024_auto.py
  172. +0 −147 crateweb/apps/packages/migrations/0025_auto__add_downloadstatscache.py
  173. +0 −141 crateweb/apps/packages/migrations/0026_auto__del_downloadstatscache.py
  174. 0 crateweb/apps/packages/migrations/__init__.py
  175. +0 −531 crateweb/apps/packages/models.py
  176. +0 −107 crateweb/apps/packages/search_indexes.py
  177. 0 crateweb/apps/packages/simple/__init__.py
  178. +0 −10 crateweb/apps/packages/simple/restricted_urls.py
  179. +0 −10 crateweb/apps/packages/simple/urls.py
  180. +0 −110 crateweb/apps/packages/simple/views.py
  181. 0 crateweb/apps/packages/stats/__init__.py
  182. +0 −5 crateweb/apps/packages/stats/urls.py
  183. +0 −57 crateweb/apps/packages/stats/views.py
  184. +0 −9 crateweb/apps/packages/tasks.py
  185. 0 crateweb/apps/packages/templatetags/__init__.py
  186. +0 −103 crateweb/apps/packages/templatetags/package_tags.py
  187. +0 −20 crateweb/apps/packages/templatetags/package_utils.py
  188. +0 −7 crateweb/apps/packages/urls.py
  189. 0 crateweb/apps/packages/utils/__init__.py
  190. +0 −65 crateweb/apps/packages/utils/metadata.py
  191. +0 −328 crateweb/apps/packages/utils/verlib.py
  192. +0 −51 crateweb/apps/packages/views.py
  193. 0 crateweb/apps/pypi/__init__.py
  194. 0 crateweb/apps/pypi/migrations/__init__.py
  195. 0 crateweb/apps/pypi/simple/__init__.py
  196. 0 crateweb/apps/pypi/utils/__init__.py
  197. +0 −38 crateweb/apps/search/forms.py
  198. +0 −12 crateweb/apps/search/helpers.py
  199. +0 −52 crateweb/apps/search/indexes.py
  200. +0 −1 crateweb/apps/search/models.py
  201. +0 −56 crateweb/apps/search/templatetags/search_utils.py
  202. +0 −8 crateweb/apps/search/urls.py
  203. +0 −199 crateweb/apps/search/views.py
  204. +0 −281 crateweb/conf/base.py
  205. +0 −92 crateweb/conf/dev/base.py
  206. +0 −112 crateweb/conf/production/base.py
  207. +0 −73 crateweb/conf/production/gondor.py
  208. +0 −34 crateweb/fixtures/initial_data.json
  209. +0 −10 crateweb/hosts.py
  210. +0 −13 crateweb/static/README
  211. +0 −9 crateweb/static/css/bootstrap-responsive.min.css
  212. +0 −9 crateweb/static/css/bootstrap.min.css
  213. +0 −54 crateweb/static/css/crate.css
  214. +0 −52 crateweb/static/css/prettify.css
  215. +0 −1 crateweb/static/css/rickshaw.min.css
  216. BIN crateweb/static/img/ajax-loader.gif
  217. BIN crateweb/static/img/auth/bitbucket.png
  218. BIN crateweb/static/img/auth/github.png
  219. BIN crateweb/static/img/beta.png
  220. BIN crateweb/static/img/follow.png
  221. BIN crateweb/static/img/followed.png
  222. BIN crateweb/static/img/glyphicons-halflings.png
  223. BIN crateweb/static/img/glyphicons/lock.png
  224. BIN crateweb/static/img/search.png
  225. BIN crateweb/static/img/sponsors/dyn.png
  226. BIN crateweb/static/img/sponsors/gondor.png
  227. +0 −28 crateweb/static/js/ajaxCSRF.js
  228. +0 −6 crateweb/static/js/bootstrap.min.js
  229. +0 −105 crateweb/static/js/crate.js
  230. +0 −4 crateweb/static/js/lib/d3.v2.min.js
  231. +0 −104 crateweb/static/js/lib/date.js
  232. +0 −106 crateweb/static/js/lib/fayer.js
  233. +0 −1 crateweb/static/js/lib/jquery.history.js
  234. +0 −9 crateweb/static/js/lib/less-1.3.0.min.js
  235. +0 −2 crateweb/static/js/lib/rickshaw.min.js
  236. +0 −2 crateweb/static/js/prettify/lang-apollo.js
  237. +0 −18 crateweb/static/js/prettify/lang-clj.js
  238. +0 −2 crateweb/static/js/prettify/lang-css.js
  239. +0 −1 crateweb/static/js/prettify/lang-go.js
  240. +0 −2 crateweb/static/js/prettify/lang-hs.js
  241. +0 −3 crateweb/static/js/prettify/lang-lisp.js
  242. +0 −2 crateweb/static/js/prettify/lang-lua.js
  243. +0 −2 crateweb/static/js/prettify/lang-ml.js
  244. +0 −4 crateweb/static/js/prettify/lang-n.js
  245. +0 −1 crateweb/static/js/prettify/lang-proto.js
  246. +0 −2 crateweb/static/js/prettify/lang-scala.js
  247. +0 −2 crateweb/static/js/prettify/lang-sql.js
  248. +0 −1 crateweb/static/js/prettify/lang-tex.js
  249. +0 −2 crateweb/static/js/prettify/lang-vb.js
  250. +0 −3 crateweb/static/js/prettify/lang-vhdl.js
  251. +0 −2 crateweb/static/js/prettify/lang-wiki.js
  252. +0 −3 crateweb/static/js/prettify/lang-xq.js
  253. +0 −2 crateweb/static/js/prettify/lang-yaml.js
  254. +0 −28 crateweb/static/js/prettify/prettify.js
  255. +0 −472 crateweb/static/less/crate.less
  256. +0 −10 crateweb/templates/404.html
  257. +0 −10 crateweb/templates/500.html
  258. +0 −21 crateweb/templates/_account_bar.html
  259. +0 −42 crateweb/templates/_dtl/admin_tools/dashboard/modules/redis.html
  260. +0 −38 crateweb/templates/_dtl/admin_tools/dashboard/modules/status.html
  261. +0 −27 crateweb/templates/_footer.html
  262. +0 −6 crateweb/templates/_messages.html
  263. +0 −50 crateweb/templates/about/privacy.html
  264. +0 −17 crateweb/templates/about/terms.html
  265. +0 −17 crateweb/templates/account/_login_sidebar.html
  266. +0 −17 crateweb/templates/account/_signup_sidebar.html
  267. +0 −5 crateweb/templates/account/_terms.html
  268. +0 −13 crateweb/templates/account/base.html
  269. +0 −4 crateweb/templates/account/email/email_confirmation_message.txt
  270. +0 −1 crateweb/templates/account/email/email_confirmation_subject.txt
  271. +0 −5 crateweb/templates/account/email/password_reset.txt
  272. +0 −1 crateweb/templates/account/email/password_reset_subject.txt
  273. +0 −21 crateweb/templates/account/email_confirm.html
  274. +0 −10 crateweb/templates/account/email_confirmation_sent.html
  275. +0 −8 crateweb/templates/account/email_confirmed.html
  276. +0 −54 crateweb/templates/account/login.html
  277. +0 −22 crateweb/templates/account/logout.html
  278. +0 −19 crateweb/templates/account/password_change.html
  279. +0 −32 crateweb/templates/account/password_reset.html
  280. +0 −22 crateweb/templates/account/password_reset_sent.html
  281. +0 −20 crateweb/templates/account/password_reset_token.html
  282. +0 −11 crateweb/templates/account/password_reset_token_fail.html
  283. +0 −19 crateweb/templates/account/settings.html
  284. +0 −57 crateweb/templates/account/signup.html
  285. +0 −3 crateweb/templates/bootstrap/_field_errors.html
  286. +0 −3 crateweb/templates/bootstrap/_field_errors_block.html
  287. +0 −3 crateweb/templates/bootstrap/_field_help_text.html
  288. +0 −54 crateweb/templates/bootstrap/field.html
  289. +0 −17 crateweb/templates/bootstrap/forms.html
  290. +0 −9 crateweb/templates/django_openid/already_logged_in.html
  291. +0 −23 crateweb/templates/django_openid/associate.html
  292. +0 −53 crateweb/templates/django_openid/associations.html
  293. +0 −9 crateweb/templates/django_openid/error.html
  294. +0 −33 crateweb/templates/django_openid/login.html
  295. +0 −9 crateweb/templates/django_openid/message.html
  296. +0 −35 crateweb/templates/django_openid/register.html
  297. +0 −9 crateweb/templates/django_openid/registration_closed.html
  298. +0 −19 crateweb/templates/emailconfirmation/confirm_email.html
  299. +0 −4 crateweb/templates/emailconfirmation/email_confirmation_message.txt
  300. +0 −1 crateweb/templates/emailconfirmation/email_confirmation_subject.txt
Sorry, we could not display the entire diff because too many files (346) changed.
View
2 AUTHORS
@@ -1,2 +0,0 @@
-* Donald Stufft
-* Daniel Lindsley
View
25 Makefile
@@ -1,25 +0,0 @@
-LOCALE=en
-DUMPPATH=$(HOME)/Dropbox/Crate/crate.dump
-DBNAME=crate
-
-makemessages:
- pybabel extract -F .babel.cfg --msgid-bugs-address support@crate.io --copyright-holder Crate --project Crate -o locale/messages.pot .
- pybabel update -D django -i locale/messages.pot -d locale -l en
-
-compilemessages:
- pybabel compile -D django -i locale/$(LOCALE)/LC_MESSAGES/django.po -d locale -l $(LOCALE)
-
-freshdb:
- dropdb crate
- createdb crate
-
-reloaddb: freshdb
- pg_restore -d $(DBNAME) -j 8 --no-owner --no-acl $(DUMPPATH)
-
-updb:
- python manage.py syncdb
- python manage.py migrate
- python manage.py dummy_passwords
-
-serve:
- python manage.py runserver
View
112 README.rst
@@ -1,112 +0,0 @@
-Crate
-=====
-
-Crate is a PyPI_ Mirror/Python Package Index that was written to make it easy to discover
-packages, evaluate them for usefulness, and then install them. Additionally it also focuses
-on presenting an extremely stable interface to PyPI compatible applications (e.g. pip).
-
-With Crate you should be able to quickly find, evaluate, and install your packages
-with no worries about if something is going to be down or not.
-
-Discussion
-==========
-
-Discussion about crate can take place either in #crate on freenode or on
-`GitHub Issues <https://github.com/crateio/crate-site/issues>`_.
-
-
-Technology Stack
-================
-
-Crate.io_ is built on top of Python using the Django framework. It uses Celery
-to process its shared tasks, PostgreSQL to store its data, and Redis as its
-caching layer.
-
-Relation to PyPI
-================
-
-The software that powers Crate.io_ defaults to PyPI_, but can technically be used
-with any index that presents the same
-`XML-RPC API <http://wiki.python.org/moin/PyPiXmlRpc>`_.
-
-Crate.io_ the website currently only mirrors PyPI_. All packages and their associated
-data come from PyPI. Crate.io provides a reliable place for those packages to be stored
-and accessed and tries to present a cleaner and more user-friendly interface to
-that data.
-
-Development
-===========
-
-Install PostgreSQL
-------------------
-
-On OS X one possible way is to use `Homebrew
-<http://mxcl.github.com/homebrew/>`_::
-
- brew install postgresql9
- initdb /usr/local/var/postgres9
- mkdir -p ~/Library/LaunchAgents
- cp /usr/local/Cellar/postgresql9/9.0.7/org.postgresql.postgres.plist ~/Library/LaunchAgents/
- launchctl load -w ~/Library/LaunchAgents/org.postgresql.postgres.plist
-
-There are some alternatives to Homebrew for installing PostgreSQL at http://www.postgresql.org/download/
-
-And create the PostgreSQL database::
-
- createdb crate
-
-For searching packages to work, you will need `elasticsearch
-<http://www.elasticsearch.org/>`_. I installed it via Homebrew::
-
- brew install elasticsearch
-
-Then create and activate a `virtualenv
-<https://crate.io/packages/virtualenv/>`_ -- everybody has their favorite way;
-here's what I did (``mkvirtualenv`` comes from `virtualenvwrapper
-<https://crate.io/packages/virtualenvwrapper/>`_), inspired by `dstufft's gist
-<https://gist.github.com/6869afeec3a5ec5ad116>`_::
-
- mkvirtualenv --no-site-packages --distribute crate-site
- echo "export DJANGO_SETTINGS_MODULE=crateweb.conf.dev.base" >> $VIRTUAL_ENV/bin/postactivate
- echo "unset DJANGO_SETTINGS_MODULE" >> $VIRTUAL_ENV/bin/postdeactivate
- workon crate-site # virtualenv is already activated by mkvirtualenv but have to refresh postactivate
-
-Install dependencies::
-
- pip install -r requirements.txt
-
-Do the Django dance::
-
- export LC_ALL="en.UTF-8" # Otherwise I get "TypeError: decode() argument 1 must be string, not None" in django.contrib.auth.management
- python manage.py syncdb
- python manage.py migrate
- python manage.py runserver
-
-Admire the results of your work at http://localhost:8000/::
-
- open http://localhost:8000/
-
-You won't have any packages in your database which makes testing harder. A full
-sync from PyPI takes some time, like 2 days or so the first time but you can
-start a full sync and just stop it after 15 minutes or so and you'll have some
-packages.
-
-To start downloading packages from `PyPI <http://pypi.python.org/pypi>`_ into
-the local database::
-
- python manage.py celeryd
- python manage.py trigger_bulk_sync
-
-Once you have some packages, then you can build the search index so that you
-can search them::
-
- elasticsearch
- python manage.py rebuild_index
-
-Say yes to blowing away the index since you don't have one yet anyway. Indexing
-1073 packages took a few seconds for me.
-
-@@@ Todo Write More Development Docs?
-
-.. _PyPI: http://pypi.python.org/pypi
-.. _Crate.io: https://crate.io/
View
0 crateweb/conf/production/__init__.py → crate/__init__.py
File renamed without changes.
View
0 crateweb/conf/dev/__init__.py → crate/pypi/__init__.py
File renamed without changes.
View
0 crateweb/apps/pypi/admin.py → crate/pypi/admin.py
File renamed without changes.
View
0 crateweb/apps/pypi/exceptions.py → crate/pypi/exceptions.py
File renamed without changes.
View
0 ...eweb/apps/pypi/migrations/0001_initial.py → crate/pypi/migrations/0001_initial.py
File renamed without changes.
View
0 ...0002_auto__add_field_changelog_handled.py → ...0002_auto__add_field_changelog_handled.py
File renamed without changes.
View
0 ...pypi/migrations/0003_auto__add_tasklog.py → ...pypi/migrations/0003_auto__add_tasklog.py
File renamed without changes.
View
0 ...og_worker__add_field_tasklog_exception.py → ...og_worker__add_field_tasklog_exception.py
File renamed without changes.
View
0 ...grations/0005_auto__add_downloadchange.py → ...grations/0005_auto__add_downloadchange.py
File renamed without changes.
View
0 ...add_unique_pypimirrorpage_package_type.py → ...add_unique_pypimirrorpage_package_type.py
File renamed without changes.
View
0 .../0007_move_package_modified_into_redis.py → .../0007_move_package_modified_into_redis.py
File renamed without changes.
View
0 ...auto__del_tasklog__del_packagemodified.py → ...auto__del_tasklog__del_packagemodified.py
File renamed without changes.
View
0 ...grations/0009_auto__del_downloadchange.py → ...grations/0009_auto__del_downloadchange.py
File renamed without changes.
View
0 ...tions/0010_auto__add_pypiserversigpage.py → ...tions/0010_auto__add_pypiserversigpage.py
File renamed without changes.
View
0 ...s/pypi/migrations/0011_split_serversig.py → ...e/pypi/migrations/0011_split_serversig.py
File renamed without changes.
View
0 ...ype__add_unique_pypimirrorpage_package.py → ...ype__add_unique_pypimirrorpage_package.py
File renamed without changes.
View
0 ...reated__add_field_pypimirrorpage_modif.py → ...reated__add_field_pypimirrorpage_modif.py
File renamed without changes.
View
0 ...igrations/0014_auto__add_pypiindexpage.py → ...igrations/0014_auto__add_pypiindexpage.py
File renamed without changes.
View
0 ..._del_changelog__add_pypidownloadchange.py → ..._del_changelog__add_pypidownloadchange.py
File renamed without changes.
View
0 crateweb/apps/pypi/migrations/0016_auto.py → crate/pypi/migrations/0016_auto.py
File renamed without changes.
View
0 ...dd_field_pypidownloadchange_integrated.py → ...dd_field_pypidownloadchange_integrated.py
File renamed without changes.
View
0 crateweb/conf/__init__.py → crate/pypi/migrations/__init__.py
File renamed without changes.
View
0 crateweb/apps/pypi/models.py → crate/pypi/models.py
File renamed without changes.
View
0 crateweb/apps/pypi/processor.py → crate/pypi/processor.py
File renamed without changes.
View
0 ...eweb/apps/search/templatetags/__init__.py → crate/pypi/simple/__init__.py
File renamed without changes.
View
0 crateweb/apps/pypi/simple/urls.py → crate/pypi/simple/urls.py
File renamed without changes.
View
0 crateweb/apps/pypi/simple/views.py → crate/pypi/simple/views.py
File renamed without changes.
View
0 crateweb/apps/pypi/tasks.py → crate/pypi/tasks.py
File renamed without changes.
View
0 crateweb/apps/search/__init__.py → crate/pypi/utils/__init__.py
File renamed without changes.
View
0 crateweb/apps/pypi/utils/serversigs.py → crate/pypi/utils/serversigs.py
File renamed without changes.
View
0 crateweb/__init__.py
No changes.
View
15 crateweb/api_urls.py
@@ -1,15 +0,0 @@
-from django.conf.urls import patterns, include, url
-
-from tastypie.api import Api
-
-from packages.api import PackageResource, ReleaseResource
-
-v1_api = Api(api_name="v1")
-
-v1_api.register(PackageResource())
-v1_api.register(ReleaseResource())
-
-
-urlpatterns = patterns("",
- url("", include(include(v1_api.urls))),
-)
View
0 crateweb/apps/__init__.py
No changes.
View
0 crateweb/apps/about/__init__.py
No changes.
View
3 crateweb/apps/about/models.py
@@ -1,3 +0,0 @@
-from django.db import models
-
-# Create your models here.
View
10 crateweb/apps/about/urls.py
@@ -1,10 +0,0 @@
-from django.conf.urls import patterns, url
-from django.views.generic.simple import direct_to_template
-
-
-urlpatterns = patterns("",
- url(r"^$", direct_to_template, {"template": "about/about.html"}, name="about"),
- url(r"^terms/$", direct_to_template, {"template": "about/terms.html"}, name="terms"),
- url(r"^privacy/$", direct_to_template, {"template": "about/privacy.html"}, name="privacy"),
- url(r"^dmca/$", direct_to_template, {"template": "about/dmca.html"}, name="dmca"),
-)
View
1 crateweb/apps/about/views.py
@@ -1 +0,0 @@
-# Create your views here.
View
0 crateweb/apps/aws_stats/__init__.py
No changes.
View
12 crateweb/apps/aws_stats/admin.py
@@ -1,12 +0,0 @@
-from django.contrib import admin
-
-from aws_stats.models import Log
-
-
-class LogAdmin(admin.ModelAdmin):
- list_display = ["when", "method", "status", "host", "uri_stem", "uri_query", "ip", "edge_location"]
- list_filter = ["when", "method", "status", "edge_location"]
- search_fields = ["host", "uri_stem", "uri_query", "ip", "referer", "user_agent"]
-
-
-admin.site.register(Log, LogAdmin)
View
50 crateweb/apps/aws_stats/migrations/0001_initial.py
@@ -1,50 +0,0 @@
-# -*- coding: utf-8 -*-
-import datetime
-from south.db import db
-from south.v2 import SchemaMigration
-from django.db import models
-
-
-class Migration(SchemaMigration):
-
- def forwards(self, orm):
- # Adding model 'Log'
- db.create_table('aws_stats_log', (
- ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
- ('when', self.gf('django.db.models.fields.DateTimeField')()),
- ('edge_location', self.gf('django.db.models.fields.CharField')(max_length=25)),
- ('method', self.gf('django.db.models.fields.CharField')(max_length=25)),
- ('status', self.gf('django.db.models.fields.CharField')(max_length=3)),
- ('bytes', self.gf('django.db.models.fields.PositiveIntegerField')()),
- ('host', self.gf('django.db.models.fields.TextField')()),
- ('uri_stem', self.gf('django.db.models.fields.TextField')()),
- ('uri_query', self.gf('django.db.models.fields.TextField')(blank=True)),
- ('ip', self.gf('django.db.models.fields.GenericIPAddressField')(max_length=39)),
- ('referer', self.gf('django.db.models.fields.TextField')(blank=True)),
- ('user_agent', self.gf('django.db.models.fields.TextField')(blank=True)),
- ))
- db.send_create_signal('aws_stats', ['Log'])
-
- def backwards(self, orm):
- # Deleting model 'Log'
- db.delete_table('aws_stats_log')
-
- models = {
- 'aws_stats.log': {
- 'Meta': {'object_name': 'Log'},
- 'bytes': ('django.db.models.fields.PositiveIntegerField', [], {}),
- 'edge_location': ('django.db.models.fields.CharField', [], {'max_length': '25'}),
- 'host': ('django.db.models.fields.TextField', [], {}),
- 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
- 'ip': ('django.db.models.fields.GenericIPAddressField', [], {'max_length': '39'}),
- 'method': ('django.db.models.fields.CharField', [], {'max_length': '25'}),
- 'referer': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
- 'status': ('django.db.models.fields.CharField', [], {'max_length': '3'}),
- 'uri_query': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
- 'uri_stem': ('django.db.models.fields.TextField', [], {}),
- 'user_agent': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
- 'when': ('django.db.models.fields.DateTimeField', [], {})
- }
- }
-
- complete_apps = ['aws_stats']
View
45 crateweb/apps/aws_stats/migrations/0002_auto__add_logprocessed.py
@@ -1,45 +0,0 @@
-# -*- coding: utf-8 -*-
-import datetime
-from south.db import db
-from south.v2 import SchemaMigration
-from django.db import models
-
-
-class Migration(SchemaMigration):
-
- def forwards(self, orm):
- # Adding model 'LogProcessed'
- db.create_table('aws_stats_logprocessed', (
- ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
- ('name', self.gf('django.db.models.fields.TextField')(unique=True)),
- ))
- db.send_create_signal('aws_stats', ['LogProcessed'])
-
- def backwards(self, orm):
- # Deleting model 'LogProcessed'
- db.delete_table('aws_stats_logprocessed')
-
- models = {
- 'aws_stats.log': {
- 'Meta': {'object_name': 'Log'},
- 'bytes': ('django.db.models.fields.PositiveIntegerField', [], {}),
- 'edge_location': ('django.db.models.fields.CharField', [], {'max_length': '25'}),
- 'host': ('django.db.models.fields.TextField', [], {}),
- 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
- 'ip': ('django.db.models.fields.GenericIPAddressField', [], {'max_length': '39'}),
- 'method': ('django.db.models.fields.CharField', [], {'max_length': '25'}),
- 'referer': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
- 'status': ('django.db.models.fields.CharField', [], {'max_length': '3'}),
- 'uri_query': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
- 'uri_stem': ('django.db.models.fields.TextField', [], {}),
- 'user_agent': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
- 'when': ('django.db.models.fields.DateTimeField', [], {})
- },
- 'aws_stats.logprocessed': {
- 'Meta': {'object_name': 'LogProcessed'},
- 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
- 'name': ('django.db.models.fields.TextField', [], {'unique': 'True'})
- }
- }
-
- complete_apps = ['aws_stats']
View
0 crateweb/apps/aws_stats/migrations/__init__.py
No changes.
View
27 crateweb/apps/aws_stats/models.py
@@ -1,27 +0,0 @@
-from django.db import models
-
-
-class Log(models.Model):
-
- when = models.DateTimeField()
- edge_location = models.CharField(max_length=25)
-
- method = models.CharField(max_length=25)
- status = models.CharField(max_length=3)
- bytes = models.PositiveIntegerField()
-
- host = models.TextField()
- uri_stem = models.TextField()
- uri_query = models.TextField(blank=True)
-
- ip = models.GenericIPAddressField(unpack_ipv4=True)
- referer = models.TextField(blank=True)
- user_agent = models.TextField(blank=True)
-
- def __unicode__(self):
- return "%(method)s %(uri_stem)s" % self.__dict__
-
-
-class LogProcessed(models.Model):
-
- name = models.TextField(unique=True)
View
88 crateweb/apps/aws_stats/tasks.py
@@ -1,88 +0,0 @@
-import datetime
-import gzip
-import itertools
-import logging
-import re
-import StringIO
-import urllib
-
-from django.conf import settings
-from django.db import transaction
-
-from boto.s3.connection import S3Connection
-from celery.task import task
-from pytz import utc
-
-from aws_stats.models import Log, LogProcessed
-
-logger = logging.getLogger(__name__)
-
-
-_log_filename = re.compile(settings.AWS_STATS_LOG_REGEX)
-
-
-@task
-def process_aws_log(key):
- if LogProcessed.objects.filter(name=key).exists():
- return
-
- conn = S3Connection(settings.AWS_ACCESS_KEY_ID, settings.AWS_SECRET_ACCESS_KEY)
- bucket = conn.lookup(settings.AWS_STATS_BUCKET_NAME)
-
- k = bucket.get_key(key)
-
- logs = []
-
- with gzip.GzipFile(fileobj=StringIO.StringIO(k.get_contents_as_string())) as f:
- fields = None
- for line in f:
- if line.startswith("#"):
- directive, value = line[1:].split(":", 1)
-
- directive = directive.strip()
- value = value.strip()
-
- if directive == "Version":
- assert value == "1.0"
-
- if directive == "Fields":
- fields = value.split()
- else:
- assert fields is not None
-
- logs.append(dict(itertools.izip(fields, [urllib.unquote(x) if x is not "-" else "" for x in line.split()])))
-
- with transaction.commit_on_success():
- for l in logs:
- when = datetime.datetime.strptime("T".join([l["date"], l["time"]]), "%Y-%m-%dT%H:%M:%S")
- when = when.replace(tzinfo=utc)
-
- Log.objects.create(
- when=when,
- edge_location=l["x-edge-location"],
- method=l["cs-method"],
- status=l["sc-status"],
- bytes=int(l["sc-bytes"]),
- host=l["cs(Host)"],
- uri_stem=l["cs-uri-stem"],
- uri_query=l["cs-uri-query"],
- ip=l["c-ip"],
- referer=l["cs(Referer)"],
- user_agent=l["cs(User-Agent)"]
- )
-
- LogProcessed.objects.get_or_create(name=key)
-
- k.delete()
-
-
-@task
-def process_aws_logs():
- conn = S3Connection(settings.AWS_ACCESS_KEY_ID, settings.AWS_SECRET_ACCESS_KEY)
- bucket = conn.lookup(settings.AWS_STATS_BUCKET_NAME)
-
- for k in bucket:
- if _log_filename.search(k.name) is not None:
- process_aws_log.delay(k.name)
- else:
- logger.warning("%s doesn't match the aws log regex" % k.name)
View
0 crateweb/apps/core/__init__.py
No changes.
View
113 crateweb/apps/core/helpers.py
@@ -1,113 +0,0 @@
-import os
-
-from urllib import urlencode
-from urlparse import urlparse, parse_qs, urlunparse
-
-from django.conf import settings
-from django.utils import formats
-
-import jinja2
-
-from jingo import register
-from account.utils import user_display as pinax_user_display
-from staticfiles.storage import staticfiles_storage
-
-
-@register.function
-def ifelse(first, test, nelse):
- return first if test else nelse
-
-
-@register.function
-def pagination_numbers(numbers, current, max_num=13):
- step = (max_num - 1) / 2
- start = numbers.index(current) - step
-
- if start < 0:
- end = numbers.index(current) + step + abs(start)
- start = 0
- else:
- end = numbers.index(current) + step
- return numbers[start:end + 1]
-
-
-@register.filter
-def reqarg(url, name, value=None):
- parsed = urlparse(url)
- data = parse_qs(parsed.query)
- if value is not None:
- data.update({
- name: [value],
- })
- else:
- if name in data:
- del data[name]
-
- _data = []
- for key, value in data.iteritems():
- for item in value:
- _data.append((key, item))
-
- return jinja2.Markup(urlunparse([parsed.scheme, parsed.netloc, parsed.path, parsed.params, urlencode(_data), parsed.fragment]))
-
-
-@register.filter
-def filename(name):
- return os.path.basename(name)
-
-
-@register.function
-def char_split(value, names=None, char="$"):
- value_list = value.split(char)
-
- if names is not None:
- return dict(zip(names, value_list))
-
- return value_list
-
-
-@register.filter
-def date(value, arg=None):
- """Formats a date according to the given format."""
- if not value:
- return u''
- if arg is None:
- arg = settings.DATE_FORMAT
- try:
- return formats.date_format(value, arg)
- except AttributeError:
- try:
- return format(value, arg)
- except AttributeError:
- return ''
-
-
-@register.function
-def static(path):
- """
- A template tag that returns the URL to a file
- using staticfiles' storage backend
- """
- return staticfiles_storage.url(path)
-
-
-@register.filter
-def is_checkbox(field):
- return field.field.widget.__class__.__name__.lower() == "checkboxinput"
-
-
-@register.filter
-def css_class(field):
- return field.field.widget.__class__.__name__.lower()
-
-
-@register.function
-def user_display(user):
- return pinax_user_display(user)
-
-
-@register.function
-def null_get(d, key, fallback=None):
- if d is None:
- return fallback
- return d.get(key, fallback)
View
0 crateweb/apps/core/management/__init__.py
No changes.
View
0 crateweb/apps/core/management/commands/__init__.py
No changes.
View
19 crateweb/apps/core/management/commands/dummy_passwords.py
@@ -1,19 +0,0 @@
-from django.conf import settings
-from django.core.management.base import BaseCommand
-
-from django.contrib.auth.models import User
-
-
-class Command(BaseCommand):
-
- def handle(self, *args, **options):
- if not settings.DEBUG:
- print "Dummy Passwords Only Available when DEBUG = True"
- return
-
- first_user = User.objects.all()[:1].get()
- first_user.set_password("letmein")
- first_user.save()
-
- User.objects.all().update(password=first_user.password)
-
View
20 crateweb/apps/core/management/commands/migrate_django_openid_social_auth.py
@@ -1,20 +0,0 @@
-from django.conf import settings
-from django.core.management.base import BaseCommand
-from django.db import connection
-
-from django.contrib.auth.models import User
-
-from account.models import EmailAddress
-from social_auth.models import UserSocialAuth
-
-
-class Command(BaseCommand):
-
- def handle(self, *args, **options):
- cursor = connection.cursor()
- cursor.execute("SELECT user_id, openid FROM django_openid_useropenidassociation;")
-
- for openid in cursor.fetchall():
- user = User.objects.get(pk=openid[0])
- print user.username, openid[1]
- UserSocialAuth.objects.get_or_create(provider="openid", uid=openid[1], defaults={"user": user})
View
13 crateweb/apps/core/management/commands/migrate_emails_pinax_dua.py
@@ -1,13 +0,0 @@
-from django.conf import settings
-from django.core.management.base import BaseCommand
-
-from django.contrib.auth.models import User
-
-from account.models import EmailAddress
-
-
-class Command(BaseCommand):
-
- def handle(self, *args, **options):
- for u in User.objects.all():
- EmailAddress.objects.create(user=u, email=u.email, verified=True, primary=True)
View
0 crateweb/apps/core/models.py
No changes.
View
0 crateweb/apps/core/social_auth/__init__.py
No changes.
View
47 crateweb/apps/core/social_auth/backends/__init__.py
@@ -1,47 +0,0 @@
-from social_auth.backends import SREG_ATTR, OLD_AX_ATTRS, AX_SCHEMA_ATTRS
-from social_auth.backends import OpenIDBackend as BaseOpenIDBackend
-from social_auth.backends import OpenIdAuth as BaseOpenIdAuth
-
-
-class OpenIDBackend(BaseOpenIDBackend):
-
- def get_user_details(self, response):
- """Return user details from an OpenID request"""
- values = {"username": '', 'email': '', 'fullname': '',
- 'first_name': '', 'last_name': ''}
- # update values using SimpleRegistration or AttributeExchange
- # values
- values.update(self.values_from_response(response,
- SREG_ATTR,
- OLD_AX_ATTRS + \
- AX_SCHEMA_ATTRS))
-
- fullname = values.get('fullname') or ''
- first_name = values.get('first_name') or ''
- last_name = values.get('last_name') or ''
-
- if not fullname and first_name and last_name:
- fullname = first_name + ' ' + last_name
- elif fullname:
- try: # Try to split name for django user storage
- first_name, last_name = fullname.rsplit(' ', 1)
- except ValueError:
- last_name = fullname
-
- values.update({
- 'fullname': fullname,
- 'first_name': first_name,
- 'last_name': last_name,
- 'username': values.get('username') or values.get('nickname') or (first_name.title() + last_name.title())
- })
-
- return values
-
-
-class OpenIdAuth(BaseOpenIdAuth):
- AUTH_BACKEND = OpenIDBackend
-
-
-BACKENDS = {
- 'openid': OpenIdAuth
-}
View
0 crateweb/apps/core/social_auth/pipeline/__init__.py
No changes.
View
26 crateweb/apps/core/social_auth/pipeline/associate.py
@@ -1,26 +0,0 @@
-from django.core.exceptions import MultipleObjectsReturned
-
-from account.models import EmailAddress
-
-from social_auth.utils import setting
-from social_auth.backends.pipeline import warn_setting
-from social_auth.backends.exceptions import AuthException
-
-
-def associate_by_email(details, *args, **kwargs):
- """Return user entry with same email address as one returned on details."""
- email = details.get('email')
-
- warn_setting('SOCIAL_AUTH_ASSOCIATE_BY_MAIL', 'associate_by_email')
-
- if email and setting('SOCIAL_AUTH_ASSOCIATE_BY_MAIL', True):
- # try to associate accounts registered with the same email address,
- # only if it's a single object. AuthException is raised if multiple
- # objects are returned
- try:
- address = EmailAddress.objects.filter(email=email, verified=True).select_related("user").get()
- return {"user": address.user}
- except MultipleObjectsReturned:
- raise AuthException(kwargs['backend'], 'Not unique email address.')
- except EmailAddress.DoesNotExist:
- pass
View
34 crateweb/apps/core/social_auth/pipeline/user.py
@@ -1,34 +0,0 @@
-from account.models import Account, EmailAddress
-
-from social_auth.models import User
-from social_auth.backends.pipeline import warn_setting
-from social_auth.utils import setting
-from social_auth.signals import socialauth_not_registered
-
-
-def create_user(backend, details, response, uid, username, user=None, *args, **kwargs):
- """Create user. Depends on get_username pipeline."""
- if user:
- return {'user': user}
- if not username:
- return None
-
- warn_setting('SOCIAL_AUTH_CREATE_USERS', 'create_user')
-
- if not setting('SOCIAL_AUTH_CREATE_USERS', True):
- # Send signal for cases where tracking failed registering is useful.
- socialauth_not_registered.send(sender=backend.__class__, uid=uid, response=response, details=details)
- return None
-
- email = details.get('email')
- request = kwargs["request"]
-
- user = User.objects.create_user(username=username, email=email)
-
- Account.create(request=request, user=user)
- EmailAddress.objects.add_email(user, user.email, primary=True)
-
- return {
- 'user': user,
- 'is_new': True
- }
View
7 crateweb/apps/core/social_auth/urls.py
@@ -1,7 +0,0 @@
-from django.conf.urls import patterns, url
-
-from core.social_auth.views import SocialAuths
-
-urlpatterns = patterns("",
- url(r"^social/$", SocialAuths.as_view(), name="social_auth_accounts"),
-)
View
44 crateweb/apps/core/social_auth/views.py
@@ -1,44 +0,0 @@
-from django.http import HttpResponseRedirect
-from django.views.generic.list import ListView
-from django.utils.translation import ugettext as _
-
-from django.contrib import messages
-from django.contrib.auth import REDIRECT_FIELD_NAME
-from django.contrib.auth.decorators import login_required
-
-from account.mixins import LoginRequiredMixin
-from social_auth.decorators import dsa_view
-from social_auth.models import UserSocialAuth
-from social_auth.utils import backend_setting
-from social_auth.views import DEFAULT_REDIRECT
-
-
-class SocialAuths(LoginRequiredMixin, ListView):
-
- model = UserSocialAuth
-
- def get_queryset(self):
- qs = super(SocialAuths, self).get_queryset()
- qs = qs.filter(user=self.request.user)
- return qs
-
-
-@login_required
-@dsa_view()
-def disconnect(request, backend, association_id=None):
- associated = request.user.social_auth.count()
- url = request.REQUEST.get(REDIRECT_FIELD_NAME, '') or backend_setting(backend, 'SOCIAL_AUTH_DISCONNECT_REDIRECT_URL') or DEFAULT_REDIRECT
-
- if not request.user.has_usable_password() and associated <= 1:
- messages.error(request, _("Cannot remove the only Social Account without first setting a Password or adding another Social Account."))
- return HttpResponseRedirect(url)
-
- usa = request.user.social_auth.get(pk=association_id)
-
- backend.disconnect(request.user, association_id)
- messages.success(request, _("Removed the %(provider)s account '%(uid)s'.") % {
- "provider": usa.provider,
- "uid": usa.extra_data.get("display", usa.uid) if usa.extra_data is not None else usa.uid,
- })
-
- return HttpResponseRedirect(url)
View
0 crateweb/apps/crate/__init__.py
No changes.
View
1 crateweb/apps/crate/dashboard/__init__.py
@@ -1 +0,0 @@
-from crate.dashboard.index import CrateIndexDashboard
View
54 crateweb/apps/crate/dashboard/index.py
@@ -1,54 +0,0 @@
-from django.core.urlresolvers import reverse
-
-from admin_tools.dashboard import modules, Dashboard
-from admin_tools.utils import get_admin_site_name
-
-from crate.dashboard.modules import StatusModule, RedisStatusModule
-
-
-class CrateIndexDashboard(Dashboard):
-
- def init_with_context(self, context):
- site_name = get_admin_site_name(context)
- # append a link list module for "quick links"
- self.children.append(modules.LinkList(
- "Quick links",
- layout="inline",
- draggable=False,
- deletable=False,
- collapsible=False,
- children=[
- ["Return to site", "/"],
- ["Change password",
- reverse("%s:password_change" % site_name)],
- ["Log out", reverse("%s:logout" % site_name)],
- ]
- ))
-
- # append an app list module for "Administration"
- self.children.append(modules.AppList(
- "Administration",
- models=('django.contrib.*',),
- ))
-
- # append an app list module for "Applications"
- self.children.append(modules.AppList(
- "Applications",
- exclude=[
- "django.contrib.*",
- "pinax.apps.*",
- "djcelery.*",
- "emailconfirmation.*",
- "profiles.*",
- ],
- ))
-
- self.children.append(StatusModule("Status"))
-
- self.children.append(RedisStatusModule(
- "Redis Status",
-
- ))
-
- # append a recent actions module
- self.children.append(modules.RecentActions("Recent Actions", 5))
View
44 crateweb/apps/crate/dashboard/modules.py
@@ -1,44 +0,0 @@
-import collections
-import datetime
-
-import redis
-
-from django.conf import settings
-from django.utils.timezone import utc
-
-from admin_tools.dashboard.modules import DashboardModule
-
-
-class StatusModule(DashboardModule):
-
- title = "Status"
- template = "admin_tools/dashboard/modules/status.html"
-
- def init_with_context(self, context):
- if hasattr(settings, "PYPI_DATASTORE"):
- datastore = redis.StrictRedis(**dict([(x.lower(), y) for x, y in settings.REDIS[settings.PYPI_DATASTORE].items()]))
-
- if datastore.get("crate:pypi:since") is not None:
- self.last_sync = datetime.datetime.fromtimestamp(float(datastore.get("crate:pypi:since")))
- self.last_sync.replace(tzinfo=utc)
- else:
- self.last_sync = None
-
- self.celery_queue_length = datastore.llen("celery")
-
- def is_empty(self):
- return False
-
-
-class RedisStatusModule(DashboardModule):
-
- title = "Redis Status"
- template = "admin_tools/dashboard/modules/redis.html"
-
- def init_with_context(self, context):
- if hasattr(settings, "PYPI_DATASTORE"):
- datastore = redis.StrictRedis(**dict([(x.lower(), y) for x, y in settings.REDIS[settings.PYPI_DATASTORE].items()]))
- self.redis_info = collections.OrderedDict(sorted([(k, v) for k, v in datastore.info().iteritems()], key=lambda x: x[0]))
-
- def is_empty(self):
- return False
View
1 crateweb/apps/crate/fields/__init__.py
@@ -1 +0,0 @@
-from crate.fields.json import JSONField
View
58 crateweb/apps/crate/fields/json.py
@@ -1,58 +0,0 @@
-from django import forms
-from django.core.serializers.json import DjangoJSONEncoder
-from django.db import models
-from django.utils import simplejson as json
-
-from south.modelsinspector import add_introspection_rules
-
-
-class JSONWidget(forms.Textarea):
-
- def render(self, name, value, attrs=None):
- if not isinstance(value, basestring):
- value = json.dumps(value, indent=4)
- return super(JSONWidget, self).render(name, value, attrs)
-
-
-class JSONFormField(forms.CharField):
-
- def __init__(self, *args, **kwargs):
- kwargs["widget"] = JSONWidget
- super(JSONFormField, self).__init__(*args, **kwargs)
-
- def clean(self, value):
- if not value:
- return
- try:
- return json.loads(value)
- except ValueError, e:
- raise forms.ValidationError(u"JSON decode error: %s" % unicode(e))
-
-
-class JSONField(models.TextField):
-
- __metaclass__ = models.SubfieldBase
-
- def _loads(self, value):
- return json.loads(value)
-
- def _dumps(self, value):
- return json.dumps(value, cls=DjangoJSONEncoder)
-
- def to_python(self, value):
- # if value is basestring this likely means this method is being called
- # while a QuerySet is being iterated or otherwise is coming in raw
- # and this is the only case when we should deserialize.
- if isinstance(value, basestring):
- return self._loads(value)
-
- return value
-
- def get_db_prep_save(self, value, **kwargs):
- return self._dumps(value)
-
- def formfield(self, **kwargs):
- return super(JSONField, self).formfield(form_class=JSONFormField, **kwargs)
-
-
-add_introspection_rules([], ["^crate\.fields\.json\.JSONField"])
View
0 crateweb/apps/crate/management/__init__.py
No changes.
View
0 crateweb/apps/crate/management/commands/__init__.py
No changes.
View
14 crateweb/apps/crate/management/commands/celery_status.py
@@ -1,14 +0,0 @@
-import redis
-
-from django.conf import settings
-from django.core.management.base import BaseCommand
-
-
-class Command(BaseCommand):
-
- def handle(self, *args, **options):
- r = redis.StrictRedis(
- host=settings.REDIS['default']['HOST'],
- port=settings.REDIS['default']['PORT'],
- password=settings.REDIS['default']['PASSWORD'])
- print "There are", r.llen("celery"), "items in the celery queue."
View
14 crateweb/apps/crate/management/commands/clear_celery.py
@@ -1,14 +0,0 @@
-import redis
-
-from django.conf import settings
-from django.core.management.base import BaseCommand
-
-
-class Command(BaseCommand):
-
- def handle(self, *args, **options):
- r = redis.StrictRedis(
- host=settings.REDIS['default']['HOST'],
- port=settings.REDIS['default']['PORT'],
- password=settings.REDIS['default']['PASSWORD'])
- r.delete("celery")
View
18 crateweb/apps/crate/management/commands/clear_celery_meta.py
@@ -1,18 +0,0 @@
-import redis
-
-from django.conf import settings
-from django.core.management.base import BaseCommand
-
-
-class Command(BaseCommand):
-
- def handle(self, *args, **options):
- r = redis.StrictRedis(
- host=settings.REDIS['default']['HOST'],
- port=settings.REDIS['default']['PORT'],
- password=settings.REDIS['default']['PASSWORD'])
- i = 0
- for key in r.keys("celery-*"):
- r.delete(key)
- i += 1
- print "%d keys cleared" % i
View
16 crateweb/apps/crate/management/commands/fix_missing_files.py
@@ -1,16 +0,0 @@
-from django.core.management.base import BaseCommand
-
-from packages.models import ReleaseFile
-from pypi.processor import PyPIPackage
-
-
-class Command(BaseCommand):
-
- def handle(self, *args, **options):
- i = 0
- for rf in ReleaseFile.objects.filter(digest="").distinct("release")[:10]:
- print rf.release.package.name, rf.release.version
- p = PyPIPackage(rf.release.package.name, version=rf.release.version)
- p.process(skip_modified=False)
- i += 1
- print "Fixed %d releases" % i
View
8 crateweb/apps/crate/management/commands/force_key_rollover.py
@@ -1,8 +0,0 @@
-from django.core.management.base import BaseCommand
-from pypi.tasks import pypi_key_rollover
-
-
-class Command(BaseCommand):
-
- def handle(self, *args, **options):
- pypi_key_rollover.delay()
View
11 crateweb/apps/crate/management/commands/get_last_sync.py
@@ -1,11 +0,0 @@
-import redis
-
-from django.conf import settings
-from django.core.management.base import BaseCommand
-
-
-class Command(BaseCommand):
-
- def handle(self, *args, **options):
- r = redis.StrictRedis(**dict([(x.lower(), y) for x, y in settings.REDIS[settings.PYPI_DATASTORE].items()]))
- print r.get("crate:pypi:since")
View
15 crateweb/apps/crate/management/commands/get_pypi_serverkey.py
@@ -1,15 +0,0 @@
-import redis
-
-from django.conf import settings
-from django.core.management.base import BaseCommand
-
-
-class Command(BaseCommand):
-
- def handle(self, *args, **options):
- r = redis.StrictRedis(
- host=settings.REDIS['default']['HOST'],
- port=settings.REDIS['default']['PORT'],
- password=settings.REDIS['default']['PASSWORD'])
- print r.get("crate:pypi:serverkey")
- print r.hgetall("crate:pypi:serverkey:headers")
View
9 crateweb/apps/crate/management/commands/migrate_releases.py
@@ -1,9 +0,0 @@
-from django.core.management.base import BaseCommand
-from pypi.tasks import migrate_all_releases
-
-
-class Command(BaseCommand):
-
- def handle(self, *args, **options):
- print "Migrating All Releases"
- migrate_all_releases.delay()
View
10 crateweb/apps/crate/management/commands/reset_hidden.py
@@ -1,10 +0,0 @@
-from django.core.management.base import BaseCommand
-
-from packages.models import Release, ReleaseFile
-
-
-class Command(BaseCommand):
-
- def handle(self, *args, **options):
- Release.objects.filter(hidden=True).update(hidden=False)
- ReleaseFile.objects.filter(hidden=True).update(hidden=False)
View
12 crateweb/apps/crate/management/commands/set_last_sync.py
@@ -1,12 +0,0 @@
-import redis
-
-from django.conf import settings
-from django.core.management.base import BaseCommand
-
-
-class Command(BaseCommand):
-
- def handle(self, *args, **options):
- r = redis.StrictRedis(**dict([(x.lower(), y) for x, y in settings.REDIS[settings.PYPI_DATASTORE].items()]))
- if args:
- r.set("crate:pypi:since", args[0])
View
24 crateweb/apps/crate/management/commands/sync_mirror.py
@@ -1,24 +0,0 @@
-from optparse import make_option
-
-from django.core.management.base import BaseCommand
-
-from pypi.tasks import synchronize_mirror
-
-
-class Command(BaseCommand):
-
- option_list = BaseCommand.option_list + (
- make_option("--since",
- dest="since",
- default=-1),
- )
-
- def handle(self, *args, **options):
- if options.get("since", -1) == -1:
- since = None
- else:
- since = 0
-
- synchronize_mirror.delay(since=since)
-
- print "Done"
View
10 crateweb/apps/crate/management/commands/trigger_bulk_sync.py
@@ -1,10 +0,0 @@
-from django.core.management.base import BaseCommand
-
-from pypi.tasks import bulk_synchronize
-
-
-class Command(BaseCommand):
-
- def handle(self, *args, **options):
- bulk_synchronize.delay()
- print "Bulk Synchronize Triggered"
View
0 crateweb/apps/crate/models.py
No changes.
View
5 crateweb/apps/crate/template2.py
@@ -1,5 +0,0 @@
-from django.conf import settings
-
-from jinja2 import Environment, FileSystemLoader
-
-env = Environment(loader=FileSystemLoader(settings.JINJA_TEMPLATE_DIRS), auto_reload=settings.DEBUG)
View
0 crateweb/apps/crate/templatetags/__init__.py
No changes.
View
16 crateweb/apps/crate/templatetags/pagination_utils.py
@@ -1,16 +0,0 @@
-from django import template
-
-register = template.Library()
-
-
-@register.filter
-def paginate_numbers(numbers, current_page, max_num=13):
- step = (max_num - 1) / 2
- start = numbers.index(current_page) - step
-
- if start < 0:
- end = numbers.index(current_page) + step + abs(start)
- start = 0
- else:
- end = numbers.index(current_page) + step
- return numbers[start:end + 1]
View
0 crateweb/apps/crate/utils/__init__.py
No changes.
View
72 crateweb/apps/crate/utils/datatools.py
@@ -1,72 +0,0 @@
-#
-# Taken from http://justcramer.com/2010/12/06/tracking-changes-to-fields-in-django/
-#
-
-from django.db.models.signals import post_init
-
-def track_data(*fields):
- """
- Tracks property changes on a model instance.
-
- The changed list of properties is refreshed on model initialization
- and save.
-
- >>> @track_data('name')
- >>> class Post(models.Model):
- >>> name = models.CharField(...)
- >>>
- >>> @classmethod
- >>> def post_save(cls, sender, instance, created, **kwargs):
- >>> if instance.has_changed('name'):
- >>> print "Hooray!"
- """
-
- UNSAVED = dict()
-
- def _store(self):
- "Updates a local copy of attributes values"
- if self.id:
- self.__data = dict((f, getattr(self, f)) for f in fields)
- else:
- self.__data = UNSAVED
-
- def inner(cls):
- # contains a local copy of the previous values of attributes
- cls.__data = {}
-
- def has_changed(self, field):
- "Returns ``True`` if ``field`` has changed since initialization."
- if self.__data is UNSAVED:
- return False
- return self.__data.get(field) != getattr(self, field)
- cls.has_changed = has_changed
-
- def old_value(self, field):
- "Returns the previous value of ``field``"
- return self.__data.get(field)
- cls.old_value = old_value
-
- def whats_changed(self):
- "Returns a list of changed attributes."
- changed = {}
- if self.__data is UNSAVED:
- return changed
- for k, v in self.__data.iteritems():
- if v != getattr(self, k):
- changed[k] = v
- return changed
- cls.whats_changed = whats_changed
-
- # Ensure we are updating local attributes on model init
- def _post_init(sender, instance, **kwargs):
- _store(instance)
- post_init.connect(_post_init, sender=cls, weak=False)
-
- # Ensure we are updating local attributes on model save
- def save(self, *args, **kwargs):
- save._original(self, *args, **kwargs)
- _store(self)
- save._original = cls.save
- cls.save = save
- return cls
- return inner
View
59 crateweb/apps/crate/utils/lock.py
@@ -1,59 +0,0 @@
-import time
-
-import redis
-
-from django.conf import settings
-
-
-class LockTimeout(BaseException):
- pass
-
-
-class Lock(object):
- def __init__(self, key, expires=60, timeout=10):
- """
- Distributed locking using Redis SETNX and GETSET.
-
- Usage::
-
- with Lock('my_lock'):
- print "Critical section"
-
- :param expires We consider any existing lock older than
- ``expires`` seconds to be invalid in order to
- detect crashed clients. This value must be higher
- than it takes the critical section to execute.
- :param timeout If another client has already obtained the lock,
- sleep for a maximum of ``timeout`` seconds before
- giving up. A value of 0 means we never wait.
- """
-
- self.key = "%s-lock" % key
- self.timeout = timeout
- self.expires = expires
-
- self.datastore = redis.StrictRedis(**dict([(x.lower(), y) for x, y in settings.REDIS[settings.LOCK_DATASTORE].items()]))
-
- def __enter__(self):
- timeout = self.timeout
- while timeout >= 0:
- expires = time.time() + self.expires + 1
-
- if self.datastore.setnx(self.key, expires):
- # We gained the lock; enter critical section
- return
-
- current_value = self.datastore.get(self.key)
-
- # We found an expired lock and nobody raced us to replacing it
- if current_value and float(current_value) < time.time() and \
- self.datastore.getset(self.key, expires) == current_value:
- return
-
- timeout -= 1
- time.sleep(1)
-
- raise LockTimeout("Timeout whilst waiting for lock")
-
- def __exit__(self, exc_type, exc_value, traceback):
- self.datastore.delete(self.key)
View
17 crateweb/apps/crate/views.py
@@ -1,17 +0,0 @@
-from urlparse import urljoin
-
-from django.conf import settings
-from django.http import HttpResponseRedirect
-
-
-def simple_redirect(request, path=None):
- host = settings.SIMPLE_API_URL
-
- if path is not None:
- if not path.startswith("/"):
- path = "/" + path
-
- redirect_to = urljoin(host, path)
- else:
- redirect_to = host
- return HttpResponseRedirect(redirect_to)
View
24 crateweb/apps/evaluator/__init__.py
@@ -1,24 +0,0 @@
-from evaluator.evaluators import suite
-
-
-def autodiscover():
- """
- Auto-discover INSTALLED_APPS evaluators.py modules and fail silently when
- not present. This forces an import on them to register any evaluators they
- may want.
- """
-
- from django.conf import settings
- from django.utils.importlib import import_module
- from django.utils.module_loading import module_has_submodule
-
- for app in settings.INSTALLED_APPS:
- mod = import_module(app)
- try:
- import_module("%s.evaluators" % app)
- except:
- # Decide whether to bubble up this error. If the app just
- # doesn't have an admin module, we can ignore the error
- # attempting to import it, otherwise we want it to bubble up.
- if module_has_submodule(mod, "evaluators"):
- raise
View
25 crateweb/apps/evaluator/evaluators.py
@@ -1,25 +0,0 @@
-
-
-class EvaluationSuite(object):
-
- def __init__(self):
- self.evaluators = []
-
- def register(self, cls):
- self.evaluators.append(cls)
-
- def unregister(self, cls):
- try:
- self.evaluators.remove(cls)
- except ValueError:
- pass
-
- def evaluate(self, obj):
- for test in self.evaluators:
- evaluator = test()
- result = evaluator.evaluate(obj)
- result.update({"evaluator": evaluator})
- yield result
-
-
-suite = EvaluationSuite()
View
0 crateweb/apps/evaluator/models.py
No changes.
View
0 crateweb/apps/evaluator/templatetags/__init__.py
No changes.
View
10 crateweb/apps/evaluator/templatetags/evaluators.py
@@ -1,10 +0,0 @@
-from django import template
-
-from evaluator import suite
-
-register = template.Library()
-
-
-@register.inclusion_tag("evaluator/report.html")
-def evaluate(obj):
- return {"results": [result for result in suite.evaluate(obj)]}
View
0 crateweb/apps/favorites/__init__.py
No changes.
View
74 crateweb/apps/favorites/migrations/0001_initial.py
@@ -1,74 +0,0 @@
-# -*- coding: utf-8 -*-
-import datetime
-from south.db import db
-from south.v2 import SchemaMigration
-from django.db import models
-
-
-class Migration(SchemaMigration):
-
- def forwards(self, orm):
- # Adding model 'Favorite'
- db.create_table('favorites_favorite', (
- ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
- ('created', self.gf('model_utils.fields.AutoCreatedField')(default=datetime.datetime(2012, 2, 22, 13, 44, 28, 422790))),
- ('modified', self.gf('model_utils.fields.AutoLastModifiedField')(default=datetime.datetime(2012, 2, 22, 13, 44, 28, 422903))),
- ('user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])),
- ('content_type', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['contenttypes.ContentType'])),
- ('target_id', self.gf('django.db.models.fields.PositiveIntegerField')()),
- ))
- db.send_create_signal('favorites', ['Favorite'])
-
- def backwards(self, orm):
- # Deleting model 'Favorite'
- db.delete_table('favorites_favorite')
-
- models = {
- 'auth.group': {
- 'Meta': {'object_name': 'Group'},
- 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
- 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
- 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
- },
- 'auth.permission': {
- 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
- 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
- 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
- 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
- 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
- },
- 'auth.user': {
- 'Meta': {'object_name': 'User'},
- 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2012, 2, 22, 13, 44, 28, 429039)'}),
- 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
- 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
- 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
- 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
- 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
- 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
- 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
- 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2012, 2, 22, 13, 44, 28, 428940)'}),
- 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
- 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
- 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
- 'username': ('django.db.models.fields.CharField', [], {