Package entropy :: Package services :: Package ugc :: Module interfaces :: Class Server

Class Server

source code


Instance Methods
 
__init__(self, connection_data, store_path, store_url='') source code
 
get_current_time(self) source code
 
cache_results(self) source code
 
get_cache_item_key(self, cache_item) source code
 
cache_result(self, cache_item, r) source code
 
get_cached_result(self, cache_item) source code
 
setup_store_path(self, path) source code
 
initialize_tables(self) source code
 
initialize_doctypes(self) source code
 
is_iddoctype_available(self, iddoctype) source code
 
is_pkgkey_available(self, key) source code
 
is_iddoc_available(self, iddoc) source code
 
insert_iddoctype(self, iddoctype, description, do_commit=False) source code
 
insert_pkgkey(self, key, do_commit=False) source code
 
insert_download(self, key, ddate, count=0, do_commit=False) source code
 
insert_entropy_branch(self, branch, do_commit=False) source code
 
insert_entropy_release_string(self, release_string, do_commit=False) source code
 
insert_entropy_ip_locations_id(self, ip_latitude, ip_longitude, do_commit=False) source code
 
handle_entropy_ip_locations_id(self, ip_addr) source code
 
update_download(self, iddownload, do_commit=False) source code
 
store_download_data(self, iddownloads, ip_addr, do_commit=False) source code
 
get_date(self) source code
 
get_datetime(self) source code
 
get_iddownload(self, key, ddate) source code
 
get_idkey(self, key) source code
 
get_iddoctype(self, iddoc) source code
 
get_entropy_branches_id(self, branch) source code
 
get_entropy_release_strings_id(self, release_string) source code
 
get_entropy_ip_locations_id(self, ip_latitude, ip_longitude) source code
 
get_pkgkey(self, idkey) source code
 
get_ugc_metadata(self, pkgkey) source code
 
get_ugc_keywords(self, iddoc) source code
 
get_ugc_metadata_doctypes(self, pkgkey, typeslist) source code
 
get_ugc_metadata_doctypes_by_identifiers(self, identifiers, typeslist) source code
 
get_ugc_metadata_by_identifiers(self, identifiers) source code
 
get_ugc_vote(self, pkgkey) source code
 
get_ugc_allvotes(self) source code
 
get_ugc_downloads(self, pkgkey) source code
 
get_ugc_alldownloads(self) source code
 
get_iddoc_userid(self, iddoc) source code
 
get_total_comments_count(self) source code
 
get_total_documents_count(self) source code
 
get_total_votes_count(self) source code
 
get_total_downloads_count(self) source code
 
get_user_score_ranking(self, userid) source code
 
get_users_scored_count(self) source code
 
is_user_score_available(self, userid) source code
 
calculate_user_score(self, userid) source code
 
update_user_score(self, userid) source code
 
get_user_score(self, userid) source code
 
get_users_score_ranking(self, offset=0, count=0) source code
 
get_user_votes_average(self, userid) source code
 
get_user_alldocs(self, userid) source code
 
get_user_docs(self, userid) source code
 
get_user_comments(self, userid) source code
 
get_user_votes(self, userid) source code
 
get_user_generic_doctype(self, userid, doctype, doctype_sql_cmp='=') source code
 
get_user_generic_doctype_count(self, userid, doctype, doctype_sql_cmp='=') source code
 
get_user_comments_count(self, userid) source code
 
get_user_docs_count(self, userid) source code
 
get_user_images_count(self, userid) source code
 
get_user_files_count(self, userid) source code
 
get_user_yt_videos_count(self, userid) source code
 
get_user_votes_count(self, userid) source code
 
get_user_stats(self, userid) source code
 
get_distribution_stats(self) source code
 
search_pkgkey_items(self, pkgkey_string, iddoctypes=None, results_offset=0, results_limit=30, order_by=None) source code
 
search_username_items(self, pkgkey_string, iddoctypes=None, results_offset=0, results_limit=30, order_by=None) source code
 
search_content_items(self, pkgkey_string, iddoctypes=None, results_offset=0, results_limit=30, order_by=None) source code
 
search_keyword_items(self, keyword_string, iddoctypes=None, results_offset=0, results_limit=30, order_by=None) source code
 
search_iddoc_item(self, iddoc_string, iddoctypes=None, results_offset=0, results_limit=30, order_by=None) source code
 
handle_pkgkey(self, key) source code
 
insert_flood_control_check(self, userid) source code
 
insert_generic_doc(self, idkey, userid, username, doc_type, data, title, description, keywords, do_commit=False) source code
 
insert_keywords(self, iddoc, keywords) source code
 
remove_keywords(self, iddoc) source code
 
insert_comment(self, pkgkey, userid, username, comment, title, keywords, do_commit=False) source code
 
edit_comment(self, iddoc, new_comment, new_title, new_keywords, do_commit=False) source code
 
remove_comment(self, iddoc) source code
 
do_vote(self, pkgkey, userid, vote, do_commit=False) source code
 
has_user_already_voted(self, pkgkey, userid) source code
 
do_downloads(self, pkgkeys, ip_addr=None, do_commit=False) source code
 
do_download_stats(self, branch, release_string, hw_hash, pkgkeys, ip_addr, do_commit=False) source code
 
do_entropy_hardware_usage_stats(self, entropy_distribution_usage_id, hw_hash) source code
 
is_entropy_hardware_usage_stats_available(self, entropy_distribution_usage_id) source code
 
is_user_ip_available_in_entropy_distribution_usage(self, ip_address) source code
 
insert_document(self, pkgkey, userid, username, text, title, description, keywords, doc_type=None, do_commit=False) source code
 
edit_document(self, iddoc, new_document, new_title, new_keywords, do_commit=False) source code
 
remove_document(self, iddoc) source code
 
scan_for_viruses(self, filepath) source code
 
insert_generic_file(self, pkgkey, userid, username, file_path, file_name, doc_type, title, description, keywords) source code
 
insert_image(self, pkgkey, userid, username, image_path, file_name, title, description, keywords) source code
 
insert_file(self, pkgkey, userid, username, file_path, file_name, title, description, keywords) source code
 
delete_image(self, iddoc) source code
 
delete_file(self, iddoc) source code
 
delete_generic_file(self, iddoc, doc_type) source code
 
insert_youtube_video(self, pkgkey, userid, username, video_path, file_name, title, description, keywords) source code
 
remove_youtube_video(self, iddoc) source code
 
get_youtube_service(self) source code

Inherited from skel.RemoteDatabase: check_connection, check_connection_data, column_in_table_exists, commit, connect, disconnect, execute_many, execute_query, execute_script, fetchall, fetchall2list, fetchall2set, fetchmany, fetchone, fetchone2list, fetchone2set, lastrowid, set_connection_data, table_exists

Class Variables
  SQL_TABLES = {'entropy_base': '\n CREATE TABLE `ent...
  VOTE_RANGE = [1, 2, 3, 4, 5]
  VIRUS_CHECK_EXEC = '/usr/bin/clamscan'
  VIRUS_CHECK_ARGS = []
  gdata = None
  YouTube = None
  YouTubeService = None
  entropy_docs_title_len = 512
  entropy_docs_description_len = 4000
  entropy_docs_keyword_len = 100
  COMMENTS_SCORE_WEIGHT = 5
  DOCS_SCORE_WEIGHT = 10
  VOTES_SCORE_WEIGHT = 2
  STATS_MAP = {'installer': 'installer'}
dependencies:...
Method Details

__init__(self, connection_data, store_path, store_url='')
(Constructor)

source code 
Overrides: skel.RemoteDatabase.__init__

Class Variable Details

SQL_TABLES

Value:
{'entropy_base': '''
            CREATE TABLE `entropy_base` (
            `idkey` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
            `key` VARCHAR( 255 )  collate utf8_bin NOT NULL,
            KEY `key` (`key`)
            );
        ''',
 'entropy_branches': '''
...

STATS_MAP


dependencies:
    dev-python/gdata

Value:
{'installer': 'installer'}