From 08b3e1115ac641e22e5c778b92dfbd18ecfa9e10 Mon Sep 17 00:00:00 2001 From: zhengxie Date: Thu, 2 May 2013 19:27:17 +0800 Subject: [PATCH] Change code structure to fit django 1.5 --- logs/.gitignore | 4 - manage.py | 15 ++-- __init__.py => seahub/__init__.py | 0 {api2 => seahub/api2}/__init__.py | 0 {api2 => seahub/api2}/authentication.py | 2 +- {api2 => seahub/api2}/models.py | 2 +- {api2 => seahub/api2}/permissions.py | 0 {api2 => seahub/api2}/serializers.py | 0 {api2 => seahub/api2}/tests.py | 0 {api2 => seahub/api2}/urls.py | 0 {api2 => seahub/api2}/views.py | 4 +- {avatar => seahub/avatar}/__init__.py | 0 {avatar => seahub/avatar}/admin.py | 0 {avatar => seahub/avatar}/forms.py | 4 +- {avatar => seahub/avatar}/i18n.sh.template | 0 .../avatar}/locale/de/LC_MESSAGES/django.po | 0 .../avatar}/locale/fr/LC_MESSAGES/django.po | 0 .../locale/pt_BR/LC_MESSAGES/django.po | 0 .../locale/zh_CN/LC_MESSAGES/django.po | 0 .../avatar}/management/__init__.py | 0 .../avatar}/management/commands/__init__.py | 0 .../management/commands/rebuild_avatars.py | 0 .../avatar}/media/avatar/img/default.jpg | Bin {avatar => seahub/avatar}/models.py | 4 +- {avatar => seahub/avatar}/settings.py | 0 {avatar => seahub/avatar}/signals.py | 0 .../avatar}/templates/avatar/add.html | 0 .../avatar}/templates/avatar/base.html | 0 .../avatar}/templates/avatar/change.html | 0 .../templates/avatar/confirm_delete.html | 0 .../avatar}/templates/avatar/set_avatar.html | 0 .../avatar_friend_updated/full.txt | 0 .../avatar_friend_updated/notice.html | 0 .../notification/avatar_updated/full.txt | 0 .../notification/avatar_updated/notice.html | 0 .../avatar}/templatetags/__init__.py | 0 .../avatar}/templatetags/avatar_tags.py | 4 +- .../avatar}/templatetags/group_avatar_tags.py | 6 +- .../avatar}/testdata/imagefilewithoutext | Bin .../testdata/imagefilewithwrongext.ogg | Bin .../avatar}/testdata/nonimagefile | 0 {avatar => seahub/avatar}/testdata/test.png | Bin .../avatar}/testdata/testbig.png | Bin {avatar => seahub/avatar}/tests.py | 0 {avatar => seahub/avatar}/urls.py | 2 +- {avatar => seahub/avatar}/util.py | 2 +- {avatar => seahub/avatar}/views.py | 10 +-- {base => seahub/base}/__init__.py | 0 {base => seahub/base}/accounts.py | 4 +- {base => seahub/base}/context_processors.py | 6 +- {base => seahub/base}/decorators.py | 0 {base => seahub/base}/i18n.sh.template | 0 .../base}/locale/fr/LC_MESSAGES/django.po | 0 .../base}/locale/zh_CN/LC_MESSAGES/django.po | 0 {base => seahub/base}/management/__init__.py | 0 .../base}/management/commands/__init__.py | 0 .../management/commands/changepassword.py | 0 .../management/commands/createsuperuser.py | 0 {base => seahub/base}/middleware.py | 0 {base => seahub/base}/mixins.py | 0 {base => seahub/base}/models.py | 10 +-- {base => seahub/base}/registration_urls.py | 24 ++--- .../base}/templatetags/__init__.py | 0 .../base}/templatetags/rest_framework.py | 0 .../base}/templatetags/seahub_tags.py | 6 +- {base => seahub/base}/tests.py | 0 {base => seahub/base}/utils.py | 0 {base => seahub/base}/views.py | 0 cconvert.py => seahub/cconvert.py | 0 {contacts => seahub/contacts}/__init__.py | 0 {contacts => seahub/contacts}/handlers.py | 0 .../contacts}/i18n.sh.template | 0 .../contacts}/locale/fr/LC_MESSAGES/django.po | 0 .../locale/zh_CN/LC_MESSAGES/django.po | 0 {contacts => seahub/contacts}/models.py | 0 {contacts => seahub/contacts}/settings.py | 0 {contacts => seahub/contacts}/signals.py | 0 .../templates/contacts/contact_list.html | 4 +- {contacts => seahub/contacts}/urls.py | 0 {contacts => seahub/contacts}/views.py | 3 +- convert-utf-8.txt => seahub/convert-utf-8.txt | 0 forms.py => seahub/forms.py | 2 +- {fts => seahub/fts}/__init__.py | 0 {fts => seahub/fts}/models.py | 0 {fts => seahub/fts}/tests.py | 0 {fts => seahub/fts}/views.py | 0 {group => seahub/group}/__init__.py | 0 {group => seahub/group}/decorators.py | 0 {group => seahub/group}/error_msg.py | 0 .../group}/fixtures/groupmessage.json | 0 {group => seahub/group}/forms.py | 0 {group => seahub/group}/handlers.py | 2 +- {group => seahub/group}/i18n.sh.template | 0 .../group}/locale/fr/LC_MESSAGES/django.po | 0 .../group}/locale/zh_CN/LC_MESSAGES/django.po | 0 {group => seahub/group}/models.py | 6 +- {group => seahub/group}/settings.py | 0 {group => seahub/group}/signals.py | 0 .../templates/group/add_member_email.html | 0 .../templates/group/discussion_list.html | 0 .../group}/templates/group/group_discuss.html | 0 .../group}/templates/group/group_info.html | 0 .../templates/group/group_info_for_pub.html | 0 .../templates/group/group_join_email.html | 0 .../group}/templates/group/group_manage.html | 0 .../group}/templates/group/group_members.html | 0 .../group}/templates/group/group_pubinfo.html | 0 .../templates/group/group_reply_list.html | 0 .../group}/templates/group/group_wiki.html | 0 .../templates/group/group_wiki_pages.html | 0 .../group}/templates/group/groups.html | 0 .../templates/group/groups_left_panel.html | 0 .../templates/group/groups_right_panel.html | 0 .../templates/group/grpadmin_add_js.html | 0 .../templates/group/grpmember_add_form.html | 0 .../templates/group/grpmember_add_js.html | 0 .../group}/templates/group/msg_js.html | 0 .../group}/templates/group/msg_reply.html | 0 .../group}/templates/group/new_msg_reply.html | 0 .../group}/templates/group/proj_groups.html | 0 {group => seahub/group}/tests/__init__.py | 0 .../group}/tests/testdata/large_message | 0 .../group}/tests/testdata/valid_message | 0 {group => seahub/group}/tests/tests.py | 0 {group => seahub/group}/urls.py | 0 {group => seahub/group}/views.py | 10 +-- handlers.py => seahub/handlers.py | 0 .../notifications}/__init__.py | 0 .../notifications}/i18n.sh.template | 0 .../locale/fr/LC_MESSAGES/django.po | 0 .../locale/zh_CN/LC_MESSAGES/django.po | 0 .../notifications}/management/__init__.py | 0 .../management/commands/__init__.py | 0 .../commands/send_user_notifications.py | 0 .../notifications}/models.py | 0 .../notifications}/settings.py | 0 .../notifications/add_notification_form.html | 0 .../notifications/notification_list.html | 0 .../notifications}/tests.py | 0 .../notifications}/urls.py | 2 +- .../notifications}/utils.py | 0 .../notifications}/views.py | 0 po.py => seahub/po.py | 0 {profile => seahub/profile}/__init__.py | 0 {profile => seahub/profile}/admin.py | 0 {profile => seahub/profile}/forms.py | 0 {profile => seahub/profile}/i18n.sh.template | 0 .../profile}/locale/fr/LC_MESSAGES/django.po | 0 .../locale/zh_CN/LC_MESSAGES/django.po | 0 {profile => seahub/profile}/models.py | 0 {profile => seahub/profile}/settings.py | 0 .../templates/profile/profile_base.html | 0 .../templates/profile/set_ccnet_conf.html | 0 .../templates/profile/set_profile.html | 0 .../profile}/templates/profile/user_ids.html | 0 .../templates/profile/user_profile.html | 0 {profile => seahub/profile}/tests.py | 0 {profile => seahub/profile}/urls.py | 2 +- {profile => seahub/profile}/utils.py | 0 {profile => seahub/profile}/views.py | 0 settings.py => seahub/settings.py | 83 ++++++++++++------ {share => seahub/share}/__init__.py | 0 {share => seahub/share}/forms.py | 0 {share => seahub/share}/i18n.sh.template | 0 .../share}/locale/fr/LC_MESSAGES/django.po | 0 .../share}/locale/zh_CN/LC_MESSAGES/django.po | 0 {share => seahub/share}/models.py | 0 {share => seahub/share}/settings.py | 0 .../repo/anonymous_share_confirm.html | 0 .../templates/repo/anonymous_share_email.html | 0 .../templates/repo/repo_share_mail.html | 0 .../share}/templates/repo/share_admin.html | 0 {share => seahub/share}/tests.py | 0 {share => seahub/share}/tokens.py | 0 {share => seahub/share}/urls.py | 0 {share => seahub/share}/views.py | 0 shortcuts.py => seahub/shortcuts.py | 0 signals.py => seahub/signals.py | 0 {templates => seahub/templates}/404.html | 0 {templates => seahub/templates}/500.html | 0 {templates => seahub/templates}/accounts.html | 0 .../templates}/admin_base.html | 0 {templates => seahub/templates}/base.html | 0 .../templates}/decrypt_repo_form.html | 0 {templates => seahub/templates}/error.html | 0 {templates => seahub/templates}/feedback.html | 0 .../templates}/file_edit.html | 0 .../templates}/file_revisions.html | 0 .../templates}/file_upload_progress_page.html | 0 .../templates}/history_file_view.html | 0 {templates => seahub/templates}/myhome.html | 0 .../templates}/myhome_base.html | 0 .../templates}/org_admin_base.html | 0 {templates => seahub/templates}/org_base.html | 0 .../templates}/pdf_full_view.html | 0 .../templates}/permission_error.html | 0 {templates => seahub/templates}/pubgrp.html | 0 {templates => seahub/templates}/pubrepo.html | 0 {templates => seahub/templates}/pubuser.html | 0 .../templates}/registration/activate.html | 0 .../registration/activation_complete.html | 0 .../registration/activation_email.txt | 0 .../registration/activation_email_subject.txt | 0 .../templates}/registration/login.html | 0 .../templates}/registration/logout.html | 0 .../registration/org_registration_form.html | 0 .../registration/password_change_done.html | 0 .../registration/password_change_form.html | 0 .../registration/password_reset_complete.html | 0 .../registration/password_reset_confirm.html | 0 .../registration/password_reset_done.html | 0 .../registration/password_reset_email.html | 0 .../registration/password_reset_form.html | 0 .../registration/registration_closed.html | 0 .../registration/registration_complete.html | 0 .../registration/registration_form.html | 0 {templates => seahub/templates}/repo.html | 0 .../templates}/repo_history.html | 0 .../templates}/repo_history_view.html | 0 .../templates}/repo_recycle_view.html | 0 .../templates}/repo_view_snapshot.html | 0 .../templates}/rest_framework/api.html | 0 .../templates}/rest_framework/base.html | 0 .../templates}/rest_framework/login.html | 0 .../templates}/seafile_access_check.html | 0 .../templates}/search_results.html | 0 .../templates}/shared_file_view.html | 0 .../templates}/shared_link_email.html | 0 .../templates}/snippets/avatar_upload_js.html | 0 .../templates}/snippets/bottom_bar.html | 0 .../templates}/snippets/editor_set_mode.html | 0 .../templates}/snippets/events.html | 0 .../templates}/snippets/events_.html | 0 .../templates}/snippets/events_js.html | 0 .../snippets/file_content_html.html | 0 .../templates}/snippets/file_content_js.html | 0 .../templates}/snippets/file_encoding.html | 0 .../snippets/file_upload_progress_js.html | 0 .../templates}/snippets/file_view_js.html | 0 .../templates}/snippets/file_view_style.html | 0 .../templates}/snippets/group_add_js.html | 0 .../snippets/group_recommend_form.html | 0 .../snippets/list_commit_detail.html | 0 .../templates}/snippets/my_groups.html | 0 .../templates}/snippets/my_owned_repos.html | 0 .../snippets/myhome_extra_script.html | 0 .../templates}/snippets/pubinfo.html | 0 .../templates}/snippets/repo_create_form.html | 0 .../templates}/snippets/repo_create_js.html | 0 .../templates}/snippets/repo_decrypt_js.html | 0 .../templates}/snippets/repo_group_list.html | 0 .../templates}/snippets/repo_share_form.html | 0 .../templates}/snippets/shared_link_js.html | 0 .../snippets/user_profile_html.html | 0 .../templates}/snippets/user_profile_js.html | 0 .../templates}/sys_group_admin.html | 0 .../templates}/sys_org_admin.html | 0 .../templates}/sys_seafadmin.html | 0 .../templates}/sys_useradmin.html | 0 .../templates}/text_diff.html | 0 .../templates}/update_file_error.html | 0 .../templates}/upload_file_error.html | 0 .../templates}/user_add_email.html | 0 .../templates}/user_reset_email.html | 0 {templates => seahub/templates}/userinfo.html | 0 .../templates}/view_file_3d.html | 0 .../templates}/view_file_audio.html | 0 .../templates}/view_file_base.html | 0 .../templates}/view_file_document.html | 0 .../templates}/view_file_image.html | 0 .../templates}/view_file_markdown.html | 0 .../templates}/view_file_pdf.html | 0 .../templates}/view_file_sf.html | 0 .../templates}/view_file_svg.html | 0 .../templates}/view_file_text.html | 0 .../templates}/view_file_unknown.html | 0 .../templates}/view_file_video.html | 0 .../templates}/view_history_file.html | 0 .../templates}/view_shared_dir.html | 0 .../templates}/view_snapshot_file.html | 0 .../templates}/view_trash_file.html | 0 .../templates}/wiki/personal_wiki.html | 0 .../templates}/wiki/personal_wiki_pages.html | 0 urls.py => seahub/urls.py | 16 ++-- {utils => seahub/utils}/__init__.py | 8 +- {utils => seahub/utils}/file_types.py | 0 {utils => seahub/utils}/htmldiff.py | 0 {utils => seahub/utils}/paginator.py | 0 {utils => seahub/utils}/repo.py | 0 {utils => seahub/utils}/search.py | 0 {utils => seahub/utils}/slugify/__init__.py | 0 {views => seahub/views}/__init__.py | 2 +- {views => seahub/views}/file.py | 8 +- {views => seahub/views}/repo.py | 6 +- {views => seahub/views}/search.py | 0 {views => seahub/views}/wiki.py | 0 {wiki => seahub/wiki}/__init__.py | 0 {wiki => seahub/wiki}/forms.py | 0 {wiki => seahub/wiki}/models.py | 0 {wiki => seahub/wiki}/utils.py | 0 seahub/wsgi.py | 28 ++++++ 301 files changed, 170 insertions(+), 121 deletions(-) delete mode 100644 logs/.gitignore rename __init__.py => seahub/__init__.py (100%) rename {api2 => seahub/api2}/__init__.py (100%) rename {api2 => seahub/api2}/authentication.py (96%) rename {api2 => seahub/api2}/models.py (94%) rename {api2 => seahub/api2}/permissions.py (100%) rename {api2 => seahub/api2}/serializers.py (100%) rename {api2 => seahub/api2}/tests.py (100%) rename {api2 => seahub/api2}/urls.py (100%) rename {api2 => seahub/api2}/views.py (99%) rename {avatar => seahub/avatar}/__init__.py (100%) rename {avatar => seahub/avatar}/admin.py (100%) rename {avatar => seahub/avatar}/forms.py (96%) rename {avatar => seahub/avatar}/i18n.sh.template (100%) rename {avatar => seahub/avatar}/locale/de/LC_MESSAGES/django.po (100%) rename {avatar => seahub/avatar}/locale/fr/LC_MESSAGES/django.po (100%) rename {avatar => seahub/avatar}/locale/pt_BR/LC_MESSAGES/django.po (100%) rename {avatar => seahub/avatar}/locale/zh_CN/LC_MESSAGES/django.po (100%) rename {avatar => seahub/avatar}/management/__init__.py (100%) rename {avatar => seahub/avatar}/management/commands/__init__.py (100%) rename {avatar => seahub/avatar}/management/commands/rebuild_avatars.py (100%) rename {avatar => seahub/avatar}/media/avatar/img/default.jpg (100%) rename {avatar => seahub/avatar}/models.py (97%) rename {avatar => seahub/avatar}/settings.py (100%) rename {avatar => seahub/avatar}/signals.py (100%) rename {avatar => seahub/avatar}/templates/avatar/add.html (100%) rename {avatar => seahub/avatar}/templates/avatar/base.html (100%) rename {avatar => seahub/avatar}/templates/avatar/change.html (100%) rename {avatar => seahub/avatar}/templates/avatar/confirm_delete.html (100%) rename {avatar => seahub/avatar}/templates/avatar/set_avatar.html (100%) rename {avatar => seahub/avatar}/templates/notification/avatar_friend_updated/full.txt (100%) rename {avatar => seahub/avatar}/templates/notification/avatar_friend_updated/notice.html (100%) rename {avatar => seahub/avatar}/templates/notification/avatar_updated/full.txt (100%) rename {avatar => seahub/avatar}/templates/notification/avatar_updated/notice.html (100%) rename {avatar => seahub/avatar}/templatetags/__init__.py (100%) rename {avatar => seahub/avatar}/templatetags/avatar_tags.py (93%) rename {avatar => seahub/avatar}/templatetags/group_avatar_tags.py (90%) rename {avatar => seahub/avatar}/testdata/imagefilewithoutext (100%) rename {avatar => seahub/avatar}/testdata/imagefilewithwrongext.ogg (100%) rename {avatar => seahub/avatar}/testdata/nonimagefile (100%) rename {avatar => seahub/avatar}/testdata/test.png (100%) rename {avatar => seahub/avatar}/testdata/testbig.png (100%) rename {avatar => seahub/avatar}/tests.py (100%) rename {avatar => seahub/avatar}/urls.py (89%) rename {avatar => seahub/avatar}/util.py (98%) rename {avatar => seahub/avatar}/views.py (96%) rename {base => seahub/base}/__init__.py (100%) rename {base => seahub/base}/accounts.py (99%) rename {base => seahub/base}/context_processors.py (87%) rename {base => seahub/base}/decorators.py (100%) rename {base => seahub/base}/i18n.sh.template (100%) rename {base => seahub/base}/locale/fr/LC_MESSAGES/django.po (100%) rename {base => seahub/base}/locale/zh_CN/LC_MESSAGES/django.po (100%) rename {base => seahub/base}/management/__init__.py (100%) rename {base => seahub/base}/management/commands/__init__.py (100%) rename {base => seahub/base}/management/commands/changepassword.py (100%) rename {base => seahub/base}/management/commands/createsuperuser.py (100%) rename {base => seahub/base}/middleware.py (100%) rename {base => seahub/base}/mixins.py (100%) rename {base => seahub/base}/models.py (96%) rename {base => seahub/base}/registration_urls.py (65%) rename {base => seahub/base}/templatetags/__init__.py (100%) rename {base => seahub/base}/templatetags/rest_framework.py (100%) rename {base => seahub/base}/templatetags/seahub_tags.py (98%) rename {base => seahub/base}/tests.py (100%) rename {base => seahub/base}/utils.py (100%) rename {base => seahub/base}/views.py (100%) rename cconvert.py => seahub/cconvert.py (100%) rename {contacts => seahub/contacts}/__init__.py (100%) rename {contacts => seahub/contacts}/handlers.py (100%) rename {contacts => seahub/contacts}/i18n.sh.template (100%) rename {contacts => seahub/contacts}/locale/fr/LC_MESSAGES/django.po (100%) rename {contacts => seahub/contacts}/locale/zh_CN/LC_MESSAGES/django.po (100%) rename {contacts => seahub/contacts}/models.py (100%) rename {contacts => seahub/contacts}/settings.py (100%) rename {contacts => seahub/contacts}/signals.py (100%) rename {contacts => seahub/contacts}/templates/contacts/contact_list.html (98%) rename {contacts => seahub/contacts}/urls.py (100%) rename {contacts => seahub/contacts}/views.py (99%) rename convert-utf-8.txt => seahub/convert-utf-8.txt (100%) rename forms.py => seahub/forms.py (99%) rename {fts => seahub/fts}/__init__.py (100%) rename {fts => seahub/fts}/models.py (100%) rename {fts => seahub/fts}/tests.py (100%) rename {fts => seahub/fts}/views.py (100%) rename {group => seahub/group}/__init__.py (100%) rename {group => seahub/group}/decorators.py (100%) rename {group => seahub/group}/error_msg.py (100%) rename {group => seahub/group}/fixtures/groupmessage.json (100%) rename {group => seahub/group}/forms.py (100%) rename {group => seahub/group}/handlers.py (96%) rename {group => seahub/group}/i18n.sh.template (100%) rename {group => seahub/group}/locale/fr/LC_MESSAGES/django.po (100%) rename {group => seahub/group}/locale/zh_CN/LC_MESSAGES/django.po (100%) rename {group => seahub/group}/models.py (94%) rename {group => seahub/group}/settings.py (100%) rename {group => seahub/group}/signals.py (100%) rename {group => seahub/group}/templates/group/add_member_email.html (100%) rename {group => seahub/group}/templates/group/discussion_list.html (100%) rename {group => seahub/group}/templates/group/group_discuss.html (100%) rename {group => seahub/group}/templates/group/group_info.html (100%) rename {group => seahub/group}/templates/group/group_info_for_pub.html (100%) rename {group => seahub/group}/templates/group/group_join_email.html (100%) rename {group => seahub/group}/templates/group/group_manage.html (100%) rename {group => seahub/group}/templates/group/group_members.html (100%) rename {group => seahub/group}/templates/group/group_pubinfo.html (100%) rename {group => seahub/group}/templates/group/group_reply_list.html (100%) rename {group => seahub/group}/templates/group/group_wiki.html (100%) rename {group => seahub/group}/templates/group/group_wiki_pages.html (100%) rename {group => seahub/group}/templates/group/groups.html (100%) rename {group => seahub/group}/templates/group/groups_left_panel.html (100%) rename {group => seahub/group}/templates/group/groups_right_panel.html (100%) rename {group => seahub/group}/templates/group/grpadmin_add_js.html (100%) rename {group => seahub/group}/templates/group/grpmember_add_form.html (100%) rename {group => seahub/group}/templates/group/grpmember_add_js.html (100%) rename {group => seahub/group}/templates/group/msg_js.html (100%) rename {group => seahub/group}/templates/group/msg_reply.html (100%) rename {group => seahub/group}/templates/group/new_msg_reply.html (100%) rename {group => seahub/group}/templates/group/proj_groups.html (100%) rename {group => seahub/group}/tests/__init__.py (100%) rename {group => seahub/group}/tests/testdata/large_message (100%) rename {group => seahub/group}/tests/testdata/valid_message (100%) rename {group => seahub/group}/tests/tests.py (100%) rename {group => seahub/group}/urls.py (100%) rename {group => seahub/group}/views.py (99%) rename handlers.py => seahub/handlers.py (100%) rename {notifications => seahub/notifications}/__init__.py (100%) rename {notifications => seahub/notifications}/i18n.sh.template (100%) rename {notifications => seahub/notifications}/locale/fr/LC_MESSAGES/django.po (100%) rename {notifications => seahub/notifications}/locale/zh_CN/LC_MESSAGES/django.po (100%) rename {notifications => seahub/notifications}/management/__init__.py (100%) rename {notifications => seahub/notifications}/management/commands/__init__.py (100%) rename {notifications => seahub/notifications}/management/commands/send_user_notifications.py (100%) rename {notifications => seahub/notifications}/models.py (100%) rename {notifications => seahub/notifications}/settings.py (100%) rename {notifications => seahub/notifications}/templates/notifications/add_notification_form.html (100%) rename {notifications => seahub/notifications}/templates/notifications/notification_list.html (100%) rename {notifications => seahub/notifications}/tests.py (100%) rename {notifications => seahub/notifications}/urls.py (86%) rename {notifications => seahub/notifications}/utils.py (100%) rename {notifications => seahub/notifications}/views.py (100%) rename po.py => seahub/po.py (100%) rename {profile => seahub/profile}/__init__.py (100%) rename {profile => seahub/profile}/admin.py (100%) rename {profile => seahub/profile}/forms.py (100%) rename {profile => seahub/profile}/i18n.sh.template (100%) rename {profile => seahub/profile}/locale/fr/LC_MESSAGES/django.po (100%) rename {profile => seahub/profile}/locale/zh_CN/LC_MESSAGES/django.po (100%) rename {profile => seahub/profile}/models.py (100%) rename {profile => seahub/profile}/settings.py (100%) rename {profile => seahub/profile}/templates/profile/profile_base.html (100%) rename {profile => seahub/profile}/templates/profile/set_ccnet_conf.html (100%) rename {profile => seahub/profile}/templates/profile/set_profile.html (100%) rename {profile => seahub/profile}/templates/profile/user_ids.html (100%) rename {profile => seahub/profile}/templates/profile/user_profile.html (100%) rename {profile => seahub/profile}/tests.py (100%) rename {profile => seahub/profile}/urls.py (89%) rename {profile => seahub/profile}/utils.py (100%) rename {profile => seahub/profile}/views.py (100%) rename settings.py => seahub/settings.py (81%) rename {share => seahub/share}/__init__.py (100%) rename {share => seahub/share}/forms.py (100%) rename {share => seahub/share}/i18n.sh.template (100%) rename {share => seahub/share}/locale/fr/LC_MESSAGES/django.po (100%) rename {share => seahub/share}/locale/zh_CN/LC_MESSAGES/django.po (100%) rename {share => seahub/share}/models.py (100%) rename {share => seahub/share}/settings.py (100%) rename {share => seahub/share}/templates/repo/anonymous_share_confirm.html (100%) rename {share => seahub/share}/templates/repo/anonymous_share_email.html (100%) rename {share => seahub/share}/templates/repo/repo_share_mail.html (100%) rename {share => seahub/share}/templates/repo/share_admin.html (100%) rename {share => seahub/share}/tests.py (100%) rename {share => seahub/share}/tokens.py (100%) rename {share => seahub/share}/urls.py (100%) rename {share => seahub/share}/views.py (100%) rename shortcuts.py => seahub/shortcuts.py (100%) rename signals.py => seahub/signals.py (100%) rename {templates => seahub/templates}/404.html (100%) rename {templates => seahub/templates}/500.html (100%) rename {templates => seahub/templates}/accounts.html (100%) rename {templates => seahub/templates}/admin_base.html (100%) rename {templates => seahub/templates}/base.html (100%) rename {templates => seahub/templates}/decrypt_repo_form.html (100%) rename {templates => seahub/templates}/error.html (100%) rename {templates => seahub/templates}/feedback.html (100%) rename {templates => seahub/templates}/file_edit.html (100%) rename {templates => seahub/templates}/file_revisions.html (100%) rename {templates => seahub/templates}/file_upload_progress_page.html (100%) rename {templates => seahub/templates}/history_file_view.html (100%) rename {templates => seahub/templates}/myhome.html (100%) rename {templates => seahub/templates}/myhome_base.html (100%) rename {templates => seahub/templates}/org_admin_base.html (100%) rename {templates => seahub/templates}/org_base.html (100%) rename {templates => seahub/templates}/pdf_full_view.html (100%) rename {templates => seahub/templates}/permission_error.html (100%) rename {templates => seahub/templates}/pubgrp.html (100%) rename {templates => seahub/templates}/pubrepo.html (100%) rename {templates => seahub/templates}/pubuser.html (100%) rename {templates => seahub/templates}/registration/activate.html (100%) rename {templates => seahub/templates}/registration/activation_complete.html (100%) rename {templates => seahub/templates}/registration/activation_email.txt (100%) rename {templates => seahub/templates}/registration/activation_email_subject.txt (100%) rename {templates => seahub/templates}/registration/login.html (100%) rename {templates => seahub/templates}/registration/logout.html (100%) rename {templates => seahub/templates}/registration/org_registration_form.html (100%) rename {templates => seahub/templates}/registration/password_change_done.html (100%) rename {templates => seahub/templates}/registration/password_change_form.html (100%) rename {templates => seahub/templates}/registration/password_reset_complete.html (100%) rename {templates => seahub/templates}/registration/password_reset_confirm.html (100%) rename {templates => seahub/templates}/registration/password_reset_done.html (100%) rename {templates => seahub/templates}/registration/password_reset_email.html (100%) rename {templates => seahub/templates}/registration/password_reset_form.html (100%) rename {templates => seahub/templates}/registration/registration_closed.html (100%) rename {templates => seahub/templates}/registration/registration_complete.html (100%) rename {templates => seahub/templates}/registration/registration_form.html (100%) rename {templates => seahub/templates}/repo.html (100%) rename {templates => seahub/templates}/repo_history.html (100%) rename {templates => seahub/templates}/repo_history_view.html (100%) rename {templates => seahub/templates}/repo_recycle_view.html (100%) rename {templates => seahub/templates}/repo_view_snapshot.html (100%) rename {templates => seahub/templates}/rest_framework/api.html (100%) rename {templates => seahub/templates}/rest_framework/base.html (100%) rename {templates => seahub/templates}/rest_framework/login.html (100%) rename {templates => seahub/templates}/seafile_access_check.html (100%) rename {templates => seahub/templates}/search_results.html (100%) rename {templates => seahub/templates}/shared_file_view.html (100%) rename {templates => seahub/templates}/shared_link_email.html (100%) rename {templates => seahub/templates}/snippets/avatar_upload_js.html (100%) rename {templates => seahub/templates}/snippets/bottom_bar.html (100%) rename {templates => seahub/templates}/snippets/editor_set_mode.html (100%) rename {templates => seahub/templates}/snippets/events.html (100%) rename {templates => seahub/templates}/snippets/events_.html (100%) rename {templates => seahub/templates}/snippets/events_js.html (100%) rename {templates => seahub/templates}/snippets/file_content_html.html (100%) rename {templates => seahub/templates}/snippets/file_content_js.html (100%) rename {templates => seahub/templates}/snippets/file_encoding.html (100%) rename {templates => seahub/templates}/snippets/file_upload_progress_js.html (100%) rename {templates => seahub/templates}/snippets/file_view_js.html (100%) rename {templates => seahub/templates}/snippets/file_view_style.html (100%) rename {templates => seahub/templates}/snippets/group_add_js.html (100%) rename {templates => seahub/templates}/snippets/group_recommend_form.html (100%) rename {templates => seahub/templates}/snippets/list_commit_detail.html (100%) rename {templates => seahub/templates}/snippets/my_groups.html (100%) rename {templates => seahub/templates}/snippets/my_owned_repos.html (100%) rename {templates => seahub/templates}/snippets/myhome_extra_script.html (100%) rename {templates => seahub/templates}/snippets/pubinfo.html (100%) rename {templates => seahub/templates}/snippets/repo_create_form.html (100%) rename {templates => seahub/templates}/snippets/repo_create_js.html (100%) rename {templates => seahub/templates}/snippets/repo_decrypt_js.html (100%) rename {templates => seahub/templates}/snippets/repo_group_list.html (100%) rename {templates => seahub/templates}/snippets/repo_share_form.html (100%) rename {templates => seahub/templates}/snippets/shared_link_js.html (100%) rename {templates => seahub/templates}/snippets/user_profile_html.html (100%) rename {templates => seahub/templates}/snippets/user_profile_js.html (100%) rename {templates => seahub/templates}/sys_group_admin.html (100%) rename {templates => seahub/templates}/sys_org_admin.html (100%) rename {templates => seahub/templates}/sys_seafadmin.html (100%) rename {templates => seahub/templates}/sys_useradmin.html (100%) rename {templates => seahub/templates}/text_diff.html (100%) rename {templates => seahub/templates}/update_file_error.html (100%) rename {templates => seahub/templates}/upload_file_error.html (100%) rename {templates => seahub/templates}/user_add_email.html (100%) rename {templates => seahub/templates}/user_reset_email.html (100%) rename {templates => seahub/templates}/userinfo.html (100%) rename {templates => seahub/templates}/view_file_3d.html (100%) rename {templates => seahub/templates}/view_file_audio.html (100%) rename {templates => seahub/templates}/view_file_base.html (100%) rename {templates => seahub/templates}/view_file_document.html (100%) rename {templates => seahub/templates}/view_file_image.html (100%) rename {templates => seahub/templates}/view_file_markdown.html (100%) rename {templates => seahub/templates}/view_file_pdf.html (100%) rename {templates => seahub/templates}/view_file_sf.html (100%) rename {templates => seahub/templates}/view_file_svg.html (100%) rename {templates => seahub/templates}/view_file_text.html (100%) rename {templates => seahub/templates}/view_file_unknown.html (100%) rename {templates => seahub/templates}/view_file_video.html (100%) rename {templates => seahub/templates}/view_history_file.html (100%) rename {templates => seahub/templates}/view_shared_dir.html (100%) rename {templates => seahub/templates}/view_snapshot_file.html (100%) rename {templates => seahub/templates}/view_trash_file.html (100%) rename {templates => seahub/templates}/wiki/personal_wiki.html (100%) rename {templates => seahub/templates}/wiki/personal_wiki_pages.html (100%) rename urls.py => seahub/urls.py (94%) rename {utils => seahub/utils}/__init__.py (99%) rename {utils => seahub/utils}/file_types.py (100%) rename {utils => seahub/utils}/htmldiff.py (100%) rename {utils => seahub/utils}/paginator.py (100%) rename {utils => seahub/utils}/repo.py (100%) rename {utils => seahub/utils}/search.py (100%) rename {utils => seahub/utils}/slugify/__init__.py (100%) rename {views => seahub/views}/__init__.py (99%) rename {views => seahub/views}/file.py (99%) rename {views => seahub/views}/repo.py (98%) rename {views => seahub/views}/search.py (100%) rename {views => seahub/views}/wiki.py (100%) rename {wiki => seahub/wiki}/__init__.py (100%) rename {wiki => seahub/wiki}/forms.py (100%) rename {wiki => seahub/wiki}/models.py (100%) rename {wiki => seahub/wiki}/utils.py (100%) create mode 100644 seahub/wsgi.py diff --git a/logs/.gitignore b/logs/.gitignore deleted file mode 100644 index 5e7d2734cf..0000000000 --- a/logs/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -# Ignore everything in this directory -* -# Except this file -!.gitignore diff --git a/manage.py b/manage.py index 5e78ea979e..6496c97ac4 100755 --- a/manage.py +++ b/manage.py @@ -1,11 +1,10 @@ #!/usr/bin/env python -from django.core.management import execute_manager -try: - import settings # Assumed to be in the same directory. -except ImportError: - import sys - sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\n" % __file__) - sys.exit(1) +import os +import sys if __name__ == "__main__": - execute_manager(settings) + os.environ.setdefault("DJANGO_SETTINGS_MODULE", "seahub.settings") + + from django.core.management import execute_from_command_line + + execute_from_command_line(sys.argv) diff --git a/__init__.py b/seahub/__init__.py similarity index 100% rename from __init__.py rename to seahub/__init__.py diff --git a/api2/__init__.py b/seahub/api2/__init__.py similarity index 100% rename from api2/__init__.py rename to seahub/api2/__init__.py diff --git a/api2/authentication.py b/seahub/api2/authentication.py similarity index 96% rename from api2/authentication.py rename to seahub/api2/authentication.py index 92302cf0ae..ebd7374f7d 100644 --- a/api2/authentication.py +++ b/seahub/api2/authentication.py @@ -1,7 +1,7 @@ from rest_framework.authentication import BaseAuthentication from models import Token -from base.accounts import User +from seahub.base.accounts import User class TokenAuthentication(BaseAuthentication): """ diff --git a/api2/models.py b/seahub/api2/models.py similarity index 94% rename from api2/models.py rename to seahub/api2/models.py index 3d77ea941a..a1189b06b2 100644 --- a/api2/models.py +++ b/seahub/api2/models.py @@ -1,9 +1,9 @@ import uuid import hmac from hashlib import sha1 -from base.accounts import User from django.db import models +from seahub.base.accounts import User class Token(models.Model): """ diff --git a/api2/permissions.py b/seahub/api2/permissions.py similarity index 100% rename from api2/permissions.py rename to seahub/api2/permissions.py diff --git a/api2/serializers.py b/seahub/api2/serializers.py similarity index 100% rename from api2/serializers.py rename to seahub/api2/serializers.py diff --git a/api2/tests.py b/seahub/api2/tests.py similarity index 100% rename from api2/tests.py rename to seahub/api2/tests.py diff --git a/api2/urls.py b/seahub/api2/urls.py similarity index 100% rename from api2/urls.py rename to seahub/api2/urls.py diff --git a/api2/views.py b/seahub/api2/views.py similarity index 99% rename from api2/views.py rename to seahub/api2/views.py index 96638df03c..8d3f1bb377 100644 --- a/api2/views.py +++ b/seahub/api2/views.py @@ -20,8 +20,8 @@ from models import Token from authentication import TokenAuthentication from permissions import IsRepoWritable, IsRepoAccessible, IsRepoOwner from serializers import AuthTokenSerializer -from base.accounts import User -from share.models import FileShare +from seahub.base.accounts import User +from seahub.share.models import FileShare from seahub.views import access_to_repo, validate_owner from seahub.utils import gen_file_get_url, gen_token, gen_file_upload_url, \ check_filename_with_rename, get_starred_files, get_ccnetapplet_root, \ diff --git a/avatar/__init__.py b/seahub/avatar/__init__.py similarity index 100% rename from avatar/__init__.py rename to seahub/avatar/__init__.py diff --git a/avatar/admin.py b/seahub/avatar/admin.py similarity index 100% rename from avatar/admin.py rename to seahub/avatar/admin.py diff --git a/avatar/forms.py b/seahub/avatar/forms.py similarity index 96% rename from avatar/forms.py rename to seahub/avatar/forms.py index 736fb4a156..3fd1e1ae08 100644 --- a/avatar/forms.py +++ b/seahub/avatar/forms.py @@ -6,8 +6,8 @@ from django.utils.safestring import mark_safe from django.utils.translation import ugettext_lazy as _ from django.template.defaultfilters import filesizeformat -from avatar.models import Avatar -from avatar.settings import (AVATAR_MAX_AVATARS_PER_USER, AVATAR_MAX_SIZE, +from seahub.avatar.models import Avatar +from seahub.avatar.settings import (AVATAR_MAX_AVATARS_PER_USER, AVATAR_MAX_SIZE, AVATAR_ALLOWED_FILE_EXTS, AVATAR_DEFAULT_SIZE) diff --git a/avatar/i18n.sh.template b/seahub/avatar/i18n.sh.template similarity index 100% rename from avatar/i18n.sh.template rename to seahub/avatar/i18n.sh.template diff --git a/avatar/locale/de/LC_MESSAGES/django.po b/seahub/avatar/locale/de/LC_MESSAGES/django.po similarity index 100% rename from avatar/locale/de/LC_MESSAGES/django.po rename to seahub/avatar/locale/de/LC_MESSAGES/django.po diff --git a/avatar/locale/fr/LC_MESSAGES/django.po b/seahub/avatar/locale/fr/LC_MESSAGES/django.po similarity index 100% rename from avatar/locale/fr/LC_MESSAGES/django.po rename to seahub/avatar/locale/fr/LC_MESSAGES/django.po diff --git a/avatar/locale/pt_BR/LC_MESSAGES/django.po b/seahub/avatar/locale/pt_BR/LC_MESSAGES/django.po similarity index 100% rename from avatar/locale/pt_BR/LC_MESSAGES/django.po rename to seahub/avatar/locale/pt_BR/LC_MESSAGES/django.po diff --git a/avatar/locale/zh_CN/LC_MESSAGES/django.po b/seahub/avatar/locale/zh_CN/LC_MESSAGES/django.po similarity index 100% rename from avatar/locale/zh_CN/LC_MESSAGES/django.po rename to seahub/avatar/locale/zh_CN/LC_MESSAGES/django.po diff --git a/avatar/management/__init__.py b/seahub/avatar/management/__init__.py similarity index 100% rename from avatar/management/__init__.py rename to seahub/avatar/management/__init__.py diff --git a/avatar/management/commands/__init__.py b/seahub/avatar/management/commands/__init__.py similarity index 100% rename from avatar/management/commands/__init__.py rename to seahub/avatar/management/commands/__init__.py diff --git a/avatar/management/commands/rebuild_avatars.py b/seahub/avatar/management/commands/rebuild_avatars.py similarity index 100% rename from avatar/management/commands/rebuild_avatars.py rename to seahub/avatar/management/commands/rebuild_avatars.py diff --git a/avatar/media/avatar/img/default.jpg b/seahub/avatar/media/avatar/img/default.jpg similarity index 100% rename from avatar/media/avatar/img/default.jpg rename to seahub/avatar/media/avatar/img/default.jpg diff --git a/avatar/models.py b/seahub/avatar/models.py similarity index 97% rename from avatar/models.py rename to seahub/avatar/models.py index 9f37fb8cd0..21b9e708d3 100644 --- a/avatar/models.py +++ b/seahub/avatar/models.py @@ -21,8 +21,8 @@ try: except ImportError: import Image -from avatar.util import invalidate_cache -from avatar.settings import (AVATAR_STORAGE_DIR, AVATAR_RESIZE_METHOD, +from seahub.avatar.util import invalidate_cache +from seahub.avatar.settings import (AVATAR_STORAGE_DIR, AVATAR_RESIZE_METHOD, AVATAR_MAX_AVATARS_PER_USER, AVATAR_THUMB_FORMAT, AVATAR_HASH_USERDIRNAMES, AVATAR_HASH_FILENAMES, AVATAR_THUMB_QUALITY, AUTO_GENERATE_AVATAR_SIZES, diff --git a/avatar/settings.py b/seahub/avatar/settings.py similarity index 100% rename from avatar/settings.py rename to seahub/avatar/settings.py diff --git a/avatar/signals.py b/seahub/avatar/signals.py similarity index 100% rename from avatar/signals.py rename to seahub/avatar/signals.py diff --git a/avatar/templates/avatar/add.html b/seahub/avatar/templates/avatar/add.html similarity index 100% rename from avatar/templates/avatar/add.html rename to seahub/avatar/templates/avatar/add.html diff --git a/avatar/templates/avatar/base.html b/seahub/avatar/templates/avatar/base.html similarity index 100% rename from avatar/templates/avatar/base.html rename to seahub/avatar/templates/avatar/base.html diff --git a/avatar/templates/avatar/change.html b/seahub/avatar/templates/avatar/change.html similarity index 100% rename from avatar/templates/avatar/change.html rename to seahub/avatar/templates/avatar/change.html diff --git a/avatar/templates/avatar/confirm_delete.html b/seahub/avatar/templates/avatar/confirm_delete.html similarity index 100% rename from avatar/templates/avatar/confirm_delete.html rename to seahub/avatar/templates/avatar/confirm_delete.html diff --git a/avatar/templates/avatar/set_avatar.html b/seahub/avatar/templates/avatar/set_avatar.html similarity index 100% rename from avatar/templates/avatar/set_avatar.html rename to seahub/avatar/templates/avatar/set_avatar.html diff --git a/avatar/templates/notification/avatar_friend_updated/full.txt b/seahub/avatar/templates/notification/avatar_friend_updated/full.txt similarity index 100% rename from avatar/templates/notification/avatar_friend_updated/full.txt rename to seahub/avatar/templates/notification/avatar_friend_updated/full.txt diff --git a/avatar/templates/notification/avatar_friend_updated/notice.html b/seahub/avatar/templates/notification/avatar_friend_updated/notice.html similarity index 100% rename from avatar/templates/notification/avatar_friend_updated/notice.html rename to seahub/avatar/templates/notification/avatar_friend_updated/notice.html diff --git a/avatar/templates/notification/avatar_updated/full.txt b/seahub/avatar/templates/notification/avatar_updated/full.txt similarity index 100% rename from avatar/templates/notification/avatar_updated/full.txt rename to seahub/avatar/templates/notification/avatar_updated/full.txt diff --git a/avatar/templates/notification/avatar_updated/notice.html b/seahub/avatar/templates/notification/avatar_updated/notice.html similarity index 100% rename from avatar/templates/notification/avatar_updated/notice.html rename to seahub/avatar/templates/notification/avatar_updated/notice.html diff --git a/avatar/templatetags/__init__.py b/seahub/avatar/templatetags/__init__.py similarity index 100% rename from avatar/templatetags/__init__.py rename to seahub/avatar/templatetags/__init__.py diff --git a/avatar/templatetags/avatar_tags.py b/seahub/avatar/templatetags/avatar_tags.py similarity index 93% rename from avatar/templatetags/avatar_tags.py rename to seahub/avatar/templatetags/avatar_tags.py index 5da6f172a7..5e8f0e0915 100644 --- a/avatar/templatetags/avatar_tags.py +++ b/seahub/avatar/templatetags/avatar_tags.py @@ -8,9 +8,9 @@ from django.core.urlresolvers import reverse from seahub.base.accounts import User from seahub.views import is_registered_user -from avatar.settings import (AVATAR_GRAVATAR_BACKUP, AVATAR_GRAVATAR_DEFAULT, +from seahub.avatar.settings import (AVATAR_GRAVATAR_BACKUP, AVATAR_GRAVATAR_DEFAULT, AVATAR_DEFAULT_SIZE) -from avatar.util import get_primary_avatar, get_default_avatar_url, \ +from seahub.avatar.util import get_primary_avatar, get_default_avatar_url, \ cache_result, get_default_avatar_non_registered_url register = template.Library() diff --git a/avatar/templatetags/group_avatar_tags.py b/seahub/avatar/templatetags/group_avatar_tags.py similarity index 90% rename from avatar/templatetags/group_avatar_tags.py rename to seahub/avatar/templatetags/group_avatar_tags.py index 9a6ad51eeb..b2a4a3213e 100644 --- a/avatar/templatetags/group_avatar_tags.py +++ b/seahub/avatar/templatetags/group_avatar_tags.py @@ -2,10 +2,10 @@ from django.conf import settings from django.core.cache import cache from django import template -from avatar.settings import (GROUP_AVATAR_DEFAULT_SIZE, AVATAR_CACHE_TIMEOUT, +from seahub.avatar.settings import (GROUP_AVATAR_DEFAULT_SIZE, AVATAR_CACHE_TIMEOUT, GROUP_AVATAR_DEFAULT_URL) -from avatar.models import GroupAvatar -from avatar.util import get_grp_cache_key +from seahub.avatar.models import GroupAvatar +from seahub.avatar.util import get_grp_cache_key register = template.Library() diff --git a/avatar/testdata/imagefilewithoutext b/seahub/avatar/testdata/imagefilewithoutext similarity index 100% rename from avatar/testdata/imagefilewithoutext rename to seahub/avatar/testdata/imagefilewithoutext diff --git a/avatar/testdata/imagefilewithwrongext.ogg b/seahub/avatar/testdata/imagefilewithwrongext.ogg similarity index 100% rename from avatar/testdata/imagefilewithwrongext.ogg rename to seahub/avatar/testdata/imagefilewithwrongext.ogg diff --git a/avatar/testdata/nonimagefile b/seahub/avatar/testdata/nonimagefile similarity index 100% rename from avatar/testdata/nonimagefile rename to seahub/avatar/testdata/nonimagefile diff --git a/avatar/testdata/test.png b/seahub/avatar/testdata/test.png similarity index 100% rename from avatar/testdata/test.png rename to seahub/avatar/testdata/test.png diff --git a/avatar/testdata/testbig.png b/seahub/avatar/testdata/testbig.png similarity index 100% rename from avatar/testdata/testbig.png rename to seahub/avatar/testdata/testbig.png diff --git a/avatar/tests.py b/seahub/avatar/tests.py similarity index 100% rename from avatar/tests.py rename to seahub/avatar/tests.py diff --git a/avatar/urls.py b/seahub/avatar/urls.py similarity index 89% rename from avatar/urls.py rename to seahub/avatar/urls.py index 7186397ea5..b652488084 100644 --- a/avatar/urls.py +++ b/seahub/avatar/urls.py @@ -1,6 +1,6 @@ from django.conf.urls.defaults import patterns, url -urlpatterns = patterns('avatar.views', +urlpatterns = patterns('seahub.avatar.views', url('^add/$', 'add', name='avatar_add'), url('^group/(?P\d+)/add/$', 'group_add', name='avatar_group_add'), # url('^change/$', 'change', name='avatar_change'), diff --git a/avatar/util.py b/seahub/avatar/util.py similarity index 98% rename from avatar/util.py rename to seahub/avatar/util.py index 9e06ee0b38..75e3a304c6 100644 --- a/avatar/util.py +++ b/seahub/avatar/util.py @@ -3,7 +3,7 @@ from django.core.cache import cache from seahub.base.accounts import User -from avatar.settings import (AVATAR_DEFAULT_URL, AVATAR_CACHE_TIMEOUT, +from seahub.avatar.settings import (AVATAR_DEFAULT_URL, AVATAR_CACHE_TIMEOUT, AUTO_GENERATE_AVATAR_SIZES, AVATAR_DEFAULT_SIZE, AVATAR_DEFAULT_NON_REGISTERED_URL, AUTO_GENERATE_GROUP_AVATAR_SIZES) diff --git a/avatar/views.py b/seahub/avatar/views.py similarity index 96% rename from avatar/views.py rename to seahub/avatar/views.py index 9469fdc506..be4077c042 100644 --- a/avatar/views.py +++ b/seahub/avatar/views.py @@ -7,12 +7,12 @@ from django.utils.translation import ugettext as _ from django.conf import settings from django.contrib import messages -from avatar.forms import PrimaryAvatarForm, DeleteAvatarForm, UploadAvatarForm,\ +from seahub.avatar.forms import PrimaryAvatarForm, DeleteAvatarForm, UploadAvatarForm,\ GroupAvatarForm -from avatar.models import Avatar, GroupAvatar -from avatar.settings import AVATAR_MAX_AVATARS_PER_USER, AVATAR_DEFAULT_SIZE -from avatar.signals import avatar_updated -from avatar.util import get_primary_avatar, get_default_avatar_url, \ +from seahub.avatar.models import Avatar, GroupAvatar +from seahub.avatar.settings import AVATAR_MAX_AVATARS_PER_USER, AVATAR_DEFAULT_SIZE +from seahub.avatar.signals import avatar_updated +from seahub.avatar.util import get_primary_avatar, get_default_avatar_url, \ invalidate_cache, invalidate_group_cache from seahub.utils import render_error, render_permission_error, \ check_and_get_org_by_group diff --git a/base/__init__.py b/seahub/base/__init__.py similarity index 100% rename from base/__init__.py rename to seahub/base/__init__.py diff --git a/base/accounts.py b/seahub/base/accounts.py similarity index 99% rename from base/accounts.py rename to seahub/base/accounts.py index d443c80b66..dd98907630 100644 --- a/base/accounts.py +++ b/seahub/base/accounts.py @@ -4,16 +4,16 @@ from django.utils.encoding import smart_str from django.utils.hashcompat import md5_constructor, sha_constructor from django.utils.translation import ugettext_lazy as _ from django.conf import settings - from django.contrib.sites.models import RequestSite from django.contrib.sites.models import Site + from auth.models import get_hexdigest, check_password from auth import authenticate, login from registration import signals #from registration.forms import RegistrationForm from seaserv import ccnet_threaded_rpc, unset_repo_passwd, is_passwd_set -from profile.models import Profile +from seahub.profile.models import Profile UNUSABLE_PASSWORD = '!' # This will never be a valid hash diff --git a/base/context_processors.py b/seahub/base/context_processors.py similarity index 87% rename from base/context_processors.py rename to seahub/base/context_processors.py index cfa4481d2e..343d77e04a 100644 --- a/base/context_processors.py +++ b/seahub/base/context_processors.py @@ -6,15 +6,15 @@ and returns a dictionary to add to the context. These are referenced from the setting TEMPLATE_CONTEXT_PROCESSORS and used by RequestContext. """ -from settings import SEAFILE_VERSION, SITE_TITLE, SITE_NAME, SITE_BASE, \ +from seahub.settings import SEAFILE_VERSION, SITE_TITLE, SITE_NAME, SITE_BASE, \ ENABLE_SIGNUP, MAX_FILE_NAME, BRANDING_CSS, LOGO_PATH, LOGO_URL try: - from settings import BUSINESS_MODE + from seahub.settings import BUSINESS_MODE except ImportError: BUSINESS_MODE = False try: - from settings import ENABLE_FILE_SEARCH + from seahub.settings import ENABLE_FILE_SEARCH except ImportError: ENABLE_FILE_SEARCH = False diff --git a/base/decorators.py b/seahub/base/decorators.py similarity index 100% rename from base/decorators.py rename to seahub/base/decorators.py diff --git a/base/i18n.sh.template b/seahub/base/i18n.sh.template similarity index 100% rename from base/i18n.sh.template rename to seahub/base/i18n.sh.template diff --git a/base/locale/fr/LC_MESSAGES/django.po b/seahub/base/locale/fr/LC_MESSAGES/django.po similarity index 100% rename from base/locale/fr/LC_MESSAGES/django.po rename to seahub/base/locale/fr/LC_MESSAGES/django.po diff --git a/base/locale/zh_CN/LC_MESSAGES/django.po b/seahub/base/locale/zh_CN/LC_MESSAGES/django.po similarity index 100% rename from base/locale/zh_CN/LC_MESSAGES/django.po rename to seahub/base/locale/zh_CN/LC_MESSAGES/django.po diff --git a/base/management/__init__.py b/seahub/base/management/__init__.py similarity index 100% rename from base/management/__init__.py rename to seahub/base/management/__init__.py diff --git a/base/management/commands/__init__.py b/seahub/base/management/commands/__init__.py similarity index 100% rename from base/management/commands/__init__.py rename to seahub/base/management/commands/__init__.py diff --git a/base/management/commands/changepassword.py b/seahub/base/management/commands/changepassword.py similarity index 100% rename from base/management/commands/changepassword.py rename to seahub/base/management/commands/changepassword.py diff --git a/base/management/commands/createsuperuser.py b/seahub/base/management/commands/createsuperuser.py similarity index 100% rename from base/management/commands/createsuperuser.py rename to seahub/base/management/commands/createsuperuser.py diff --git a/base/middleware.py b/seahub/base/middleware.py similarity index 100% rename from base/middleware.py rename to seahub/base/middleware.py diff --git a/base/mixins.py b/seahub/base/mixins.py similarity index 100% rename from base/mixins.py rename to seahub/base/mixins.py diff --git a/base/models.py b/seahub/base/models.py similarity index 96% rename from base/models.py rename to seahub/base/models.py index 08afc333ff..ffb05c4422 100644 --- a/base/models.py +++ b/seahub/base/models.py @@ -6,11 +6,11 @@ from django.dispatch import receiver from seaserv import get_emailusers -from shortcuts import get_first_object_or_none -from base.templatetags.seahub_tags import at_pattern -from group.models import GroupMessage -from notifications.models import UserNotification -from profile.models import Profile +from seahub.shortcuts import get_first_object_or_none +from seahub.base.templatetags.seahub_tags import at_pattern +from seahub.group.models import GroupMessage +from seahub.notifications.models import UserNotification +from seahub.profile.models import Profile class UuidObjidMap(models.Model): """ diff --git a/base/registration_urls.py b/seahub/base/registration_urls.py similarity index 65% rename from base/registration_urls.py rename to seahub/base/registration_urls.py index a0ed520093..a9c4089278 100644 --- a/base/registration_urls.py +++ b/seahub/base/registration_urls.py @@ -1,5 +1,6 @@ from django.conf.urls.defaults import * -from django.views.generic.simple import direct_to_template +# from django.views.generic.simple import direct_to_template +from django.views.generic import TemplateView from django.conf import settings from registration.views import activate @@ -16,8 +17,7 @@ if settings.ACTIVATE_AFTER_REGISTRATION == True: urlpatterns = patterns('', url(r'^activate/complete/$', - direct_to_template, - { 'template': 'registration/activation_complete.html' }, + TemplateView.as_view(template_name='registration/activation_complete.html'), name='registration_activation_complete'), # Activation keys get matched by \w+ instead of the more specific # [a-fA-F0-9]{40} because a bad activation key should still get to the view; @@ -31,10 +31,10 @@ urlpatterns = patterns('', ) try: - from settings import CLOUD_MODE + from seahub.settings import CLOUD_MODE except ImportError: CLOUD_MODE = False -from settings import ENABLE_SIGNUP +from seahub.settings import ENABLE_SIGNUP if CLOUD_MODE or ENABLE_SIGNUP: urlpatterns += patterns('', @@ -42,14 +42,14 @@ if CLOUD_MODE or ENABLE_SIGNUP: register, reg_dict, name='registration_register'), - url(r'^register/complete/$', - direct_to_template, - { 'template': 'registration/registration_complete.html', - 'extra_context': { 'send_mail': settings.REGISTRATION_SEND_MAIL } }, - name='registration_complete'), + # Refer http://stackoverflow.com/questions/11005733/moving-from-direct-to-template-to-new-templateview-in-django to migrate direct_to_template with extra_context. + # url(r'^register/complete/$', + # TemplateView.as_view( + # template_name='registration/registration_complete.html', + # extra_context={ 'send_mail': settings.REGISTRATION_SEND_MAIL } ), + # name='registration_complete'), url(r'^register/closed/$', - direct_to_template, - { 'template': 'registration/registration_closed.html' }, + TemplateView.as_view(template_name='registration/registration_closed.html'), name='registration_disallowed'), ) diff --git a/base/templatetags/__init__.py b/seahub/base/templatetags/__init__.py similarity index 100% rename from base/templatetags/__init__.py rename to seahub/base/templatetags/__init__.py diff --git a/base/templatetags/rest_framework.py b/seahub/base/templatetags/rest_framework.py similarity index 100% rename from base/templatetags/rest_framework.py rename to seahub/base/templatetags/rest_framework.py diff --git a/base/templatetags/seahub_tags.py b/seahub/base/templatetags/seahub_tags.py similarity index 98% rename from base/templatetags/seahub_tags.py rename to seahub/base/templatetags/seahub_tags.py index 45d8c587ef..089ef17a60 100644 --- a/base/templatetags/seahub_tags.py +++ b/seahub/base/templatetags/seahub_tags.py @@ -12,13 +12,13 @@ from django.utils.translation import ugettext as _ from django.utils.translation import ungettext from django.utils.translation import pgettext -from profile.models import Profile -from profile.settings import NICKNAME_CACHE_TIMEOUT, NICKNAME_CACHE_PREFIX, \ +from seahub.base.accounts import User +from seahub.profile.models import Profile +from seahub.profile.settings import NICKNAME_CACHE_TIMEOUT, NICKNAME_CACHE_PREFIX, \ EMAIL_ID_CACHE_TIMEOUT, EMAIL_ID_CACHE_PREFIX from seahub.cconvert import CConvert from seahub.po import TRANSLATION_MAP from seahub.shortcuts import get_first_object_or_none -from base.accounts import User register = template.Library() diff --git a/base/tests.py b/seahub/base/tests.py similarity index 100% rename from base/tests.py rename to seahub/base/tests.py diff --git a/base/utils.py b/seahub/base/utils.py similarity index 100% rename from base/utils.py rename to seahub/base/utils.py diff --git a/base/views.py b/seahub/base/views.py similarity index 100% rename from base/views.py rename to seahub/base/views.py diff --git a/cconvert.py b/seahub/cconvert.py similarity index 100% rename from cconvert.py rename to seahub/cconvert.py diff --git a/contacts/__init__.py b/seahub/contacts/__init__.py similarity index 100% rename from contacts/__init__.py rename to seahub/contacts/__init__.py diff --git a/contacts/handlers.py b/seahub/contacts/handlers.py similarity index 100% rename from contacts/handlers.py rename to seahub/contacts/handlers.py diff --git a/contacts/i18n.sh.template b/seahub/contacts/i18n.sh.template similarity index 100% rename from contacts/i18n.sh.template rename to seahub/contacts/i18n.sh.template diff --git a/contacts/locale/fr/LC_MESSAGES/django.po b/seahub/contacts/locale/fr/LC_MESSAGES/django.po similarity index 100% rename from contacts/locale/fr/LC_MESSAGES/django.po rename to seahub/contacts/locale/fr/LC_MESSAGES/django.po diff --git a/contacts/locale/zh_CN/LC_MESSAGES/django.po b/seahub/contacts/locale/zh_CN/LC_MESSAGES/django.po similarity index 100% rename from contacts/locale/zh_CN/LC_MESSAGES/django.po rename to seahub/contacts/locale/zh_CN/LC_MESSAGES/django.po diff --git a/contacts/models.py b/seahub/contacts/models.py similarity index 100% rename from contacts/models.py rename to seahub/contacts/models.py diff --git a/contacts/settings.py b/seahub/contacts/settings.py similarity index 100% rename from contacts/settings.py rename to seahub/contacts/settings.py diff --git a/contacts/signals.py b/seahub/contacts/signals.py similarity index 100% rename from contacts/signals.py rename to seahub/contacts/signals.py diff --git a/contacts/templates/contacts/contact_list.html b/seahub/contacts/templates/contacts/contact_list.html similarity index 98% rename from contacts/templates/contacts/contact_list.html rename to seahub/contacts/templates/contacts/contact_list.html index fec6ce0057..291e3b79cd 100644 --- a/contacts/templates/contacts/contact_list.html +++ b/seahub/contacts/templates/contacts/contact_list.html @@ -80,7 +80,7 @@ $('#contact-edit-form').submit(function() { var form = $(this), form_id = $(this).attr('id'); $.ajax({ - url: '{% url contact_edit %}', + url: '{% url 'contact_edit' %}', type: 'POST', dataType: 'json', cache: 'false', @@ -133,7 +133,7 @@ $('#contact-add-form').submit(function() { } $.ajax({ - url: '{% url contact_add_post %}', + url: '{% url 'contact_add_post' %}', type: 'POST', dataType: 'json', cache: 'false', diff --git a/contacts/urls.py b/seahub/contacts/urls.py similarity index 100% rename from contacts/urls.py rename to seahub/contacts/urls.py diff --git a/contacts/views.py b/seahub/contacts/views.py similarity index 99% rename from contacts/views.py rename to seahub/contacts/views.py index 6015c97c0b..0d86ad8f5a 100644 --- a/contacts/views.py +++ b/seahub/contacts/views.py @@ -12,8 +12,7 @@ from django.contrib import messages from django.utils.translation import ugettext as _ from models import Contact, ContactAddForm, ContactEditForm -from utils import render_error - +from seahub.utils import render_error from seaserv import ccnet_rpc, ccnet_threaded_rpc from seahub.views import is_registered_user from seahub.settings import SITE_ROOT diff --git a/convert-utf-8.txt b/seahub/convert-utf-8.txt similarity index 100% rename from convert-utf-8.txt rename to seahub/convert-utf-8.txt diff --git a/forms.py b/seahub/forms.py similarity index 99% rename from forms.py rename to seahub/forms.py index 970ac62492..00f1c64897 100644 --- a/forms.py +++ b/seahub/forms.py @@ -5,7 +5,7 @@ from django.utils.translation import ugettext_lazy as _ from seaserv import ccnet_rpc, ccnet_threaded_rpc, seafserv_threaded_rpc, \ is_valid_filename -from seahub.base.accounts import User +from base.accounts import User from pysearpc import SearpcError import settings diff --git a/fts/__init__.py b/seahub/fts/__init__.py similarity index 100% rename from fts/__init__.py rename to seahub/fts/__init__.py diff --git a/fts/models.py b/seahub/fts/models.py similarity index 100% rename from fts/models.py rename to seahub/fts/models.py diff --git a/fts/tests.py b/seahub/fts/tests.py similarity index 100% rename from fts/tests.py rename to seahub/fts/tests.py diff --git a/fts/views.py b/seahub/fts/views.py similarity index 100% rename from fts/views.py rename to seahub/fts/views.py diff --git a/group/__init__.py b/seahub/group/__init__.py similarity index 100% rename from group/__init__.py rename to seahub/group/__init__.py diff --git a/group/decorators.py b/seahub/group/decorators.py similarity index 100% rename from group/decorators.py rename to seahub/group/decorators.py diff --git a/group/error_msg.py b/seahub/group/error_msg.py similarity index 100% rename from group/error_msg.py rename to seahub/group/error_msg.py diff --git a/group/fixtures/groupmessage.json b/seahub/group/fixtures/groupmessage.json similarity index 100% rename from group/fixtures/groupmessage.json rename to seahub/group/fixtures/groupmessage.json diff --git a/group/forms.py b/seahub/group/forms.py similarity index 100% rename from group/forms.py rename to seahub/group/forms.py diff --git a/group/handlers.py b/seahub/group/handlers.py similarity index 96% rename from group/handlers.py rename to seahub/group/handlers.py index e30a76bd66..cd3f55b976 100644 --- a/group/handlers.py +++ b/seahub/group/handlers.py @@ -1,6 +1,6 @@ from signals import grpmsg_added from models import GroupMessage -from notifications.models import UserNotification +from seahub.notifications.models import UserNotification from seaserv import get_group_members diff --git a/group/i18n.sh.template b/seahub/group/i18n.sh.template similarity index 100% rename from group/i18n.sh.template rename to seahub/group/i18n.sh.template diff --git a/group/locale/fr/LC_MESSAGES/django.po b/seahub/group/locale/fr/LC_MESSAGES/django.po similarity index 100% rename from group/locale/fr/LC_MESSAGES/django.po rename to seahub/group/locale/fr/LC_MESSAGES/django.po diff --git a/group/locale/zh_CN/LC_MESSAGES/django.po b/seahub/group/locale/zh_CN/LC_MESSAGES/django.po similarity index 100% rename from group/locale/zh_CN/LC_MESSAGES/django.po rename to seahub/group/locale/zh_CN/LC_MESSAGES/django.po diff --git a/group/models.py b/seahub/group/models.py similarity index 94% rename from group/models.py rename to seahub/group/models.py index 3c3d0e2730..101c074e97 100644 --- a/group/models.py +++ b/seahub/group/models.py @@ -7,9 +7,9 @@ from django.dispatch import receiver from seaserv import get_group_members -from shortcuts import get_first_object_or_none -from notifications.models import UserNotification -from profile.models import Profile +from seahub.shortcuts import get_first_object_or_none +from seahub.notifications.models import UserNotification +from seahub.profile.models import Profile class GroupMessage(models.Model): group_id = models.IntegerField(db_index=True) diff --git a/group/settings.py b/seahub/group/settings.py similarity index 100% rename from group/settings.py rename to seahub/group/settings.py diff --git a/group/signals.py b/seahub/group/signals.py similarity index 100% rename from group/signals.py rename to seahub/group/signals.py diff --git a/group/templates/group/add_member_email.html b/seahub/group/templates/group/add_member_email.html similarity index 100% rename from group/templates/group/add_member_email.html rename to seahub/group/templates/group/add_member_email.html diff --git a/group/templates/group/discussion_list.html b/seahub/group/templates/group/discussion_list.html similarity index 100% rename from group/templates/group/discussion_list.html rename to seahub/group/templates/group/discussion_list.html diff --git a/group/templates/group/group_discuss.html b/seahub/group/templates/group/group_discuss.html similarity index 100% rename from group/templates/group/group_discuss.html rename to seahub/group/templates/group/group_discuss.html diff --git a/group/templates/group/group_info.html b/seahub/group/templates/group/group_info.html similarity index 100% rename from group/templates/group/group_info.html rename to seahub/group/templates/group/group_info.html diff --git a/group/templates/group/group_info_for_pub.html b/seahub/group/templates/group/group_info_for_pub.html similarity index 100% rename from group/templates/group/group_info_for_pub.html rename to seahub/group/templates/group/group_info_for_pub.html diff --git a/group/templates/group/group_join_email.html b/seahub/group/templates/group/group_join_email.html similarity index 100% rename from group/templates/group/group_join_email.html rename to seahub/group/templates/group/group_join_email.html diff --git a/group/templates/group/group_manage.html b/seahub/group/templates/group/group_manage.html similarity index 100% rename from group/templates/group/group_manage.html rename to seahub/group/templates/group/group_manage.html diff --git a/group/templates/group/group_members.html b/seahub/group/templates/group/group_members.html similarity index 100% rename from group/templates/group/group_members.html rename to seahub/group/templates/group/group_members.html diff --git a/group/templates/group/group_pubinfo.html b/seahub/group/templates/group/group_pubinfo.html similarity index 100% rename from group/templates/group/group_pubinfo.html rename to seahub/group/templates/group/group_pubinfo.html diff --git a/group/templates/group/group_reply_list.html b/seahub/group/templates/group/group_reply_list.html similarity index 100% rename from group/templates/group/group_reply_list.html rename to seahub/group/templates/group/group_reply_list.html diff --git a/group/templates/group/group_wiki.html b/seahub/group/templates/group/group_wiki.html similarity index 100% rename from group/templates/group/group_wiki.html rename to seahub/group/templates/group/group_wiki.html diff --git a/group/templates/group/group_wiki_pages.html b/seahub/group/templates/group/group_wiki_pages.html similarity index 100% rename from group/templates/group/group_wiki_pages.html rename to seahub/group/templates/group/group_wiki_pages.html diff --git a/group/templates/group/groups.html b/seahub/group/templates/group/groups.html similarity index 100% rename from group/templates/group/groups.html rename to seahub/group/templates/group/groups.html diff --git a/group/templates/group/groups_left_panel.html b/seahub/group/templates/group/groups_left_panel.html similarity index 100% rename from group/templates/group/groups_left_panel.html rename to seahub/group/templates/group/groups_left_panel.html diff --git a/group/templates/group/groups_right_panel.html b/seahub/group/templates/group/groups_right_panel.html similarity index 100% rename from group/templates/group/groups_right_panel.html rename to seahub/group/templates/group/groups_right_panel.html diff --git a/group/templates/group/grpadmin_add_js.html b/seahub/group/templates/group/grpadmin_add_js.html similarity index 100% rename from group/templates/group/grpadmin_add_js.html rename to seahub/group/templates/group/grpadmin_add_js.html diff --git a/group/templates/group/grpmember_add_form.html b/seahub/group/templates/group/grpmember_add_form.html similarity index 100% rename from group/templates/group/grpmember_add_form.html rename to seahub/group/templates/group/grpmember_add_form.html diff --git a/group/templates/group/grpmember_add_js.html b/seahub/group/templates/group/grpmember_add_js.html similarity index 100% rename from group/templates/group/grpmember_add_js.html rename to seahub/group/templates/group/grpmember_add_js.html diff --git a/group/templates/group/msg_js.html b/seahub/group/templates/group/msg_js.html similarity index 100% rename from group/templates/group/msg_js.html rename to seahub/group/templates/group/msg_js.html diff --git a/group/templates/group/msg_reply.html b/seahub/group/templates/group/msg_reply.html similarity index 100% rename from group/templates/group/msg_reply.html rename to seahub/group/templates/group/msg_reply.html diff --git a/group/templates/group/new_msg_reply.html b/seahub/group/templates/group/new_msg_reply.html similarity index 100% rename from group/templates/group/new_msg_reply.html rename to seahub/group/templates/group/new_msg_reply.html diff --git a/group/templates/group/proj_groups.html b/seahub/group/templates/group/proj_groups.html similarity index 100% rename from group/templates/group/proj_groups.html rename to seahub/group/templates/group/proj_groups.html diff --git a/group/tests/__init__.py b/seahub/group/tests/__init__.py similarity index 100% rename from group/tests/__init__.py rename to seahub/group/tests/__init__.py diff --git a/group/tests/testdata/large_message b/seahub/group/tests/testdata/large_message similarity index 100% rename from group/tests/testdata/large_message rename to seahub/group/tests/testdata/large_message diff --git a/group/tests/testdata/valid_message b/seahub/group/tests/testdata/valid_message similarity index 100% rename from group/tests/testdata/valid_message rename to seahub/group/tests/testdata/valid_message diff --git a/group/tests/tests.py b/seahub/group/tests/tests.py similarity index 100% rename from group/tests/tests.py rename to seahub/group/tests/tests.py diff --git a/group/urls.py b/seahub/group/urls.py similarity index 100% rename from group/urls.py rename to seahub/group/urls.py diff --git a/group/views.py b/seahub/group/views.py similarity index 99% rename from group/views.py rename to seahub/group/views.py index ff7a09c649..3d2eed5657 100644 --- a/group/views.py +++ b/seahub/group/views.py @@ -37,15 +37,15 @@ from forms import MessageForm, MessageReplyForm, GroupRecommendForm, \ GroupAddForm, GroupJoinMsgForm, WikiCreateForm from signals import grpmsg_added, grpmsg_reply_added from settings import GROUP_MEMBERS_DEFAULT_DISPLAY -from base.decorators import sys_staff_required -from base.models import FileDiscuss +from seahub.base.decorators import sys_staff_required +from seahub.base.models import FileDiscuss from seahub.contacts.models import Contact from seahub.contacts.signals import mail_sended from seahub.notifications.models import UserNotification -from wiki import get_group_wiki_repo, get_group_wiki_page, convert_wiki_link,\ +from seahub.wiki import get_group_wiki_repo, get_group_wiki_page, convert_wiki_link,\ get_wiki_pages -from wiki.models import WikiDoesNotExist, WikiPageMissing, GroupWiki -from wiki.utils import clean_page_name, get_wiki_dirent +from seahub.wiki.models import WikiDoesNotExist, WikiPageMissing, GroupWiki +from seahub.wiki.utils import clean_page_name, get_wiki_dirent from seahub.settings import SITE_ROOT, SITE_NAME, MEDIA_URL from seahub.shortcuts import get_first_object_or_none from seahub.utils import render_error, render_permission_error, string2list, \ diff --git a/handlers.py b/seahub/handlers.py similarity index 100% rename from handlers.py rename to seahub/handlers.py diff --git a/notifications/__init__.py b/seahub/notifications/__init__.py similarity index 100% rename from notifications/__init__.py rename to seahub/notifications/__init__.py diff --git a/notifications/i18n.sh.template b/seahub/notifications/i18n.sh.template similarity index 100% rename from notifications/i18n.sh.template rename to seahub/notifications/i18n.sh.template diff --git a/notifications/locale/fr/LC_MESSAGES/django.po b/seahub/notifications/locale/fr/LC_MESSAGES/django.po similarity index 100% rename from notifications/locale/fr/LC_MESSAGES/django.po rename to seahub/notifications/locale/fr/LC_MESSAGES/django.po diff --git a/notifications/locale/zh_CN/LC_MESSAGES/django.po b/seahub/notifications/locale/zh_CN/LC_MESSAGES/django.po similarity index 100% rename from notifications/locale/zh_CN/LC_MESSAGES/django.po rename to seahub/notifications/locale/zh_CN/LC_MESSAGES/django.po diff --git a/notifications/management/__init__.py b/seahub/notifications/management/__init__.py similarity index 100% rename from notifications/management/__init__.py rename to seahub/notifications/management/__init__.py diff --git a/notifications/management/commands/__init__.py b/seahub/notifications/management/commands/__init__.py similarity index 100% rename from notifications/management/commands/__init__.py rename to seahub/notifications/management/commands/__init__.py diff --git a/notifications/management/commands/send_user_notifications.py b/seahub/notifications/management/commands/send_user_notifications.py similarity index 100% rename from notifications/management/commands/send_user_notifications.py rename to seahub/notifications/management/commands/send_user_notifications.py diff --git a/notifications/models.py b/seahub/notifications/models.py similarity index 100% rename from notifications/models.py rename to seahub/notifications/models.py diff --git a/notifications/settings.py b/seahub/notifications/settings.py similarity index 100% rename from notifications/settings.py rename to seahub/notifications/settings.py diff --git a/notifications/templates/notifications/add_notification_form.html b/seahub/notifications/templates/notifications/add_notification_form.html similarity index 100% rename from notifications/templates/notifications/add_notification_form.html rename to seahub/notifications/templates/notifications/add_notification_form.html diff --git a/notifications/templates/notifications/notification_list.html b/seahub/notifications/templates/notifications/notification_list.html similarity index 100% rename from notifications/templates/notifications/notification_list.html rename to seahub/notifications/templates/notifications/notification_list.html diff --git a/notifications/tests.py b/seahub/notifications/tests.py similarity index 100% rename from notifications/tests.py rename to seahub/notifications/tests.py diff --git a/notifications/urls.py b/seahub/notifications/urls.py similarity index 86% rename from notifications/urls.py rename to seahub/notifications/urls.py index 52c0f59e80..d14cfbee4f 100644 --- a/notifications/urls.py +++ b/seahub/notifications/urls.py @@ -1,6 +1,6 @@ from django.conf.urls.defaults import patterns, url -urlpatterns = patterns('notifications.views', +urlpatterns = patterns('seahub.notifications.views', # url(r'^$', 'notification_list', name='notification_list'), url(r'^add/$', 'notification_add', name='notification_add'), url(r'^delete/(?P[\d]+)/$', 'notification_delete', name='notification_delete'), diff --git a/notifications/utils.py b/seahub/notifications/utils.py similarity index 100% rename from notifications/utils.py rename to seahub/notifications/utils.py diff --git a/notifications/views.py b/seahub/notifications/views.py similarity index 100% rename from notifications/views.py rename to seahub/notifications/views.py diff --git a/po.py b/seahub/po.py similarity index 100% rename from po.py rename to seahub/po.py diff --git a/profile/__init__.py b/seahub/profile/__init__.py similarity index 100% rename from profile/__init__.py rename to seahub/profile/__init__.py diff --git a/profile/admin.py b/seahub/profile/admin.py similarity index 100% rename from profile/admin.py rename to seahub/profile/admin.py diff --git a/profile/forms.py b/seahub/profile/forms.py similarity index 100% rename from profile/forms.py rename to seahub/profile/forms.py diff --git a/profile/i18n.sh.template b/seahub/profile/i18n.sh.template similarity index 100% rename from profile/i18n.sh.template rename to seahub/profile/i18n.sh.template diff --git a/profile/locale/fr/LC_MESSAGES/django.po b/seahub/profile/locale/fr/LC_MESSAGES/django.po similarity index 100% rename from profile/locale/fr/LC_MESSAGES/django.po rename to seahub/profile/locale/fr/LC_MESSAGES/django.po diff --git a/profile/locale/zh_CN/LC_MESSAGES/django.po b/seahub/profile/locale/zh_CN/LC_MESSAGES/django.po similarity index 100% rename from profile/locale/zh_CN/LC_MESSAGES/django.po rename to seahub/profile/locale/zh_CN/LC_MESSAGES/django.po diff --git a/profile/models.py b/seahub/profile/models.py similarity index 100% rename from profile/models.py rename to seahub/profile/models.py diff --git a/profile/settings.py b/seahub/profile/settings.py similarity index 100% rename from profile/settings.py rename to seahub/profile/settings.py diff --git a/profile/templates/profile/profile_base.html b/seahub/profile/templates/profile/profile_base.html similarity index 100% rename from profile/templates/profile/profile_base.html rename to seahub/profile/templates/profile/profile_base.html diff --git a/profile/templates/profile/set_ccnet_conf.html b/seahub/profile/templates/profile/set_ccnet_conf.html similarity index 100% rename from profile/templates/profile/set_ccnet_conf.html rename to seahub/profile/templates/profile/set_ccnet_conf.html diff --git a/profile/templates/profile/set_profile.html b/seahub/profile/templates/profile/set_profile.html similarity index 100% rename from profile/templates/profile/set_profile.html rename to seahub/profile/templates/profile/set_profile.html diff --git a/profile/templates/profile/user_ids.html b/seahub/profile/templates/profile/user_ids.html similarity index 100% rename from profile/templates/profile/user_ids.html rename to seahub/profile/templates/profile/user_ids.html diff --git a/profile/templates/profile/user_profile.html b/seahub/profile/templates/profile/user_profile.html similarity index 100% rename from profile/templates/profile/user_profile.html rename to seahub/profile/templates/profile/user_profile.html diff --git a/profile/tests.py b/seahub/profile/tests.py similarity index 100% rename from profile/tests.py rename to seahub/profile/tests.py diff --git a/profile/urls.py b/seahub/profile/urls.py similarity index 89% rename from profile/urls.py rename to seahub/profile/urls.py index e7e5700a91..273f2f8948 100644 --- a/profile/urls.py +++ b/seahub/profile/urls.py @@ -1,6 +1,6 @@ from django.conf.urls.defaults import * -urlpatterns = patterns('profile.views', +urlpatterns = patterns('seahub.profile.views', # url(r'^list_user/$', 'list_userids', name="list_userids"), url(r'^$', 'edit_profile', name="edit_profile"), url(r'^(?P[^/]+)/$', 'user_profile', name="user_profile"), diff --git a/profile/utils.py b/seahub/profile/utils.py similarity index 100% rename from profile/utils.py rename to seahub/profile/utils.py diff --git a/profile/views.py b/seahub/profile/views.py similarity index 100% rename from profile/views.py rename to seahub/profile/views.py diff --git a/settings.py b/seahub/settings.py similarity index 81% rename from settings.py rename to seahub/settings.py index 35f6f0c108..2e5908cd35 100644 --- a/settings.py +++ b/seahub/settings.py @@ -1,11 +1,13 @@ -# encoding: utf-8 +# -*- coding: utf-8 -*- # Django settings for seahub project. + import sys import os import re import random import string +PROJECT_ROOT = os.path.dirname(__file__) DEBUG = False TEMPLATE_DEBUG = DEBUG @@ -18,8 +20,8 @@ MANAGERS = ADMINS DATABASES = { 'default': { - 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. - 'NAME': os.path.join(os.path.dirname(__file__), 'seahub.db'), # Or path to database file if using sqlite3. + 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. + 'NAME': '%s/../seahub.db' % PROJECT_ROOT, # Or path to database file if using sqlite3. 'USER': '', # Not used with sqlite3. 'PASSWORD': '', # Not used with sqlite3. 'HOST': '', # Set to empty string for localhost. Not used with sqlite3. @@ -44,55 +46,81 @@ SITE_ID = 1 # to load the internationalization machinery. USE_I18N = True -# Absolute path to the directory that holds media. -# Example: "/home/media/media.lawrence.com/" -MEDIA_ROOT = os.path.join(os.path.dirname(__file__), "media") +# If you set this to False, Django will not format dates, numbers and +# calendars according to the current locale. +USE_L10N = True + +# If you set this to False, Django will not use timezone-aware datetimes. +USE_TZ = False + +# Absolute filesystem path to the directory that will hold user-uploaded files. +# Example: "/home/media/media.lawrence.com/media/" +MEDIA_ROOT = '%s/../media/' % PROJECT_ROOT # URL that handles the media served from MEDIA_ROOT. Make sure to use a # trailing slash if there is a path component (optional in other cases). # Examples: "http://media.lawrence.com", "http://example.com/media/" MEDIA_URL = '/media/' -# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a -# trailing slash. -# Examples: "http://foo.com/media/", "/media/". -ADMIN_MEDIA_PREFIX = '/media/' +# Absolute path to the directory static files should be collected to. +# Don't put anything in this directory yourself; store your static files +# in apps' "static/" subdirectories and in STATICFILES_DIRS. +# Example: "/home/media/media.lawrence.com/static/" +STATIC_ROOT = '' -ADMIN_MEDIA_PREFIX = '%sadmin/' %(MEDIA_URL) +# URL prefix for static files. +# Example: "http://media.lawrence.com/static/" +STATIC_URL = '' + +# Additional locations of static files +STATICFILES_DIRS = ( + # Put strings here, like "/home/html/static" or "C:/www/django/static". + # Always use forward slashes, even on Windows. + # Don't forget to use absolute paths, not relative paths. +) + +# List of finder classes that know how to find static files in +# various locations. +STATICFILES_FINDERS = ( + 'django.contrib.staticfiles.finders.FileSystemFinder', + 'django.contrib.staticfiles.finders.AppDirectoriesFinder', +# 'django.contrib.staticfiles.finders.DefaultStorageFinder', +) # Make this unique, and don't share it with anybody. SECRET_KEY = 'n*v0=jz-1rz@(4gx^tf%6^e7c&um@2)g-l=3_)t@19a69n1nv6' # List of callables that know how to import templates from various sources. TEMPLATE_LOADERS = ( - 'django.template.loaders.filesystem.load_template_source', - 'django.template.loaders.app_directories.load_template_source', -# 'django.template.loaders.eggs.load_template_source', + 'django.template.loaders.filesystem.Loader', + 'django.template.loaders.app_directories.Loader', +# 'django.template.loaders.eggs.Loader', ) MIDDLEWARE_CLASSES = ( 'django.middleware.common.CommonMiddleware', - 'django.middleware.csrf.CsrfViewMiddleware', - 'django.middleware.csrf.CsrfResponseMiddleware', + 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', - 'django.middleware.locale.LocaleMiddleware', - 'django.contrib.messages.middleware.MessageMiddleware', + 'django.contrib.messages.middleware.MessageMiddleware', 'auth.middleware.AuthenticationMiddleware', - 'base.middleware.BaseMiddleware', - 'base.middleware.InfobarMiddleware', + 'seahub.base.middleware.BaseMiddleware', + 'seahub.base.middleware.InfobarMiddleware', ) SITE_ROOT_URLCONF = 'seahub.urls' ROOT_URLCONF = 'djblets.util.rooturl' - SITE_ROOT = '/' +ROOT_URLCONF = 'seahub.urls' + +# Python dotted path to the WSGI application used by Django's runserver. +WSGI_APPLICATION = 'seahub.wsgi.application' + TEMPLATE_DIRS = ( # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". # Always use forward slashes, even on Windows. # Don't forget to use absolute paths, not relative paths. - os.path.join(os.path.dirname(__file__), "templates"), -# os.path.join(os.path.dirname(__file__),'thirdpart/djangorestframework/templates'), + os.path.join(PROJECT_ROOT, 'templates'), ) # This is defined here as a do-nothing function because we can't import @@ -114,9 +142,9 @@ LOCALE_PATHS = ( ) TEMPLATE_CONTEXT_PROCESSORS = ( - 'django.core.context_processors.auth', + 'django.contrib.auth.context_processors.auth', 'django.core.context_processors.debug', - 'django.core.context_processors.i18n', + 'django.core.context_processors.i18n', 'django.core.context_processors.media', 'djblets.util.context_processors.siteRoot', 'django.core.context_processors.request', @@ -124,15 +152,15 @@ TEMPLATE_CONTEXT_PROCESSORS = ( 'seahub.base.context_processors.base', ) - INSTALLED_APPS = ( 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', - 'avatar', 'registration', + 'seahub.api2', + 'seahub.avatar', 'seahub.base', 'seahub.contacts', 'seahub.wiki', @@ -140,7 +168,6 @@ INSTALLED_APPS = ( 'seahub.notifications', 'seahub.profile', 'seahub.share', - 'api2', ) AUTHENTICATION_BACKENDS = ( diff --git a/share/__init__.py b/seahub/share/__init__.py similarity index 100% rename from share/__init__.py rename to seahub/share/__init__.py diff --git a/share/forms.py b/seahub/share/forms.py similarity index 100% rename from share/forms.py rename to seahub/share/forms.py diff --git a/share/i18n.sh.template b/seahub/share/i18n.sh.template similarity index 100% rename from share/i18n.sh.template rename to seahub/share/i18n.sh.template diff --git a/share/locale/fr/LC_MESSAGES/django.po b/seahub/share/locale/fr/LC_MESSAGES/django.po similarity index 100% rename from share/locale/fr/LC_MESSAGES/django.po rename to seahub/share/locale/fr/LC_MESSAGES/django.po diff --git a/share/locale/zh_CN/LC_MESSAGES/django.po b/seahub/share/locale/zh_CN/LC_MESSAGES/django.po similarity index 100% rename from share/locale/zh_CN/LC_MESSAGES/django.po rename to seahub/share/locale/zh_CN/LC_MESSAGES/django.po diff --git a/share/models.py b/seahub/share/models.py similarity index 100% rename from share/models.py rename to seahub/share/models.py diff --git a/share/settings.py b/seahub/share/settings.py similarity index 100% rename from share/settings.py rename to seahub/share/settings.py diff --git a/share/templates/repo/anonymous_share_confirm.html b/seahub/share/templates/repo/anonymous_share_confirm.html similarity index 100% rename from share/templates/repo/anonymous_share_confirm.html rename to seahub/share/templates/repo/anonymous_share_confirm.html diff --git a/share/templates/repo/anonymous_share_email.html b/seahub/share/templates/repo/anonymous_share_email.html similarity index 100% rename from share/templates/repo/anonymous_share_email.html rename to seahub/share/templates/repo/anonymous_share_email.html diff --git a/share/templates/repo/repo_share_mail.html b/seahub/share/templates/repo/repo_share_mail.html similarity index 100% rename from share/templates/repo/repo_share_mail.html rename to seahub/share/templates/repo/repo_share_mail.html diff --git a/share/templates/repo/share_admin.html b/seahub/share/templates/repo/share_admin.html similarity index 100% rename from share/templates/repo/share_admin.html rename to seahub/share/templates/repo/share_admin.html diff --git a/share/tests.py b/seahub/share/tests.py similarity index 100% rename from share/tests.py rename to seahub/share/tests.py diff --git a/share/tokens.py b/seahub/share/tokens.py similarity index 100% rename from share/tokens.py rename to seahub/share/tokens.py diff --git a/share/urls.py b/seahub/share/urls.py similarity index 100% rename from share/urls.py rename to seahub/share/urls.py diff --git a/share/views.py b/seahub/share/views.py similarity index 100% rename from share/views.py rename to seahub/share/views.py diff --git a/shortcuts.py b/seahub/shortcuts.py similarity index 100% rename from shortcuts.py rename to seahub/shortcuts.py diff --git a/signals.py b/seahub/signals.py similarity index 100% rename from signals.py rename to seahub/signals.py diff --git a/templates/404.html b/seahub/templates/404.html similarity index 100% rename from templates/404.html rename to seahub/templates/404.html diff --git a/templates/500.html b/seahub/templates/500.html similarity index 100% rename from templates/500.html rename to seahub/templates/500.html diff --git a/templates/accounts.html b/seahub/templates/accounts.html similarity index 100% rename from templates/accounts.html rename to seahub/templates/accounts.html diff --git a/templates/admin_base.html b/seahub/templates/admin_base.html similarity index 100% rename from templates/admin_base.html rename to seahub/templates/admin_base.html diff --git a/templates/base.html b/seahub/templates/base.html similarity index 100% rename from templates/base.html rename to seahub/templates/base.html diff --git a/templates/decrypt_repo_form.html b/seahub/templates/decrypt_repo_form.html similarity index 100% rename from templates/decrypt_repo_form.html rename to seahub/templates/decrypt_repo_form.html diff --git a/templates/error.html b/seahub/templates/error.html similarity index 100% rename from templates/error.html rename to seahub/templates/error.html diff --git a/templates/feedback.html b/seahub/templates/feedback.html similarity index 100% rename from templates/feedback.html rename to seahub/templates/feedback.html diff --git a/templates/file_edit.html b/seahub/templates/file_edit.html similarity index 100% rename from templates/file_edit.html rename to seahub/templates/file_edit.html diff --git a/templates/file_revisions.html b/seahub/templates/file_revisions.html similarity index 100% rename from templates/file_revisions.html rename to seahub/templates/file_revisions.html diff --git a/templates/file_upload_progress_page.html b/seahub/templates/file_upload_progress_page.html similarity index 100% rename from templates/file_upload_progress_page.html rename to seahub/templates/file_upload_progress_page.html diff --git a/templates/history_file_view.html b/seahub/templates/history_file_view.html similarity index 100% rename from templates/history_file_view.html rename to seahub/templates/history_file_view.html diff --git a/templates/myhome.html b/seahub/templates/myhome.html similarity index 100% rename from templates/myhome.html rename to seahub/templates/myhome.html diff --git a/templates/myhome_base.html b/seahub/templates/myhome_base.html similarity index 100% rename from templates/myhome_base.html rename to seahub/templates/myhome_base.html diff --git a/templates/org_admin_base.html b/seahub/templates/org_admin_base.html similarity index 100% rename from templates/org_admin_base.html rename to seahub/templates/org_admin_base.html diff --git a/templates/org_base.html b/seahub/templates/org_base.html similarity index 100% rename from templates/org_base.html rename to seahub/templates/org_base.html diff --git a/templates/pdf_full_view.html b/seahub/templates/pdf_full_view.html similarity index 100% rename from templates/pdf_full_view.html rename to seahub/templates/pdf_full_view.html diff --git a/templates/permission_error.html b/seahub/templates/permission_error.html similarity index 100% rename from templates/permission_error.html rename to seahub/templates/permission_error.html diff --git a/templates/pubgrp.html b/seahub/templates/pubgrp.html similarity index 100% rename from templates/pubgrp.html rename to seahub/templates/pubgrp.html diff --git a/templates/pubrepo.html b/seahub/templates/pubrepo.html similarity index 100% rename from templates/pubrepo.html rename to seahub/templates/pubrepo.html diff --git a/templates/pubuser.html b/seahub/templates/pubuser.html similarity index 100% rename from templates/pubuser.html rename to seahub/templates/pubuser.html diff --git a/templates/registration/activate.html b/seahub/templates/registration/activate.html similarity index 100% rename from templates/registration/activate.html rename to seahub/templates/registration/activate.html diff --git a/templates/registration/activation_complete.html b/seahub/templates/registration/activation_complete.html similarity index 100% rename from templates/registration/activation_complete.html rename to seahub/templates/registration/activation_complete.html diff --git a/templates/registration/activation_email.txt b/seahub/templates/registration/activation_email.txt similarity index 100% rename from templates/registration/activation_email.txt rename to seahub/templates/registration/activation_email.txt diff --git a/templates/registration/activation_email_subject.txt b/seahub/templates/registration/activation_email_subject.txt similarity index 100% rename from templates/registration/activation_email_subject.txt rename to seahub/templates/registration/activation_email_subject.txt diff --git a/templates/registration/login.html b/seahub/templates/registration/login.html similarity index 100% rename from templates/registration/login.html rename to seahub/templates/registration/login.html diff --git a/templates/registration/logout.html b/seahub/templates/registration/logout.html similarity index 100% rename from templates/registration/logout.html rename to seahub/templates/registration/logout.html diff --git a/templates/registration/org_registration_form.html b/seahub/templates/registration/org_registration_form.html similarity index 100% rename from templates/registration/org_registration_form.html rename to seahub/templates/registration/org_registration_form.html diff --git a/templates/registration/password_change_done.html b/seahub/templates/registration/password_change_done.html similarity index 100% rename from templates/registration/password_change_done.html rename to seahub/templates/registration/password_change_done.html diff --git a/templates/registration/password_change_form.html b/seahub/templates/registration/password_change_form.html similarity index 100% rename from templates/registration/password_change_form.html rename to seahub/templates/registration/password_change_form.html diff --git a/templates/registration/password_reset_complete.html b/seahub/templates/registration/password_reset_complete.html similarity index 100% rename from templates/registration/password_reset_complete.html rename to seahub/templates/registration/password_reset_complete.html diff --git a/templates/registration/password_reset_confirm.html b/seahub/templates/registration/password_reset_confirm.html similarity index 100% rename from templates/registration/password_reset_confirm.html rename to seahub/templates/registration/password_reset_confirm.html diff --git a/templates/registration/password_reset_done.html b/seahub/templates/registration/password_reset_done.html similarity index 100% rename from templates/registration/password_reset_done.html rename to seahub/templates/registration/password_reset_done.html diff --git a/templates/registration/password_reset_email.html b/seahub/templates/registration/password_reset_email.html similarity index 100% rename from templates/registration/password_reset_email.html rename to seahub/templates/registration/password_reset_email.html diff --git a/templates/registration/password_reset_form.html b/seahub/templates/registration/password_reset_form.html similarity index 100% rename from templates/registration/password_reset_form.html rename to seahub/templates/registration/password_reset_form.html diff --git a/templates/registration/registration_closed.html b/seahub/templates/registration/registration_closed.html similarity index 100% rename from templates/registration/registration_closed.html rename to seahub/templates/registration/registration_closed.html diff --git a/templates/registration/registration_complete.html b/seahub/templates/registration/registration_complete.html similarity index 100% rename from templates/registration/registration_complete.html rename to seahub/templates/registration/registration_complete.html diff --git a/templates/registration/registration_form.html b/seahub/templates/registration/registration_form.html similarity index 100% rename from templates/registration/registration_form.html rename to seahub/templates/registration/registration_form.html diff --git a/templates/repo.html b/seahub/templates/repo.html similarity index 100% rename from templates/repo.html rename to seahub/templates/repo.html diff --git a/templates/repo_history.html b/seahub/templates/repo_history.html similarity index 100% rename from templates/repo_history.html rename to seahub/templates/repo_history.html diff --git a/templates/repo_history_view.html b/seahub/templates/repo_history_view.html similarity index 100% rename from templates/repo_history_view.html rename to seahub/templates/repo_history_view.html diff --git a/templates/repo_recycle_view.html b/seahub/templates/repo_recycle_view.html similarity index 100% rename from templates/repo_recycle_view.html rename to seahub/templates/repo_recycle_view.html diff --git a/templates/repo_view_snapshot.html b/seahub/templates/repo_view_snapshot.html similarity index 100% rename from templates/repo_view_snapshot.html rename to seahub/templates/repo_view_snapshot.html diff --git a/templates/rest_framework/api.html b/seahub/templates/rest_framework/api.html similarity index 100% rename from templates/rest_framework/api.html rename to seahub/templates/rest_framework/api.html diff --git a/templates/rest_framework/base.html b/seahub/templates/rest_framework/base.html similarity index 100% rename from templates/rest_framework/base.html rename to seahub/templates/rest_framework/base.html diff --git a/templates/rest_framework/login.html b/seahub/templates/rest_framework/login.html similarity index 100% rename from templates/rest_framework/login.html rename to seahub/templates/rest_framework/login.html diff --git a/templates/seafile_access_check.html b/seahub/templates/seafile_access_check.html similarity index 100% rename from templates/seafile_access_check.html rename to seahub/templates/seafile_access_check.html diff --git a/templates/search_results.html b/seahub/templates/search_results.html similarity index 100% rename from templates/search_results.html rename to seahub/templates/search_results.html diff --git a/templates/shared_file_view.html b/seahub/templates/shared_file_view.html similarity index 100% rename from templates/shared_file_view.html rename to seahub/templates/shared_file_view.html diff --git a/templates/shared_link_email.html b/seahub/templates/shared_link_email.html similarity index 100% rename from templates/shared_link_email.html rename to seahub/templates/shared_link_email.html diff --git a/templates/snippets/avatar_upload_js.html b/seahub/templates/snippets/avatar_upload_js.html similarity index 100% rename from templates/snippets/avatar_upload_js.html rename to seahub/templates/snippets/avatar_upload_js.html diff --git a/templates/snippets/bottom_bar.html b/seahub/templates/snippets/bottom_bar.html similarity index 100% rename from templates/snippets/bottom_bar.html rename to seahub/templates/snippets/bottom_bar.html diff --git a/templates/snippets/editor_set_mode.html b/seahub/templates/snippets/editor_set_mode.html similarity index 100% rename from templates/snippets/editor_set_mode.html rename to seahub/templates/snippets/editor_set_mode.html diff --git a/templates/snippets/events.html b/seahub/templates/snippets/events.html similarity index 100% rename from templates/snippets/events.html rename to seahub/templates/snippets/events.html diff --git a/templates/snippets/events_.html b/seahub/templates/snippets/events_.html similarity index 100% rename from templates/snippets/events_.html rename to seahub/templates/snippets/events_.html diff --git a/templates/snippets/events_js.html b/seahub/templates/snippets/events_js.html similarity index 100% rename from templates/snippets/events_js.html rename to seahub/templates/snippets/events_js.html diff --git a/templates/snippets/file_content_html.html b/seahub/templates/snippets/file_content_html.html similarity index 100% rename from templates/snippets/file_content_html.html rename to seahub/templates/snippets/file_content_html.html diff --git a/templates/snippets/file_content_js.html b/seahub/templates/snippets/file_content_js.html similarity index 100% rename from templates/snippets/file_content_js.html rename to seahub/templates/snippets/file_content_js.html diff --git a/templates/snippets/file_encoding.html b/seahub/templates/snippets/file_encoding.html similarity index 100% rename from templates/snippets/file_encoding.html rename to seahub/templates/snippets/file_encoding.html diff --git a/templates/snippets/file_upload_progress_js.html b/seahub/templates/snippets/file_upload_progress_js.html similarity index 100% rename from templates/snippets/file_upload_progress_js.html rename to seahub/templates/snippets/file_upload_progress_js.html diff --git a/templates/snippets/file_view_js.html b/seahub/templates/snippets/file_view_js.html similarity index 100% rename from templates/snippets/file_view_js.html rename to seahub/templates/snippets/file_view_js.html diff --git a/templates/snippets/file_view_style.html b/seahub/templates/snippets/file_view_style.html similarity index 100% rename from templates/snippets/file_view_style.html rename to seahub/templates/snippets/file_view_style.html diff --git a/templates/snippets/group_add_js.html b/seahub/templates/snippets/group_add_js.html similarity index 100% rename from templates/snippets/group_add_js.html rename to seahub/templates/snippets/group_add_js.html diff --git a/templates/snippets/group_recommend_form.html b/seahub/templates/snippets/group_recommend_form.html similarity index 100% rename from templates/snippets/group_recommend_form.html rename to seahub/templates/snippets/group_recommend_form.html diff --git a/templates/snippets/list_commit_detail.html b/seahub/templates/snippets/list_commit_detail.html similarity index 100% rename from templates/snippets/list_commit_detail.html rename to seahub/templates/snippets/list_commit_detail.html diff --git a/templates/snippets/my_groups.html b/seahub/templates/snippets/my_groups.html similarity index 100% rename from templates/snippets/my_groups.html rename to seahub/templates/snippets/my_groups.html diff --git a/templates/snippets/my_owned_repos.html b/seahub/templates/snippets/my_owned_repos.html similarity index 100% rename from templates/snippets/my_owned_repos.html rename to seahub/templates/snippets/my_owned_repos.html diff --git a/templates/snippets/myhome_extra_script.html b/seahub/templates/snippets/myhome_extra_script.html similarity index 100% rename from templates/snippets/myhome_extra_script.html rename to seahub/templates/snippets/myhome_extra_script.html diff --git a/templates/snippets/pubinfo.html b/seahub/templates/snippets/pubinfo.html similarity index 100% rename from templates/snippets/pubinfo.html rename to seahub/templates/snippets/pubinfo.html diff --git a/templates/snippets/repo_create_form.html b/seahub/templates/snippets/repo_create_form.html similarity index 100% rename from templates/snippets/repo_create_form.html rename to seahub/templates/snippets/repo_create_form.html diff --git a/templates/snippets/repo_create_js.html b/seahub/templates/snippets/repo_create_js.html similarity index 100% rename from templates/snippets/repo_create_js.html rename to seahub/templates/snippets/repo_create_js.html diff --git a/templates/snippets/repo_decrypt_js.html b/seahub/templates/snippets/repo_decrypt_js.html similarity index 100% rename from templates/snippets/repo_decrypt_js.html rename to seahub/templates/snippets/repo_decrypt_js.html diff --git a/templates/snippets/repo_group_list.html b/seahub/templates/snippets/repo_group_list.html similarity index 100% rename from templates/snippets/repo_group_list.html rename to seahub/templates/snippets/repo_group_list.html diff --git a/templates/snippets/repo_share_form.html b/seahub/templates/snippets/repo_share_form.html similarity index 100% rename from templates/snippets/repo_share_form.html rename to seahub/templates/snippets/repo_share_form.html diff --git a/templates/snippets/shared_link_js.html b/seahub/templates/snippets/shared_link_js.html similarity index 100% rename from templates/snippets/shared_link_js.html rename to seahub/templates/snippets/shared_link_js.html diff --git a/templates/snippets/user_profile_html.html b/seahub/templates/snippets/user_profile_html.html similarity index 100% rename from templates/snippets/user_profile_html.html rename to seahub/templates/snippets/user_profile_html.html diff --git a/templates/snippets/user_profile_js.html b/seahub/templates/snippets/user_profile_js.html similarity index 100% rename from templates/snippets/user_profile_js.html rename to seahub/templates/snippets/user_profile_js.html diff --git a/templates/sys_group_admin.html b/seahub/templates/sys_group_admin.html similarity index 100% rename from templates/sys_group_admin.html rename to seahub/templates/sys_group_admin.html diff --git a/templates/sys_org_admin.html b/seahub/templates/sys_org_admin.html similarity index 100% rename from templates/sys_org_admin.html rename to seahub/templates/sys_org_admin.html diff --git a/templates/sys_seafadmin.html b/seahub/templates/sys_seafadmin.html similarity index 100% rename from templates/sys_seafadmin.html rename to seahub/templates/sys_seafadmin.html diff --git a/templates/sys_useradmin.html b/seahub/templates/sys_useradmin.html similarity index 100% rename from templates/sys_useradmin.html rename to seahub/templates/sys_useradmin.html diff --git a/templates/text_diff.html b/seahub/templates/text_diff.html similarity index 100% rename from templates/text_diff.html rename to seahub/templates/text_diff.html diff --git a/templates/update_file_error.html b/seahub/templates/update_file_error.html similarity index 100% rename from templates/update_file_error.html rename to seahub/templates/update_file_error.html diff --git a/templates/upload_file_error.html b/seahub/templates/upload_file_error.html similarity index 100% rename from templates/upload_file_error.html rename to seahub/templates/upload_file_error.html diff --git a/templates/user_add_email.html b/seahub/templates/user_add_email.html similarity index 100% rename from templates/user_add_email.html rename to seahub/templates/user_add_email.html diff --git a/templates/user_reset_email.html b/seahub/templates/user_reset_email.html similarity index 100% rename from templates/user_reset_email.html rename to seahub/templates/user_reset_email.html diff --git a/templates/userinfo.html b/seahub/templates/userinfo.html similarity index 100% rename from templates/userinfo.html rename to seahub/templates/userinfo.html diff --git a/templates/view_file_3d.html b/seahub/templates/view_file_3d.html similarity index 100% rename from templates/view_file_3d.html rename to seahub/templates/view_file_3d.html diff --git a/templates/view_file_audio.html b/seahub/templates/view_file_audio.html similarity index 100% rename from templates/view_file_audio.html rename to seahub/templates/view_file_audio.html diff --git a/templates/view_file_base.html b/seahub/templates/view_file_base.html similarity index 100% rename from templates/view_file_base.html rename to seahub/templates/view_file_base.html diff --git a/templates/view_file_document.html b/seahub/templates/view_file_document.html similarity index 100% rename from templates/view_file_document.html rename to seahub/templates/view_file_document.html diff --git a/templates/view_file_image.html b/seahub/templates/view_file_image.html similarity index 100% rename from templates/view_file_image.html rename to seahub/templates/view_file_image.html diff --git a/templates/view_file_markdown.html b/seahub/templates/view_file_markdown.html similarity index 100% rename from templates/view_file_markdown.html rename to seahub/templates/view_file_markdown.html diff --git a/templates/view_file_pdf.html b/seahub/templates/view_file_pdf.html similarity index 100% rename from templates/view_file_pdf.html rename to seahub/templates/view_file_pdf.html diff --git a/templates/view_file_sf.html b/seahub/templates/view_file_sf.html similarity index 100% rename from templates/view_file_sf.html rename to seahub/templates/view_file_sf.html diff --git a/templates/view_file_svg.html b/seahub/templates/view_file_svg.html similarity index 100% rename from templates/view_file_svg.html rename to seahub/templates/view_file_svg.html diff --git a/templates/view_file_text.html b/seahub/templates/view_file_text.html similarity index 100% rename from templates/view_file_text.html rename to seahub/templates/view_file_text.html diff --git a/templates/view_file_unknown.html b/seahub/templates/view_file_unknown.html similarity index 100% rename from templates/view_file_unknown.html rename to seahub/templates/view_file_unknown.html diff --git a/templates/view_file_video.html b/seahub/templates/view_file_video.html similarity index 100% rename from templates/view_file_video.html rename to seahub/templates/view_file_video.html diff --git a/templates/view_history_file.html b/seahub/templates/view_history_file.html similarity index 100% rename from templates/view_history_file.html rename to seahub/templates/view_history_file.html diff --git a/templates/view_shared_dir.html b/seahub/templates/view_shared_dir.html similarity index 100% rename from templates/view_shared_dir.html rename to seahub/templates/view_shared_dir.html diff --git a/templates/view_snapshot_file.html b/seahub/templates/view_snapshot_file.html similarity index 100% rename from templates/view_snapshot_file.html rename to seahub/templates/view_snapshot_file.html diff --git a/templates/view_trash_file.html b/seahub/templates/view_trash_file.html similarity index 100% rename from templates/view_trash_file.html rename to seahub/templates/view_trash_file.html diff --git a/templates/wiki/personal_wiki.html b/seahub/templates/wiki/personal_wiki.html similarity index 100% rename from templates/wiki/personal_wiki.html rename to seahub/templates/wiki/personal_wiki.html diff --git a/templates/wiki/personal_wiki_pages.html b/seahub/templates/wiki/personal_wiki_pages.html similarity index 100% rename from templates/wiki/personal_wiki_pages.html rename to seahub/templates/wiki/personal_wiki_pages.html diff --git a/urls.py b/seahub/urls.py similarity index 94% rename from urls.py rename to seahub/urls.py index 9d6af8b68b..8234cca9c7 100644 --- a/urls.py +++ b/seahub/urls.py @@ -1,6 +1,6 @@ from django.conf.urls.defaults import * from django.conf import settings -from django.views.generic.simple import direct_to_template +# from django.views.generic.simple import direct_to_template from seahub.views import * from seahub.views.file import view_file, view_history_file, view_trash_file,\ @@ -28,7 +28,7 @@ urlpatterns = patterns('', # Uncomment the next line to enable the admin: #(r'^admin/', include(admin.site.urls)), - (r'^accounts/', include('base.registration_urls')), + (r'^accounts/', include('seahub.base.registration_urls')), (r'^$', root), #url(r'^home/$', direct_to_template, { 'template': 'home.html' } ), @@ -97,20 +97,20 @@ urlpatterns = patterns('', url(r'^useradmin/password/reset/(?P[^/]+)/$', user_reset, name='user_reset'), ### Apps ### - (r'^api2/', include('api2.urls')), - (r'^avatar/', include('avatar.urls')), - (r'^notification/', include('notifications.urls')), - url(r'^sys/notificationadmin/', notification_list, name='notification_list'), - (r'^contacts/', include('contacts.urls')), + (r'^api2/', include('seahub.api2.urls')), + (r'^avatar/', include('seahub.avatar.urls')), + (r'^notification/', include('seahub.notifications.urls')), + (r'^contacts/', include('seahub.contacts.urls')), (r'^group/', include('seahub.group.urls')), url(r'^groups/', group_list, name='group_list'), (r'^profile/', include('seahub.profile.urls')), - (r'^share/', include('share.urls')), + (r'^share/', include('seahub.share.urls')), ### system admin ### (r'^sys/seafadmin/$', sys_seafadmin), url(r'^sys/useradmin/$', sys_useradmin, name='sys_useradmin'), url(r'^sys/orgadmin/$', sys_org_admin, name='sys_org_admin'), + url(r'^sys/notificationadmin/', notification_list, name='notification_list'), url(r'^sys/groupadmin/$', sys_group_admin, name='sys_group_admin'), ) diff --git a/utils/__init__.py b/seahub/utils/__init__.py similarity index 99% rename from utils/__init__.py rename to seahub/utils/__init__.py index 0903dc050a..cbf12e8e14 100644 --- a/utils/__init__.py +++ b/seahub/utils/__init__.py @@ -29,12 +29,13 @@ from seaserv import seafserv_rpc, ccnet_threaded_rpc, seafserv_threaded_rpc, \ get_personal_groups_by_user, list_personal_repos_by_owner, get_group_repos, \ list_org_repos_by_owner, get_org_groups_by_user, check_permission, \ list_inner_pub_repos, list_org_inner_pub_repos +from seahub import settings try: - from settings import DOCUMENT_CONVERTOR_ROOT + from seahub.settings import DOCUMENT_CONVERTOR_ROOT except ImportError: DOCUMENT_CONVERTOR_ROOT = None try: - from settings import EMAIL_HOST + from seahub.settings import EMAIL_HOST IS_EMAIL_CONFIGURED = True except ImportError: IS_EMAIL_CONFIGURED = False @@ -43,7 +44,6 @@ try: except ImportError: CLOUD_MODE = False -import settings from file_types import * # Get an instance of a logger @@ -868,4 +868,4 @@ def mkstemp(): return fd, path_utf8 # Move to here to avoid circular import. -from base.models import FileContributors, UserStarredFiles, DirFilesLastModifiedInfo, FileLastModifiedInfo +from seahub.base.models import FileContributors, UserStarredFiles, DirFilesLastModifiedInfo, FileLastModifiedInfo diff --git a/utils/file_types.py b/seahub/utils/file_types.py similarity index 100% rename from utils/file_types.py rename to seahub/utils/file_types.py diff --git a/utils/htmldiff.py b/seahub/utils/htmldiff.py similarity index 100% rename from utils/htmldiff.py rename to seahub/utils/htmldiff.py diff --git a/utils/paginator.py b/seahub/utils/paginator.py similarity index 100% rename from utils/paginator.py rename to seahub/utils/paginator.py diff --git a/utils/repo.py b/seahub/utils/repo.py similarity index 100% rename from utils/repo.py rename to seahub/utils/repo.py diff --git a/utils/search.py b/seahub/utils/search.py similarity index 100% rename from utils/search.py rename to seahub/utils/search.py diff --git a/utils/slugify/__init__.py b/seahub/utils/slugify/__init__.py similarity index 100% rename from utils/slugify/__init__.py rename to seahub/utils/slugify/__init__.py diff --git a/views/__init__.py b/seahub/views/__init__.py similarity index 99% rename from views/__init__.py rename to seahub/views/__init__.py index 037673b24b..9e2226037d 100644 --- a/views/__init__.py +++ b/seahub/views/__init__.py @@ -1,5 +1,4 @@ # encoding: utf-8 -import settings import os import stat import simplejson as json @@ -74,6 +73,7 @@ from seahub.utils import render_permission_error, render_error, list_to_string, get_dir_files_last_modified, show_delete_days, HtmlDiff, \ TRAFFIC_STATS_ENABLED, get_user_traffic_stat from seahub.utils.paginator import get_page_range +import seahub.settings try: from seahub.settings import DOCUMENT_CONVERTOR_ROOT if DOCUMENT_CONVERTOR_ROOT[-1:] != '/': diff --git a/views/file.py b/seahub/views/file.py similarity index 99% rename from views/file.py rename to seahub/views/file.py index f9a8a7be03..45ffbb4210 100644 --- a/views/file.py +++ b/seahub/views/file.py @@ -28,10 +28,10 @@ from seaserv import list_dir_by_path, get_repo, web_get_access_token, \ from pysearpc import SearpcError from auth.decorators import login_required -from base.decorators import repo_passwd_set_required -from base.models import UuidObjidMap -from contacts.models import Contact -from share.models import FileShare +from seahub.base.decorators import repo_passwd_set_required +from seahub.base.models import UuidObjidMap +from seahub.contacts.models import Contact +from seahub.share.models import FileShare from seahub.wiki.utils import get_wiki_dirent from seahub.wiki.models import WikiDoesNotExist, WikiPageMissing from seahub.utils import get_httpserver_root, show_delete_days, render_error, \ diff --git a/views/repo.py b/seahub/views/repo.py similarity index 98% rename from views/repo.py rename to seahub/views/repo.py index 393d78413c..f2fd17e532 100644 --- a/views/repo.py +++ b/seahub/views/repo.py @@ -10,9 +10,9 @@ from seaserv import server_repo_size, is_passwd_set, get_commits, get_repo, \ check_quota, MAX_UPLOAD_FILE_SIZE, web_get_access_token, is_repo_owner, \ is_org_repo_owner, get_repo_history_limit, get_commit -from base.mixins import LoginRequiredMixin -from contacts.models import Contact -from share.models import FileShare +from seahub.base.mixins import LoginRequiredMixin +from seahub.contacts.models import Contact +from seahub.share.models import FileShare from seahub.forms import RepoPassowrdForm from seahub.views import gen_path_link, get_user_permission, get_repo_dirents from seahub.utils import get_ccnetapplet_root, get_accessible_repos, \ diff --git a/views/search.py b/seahub/views/search.py similarity index 100% rename from views/search.py rename to seahub/views/search.py diff --git a/views/wiki.py b/seahub/views/wiki.py similarity index 100% rename from views/wiki.py rename to seahub/views/wiki.py diff --git a/wiki/__init__.py b/seahub/wiki/__init__.py similarity index 100% rename from wiki/__init__.py rename to seahub/wiki/__init__.py diff --git a/wiki/forms.py b/seahub/wiki/forms.py similarity index 100% rename from wiki/forms.py rename to seahub/wiki/forms.py diff --git a/wiki/models.py b/seahub/wiki/models.py similarity index 100% rename from wiki/models.py rename to seahub/wiki/models.py diff --git a/wiki/utils.py b/seahub/wiki/utils.py similarity index 100% rename from wiki/utils.py rename to seahub/wiki/utils.py diff --git a/seahub/wsgi.py b/seahub/wsgi.py new file mode 100644 index 0000000000..bed0cfcb73 --- /dev/null +++ b/seahub/wsgi.py @@ -0,0 +1,28 @@ +""" +WSGI config for seahub project. + +This module contains the WSGI application used by Django's development server +and any production WSGI deployments. It should expose a module-level variable +named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover +this application via the ``WSGI_APPLICATION`` setting. + +Usually you will have the standard Django WSGI application here, but it also +might make sense to replace the whole Django WSGI application with a custom one +that later delegates to the Django one. For example, you could introduce WSGI +middleware here, or combine a Django application with an application of another +framework. + +""" +import os + +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "seahub.settings") + +# This application object is used by any WSGI server configured to use this +# file. This includes Django's development server, if the WSGI_APPLICATION +# setting points here. +from django.core.wsgi import get_wsgi_application +application = get_wsgi_application() + +# Apply WSGI middleware here. +# from helloworld.wsgi import HelloWorldApplication +# application = HelloWorldApplication(application)