Package pamfax :: Package processors :: Class Common
[hide private]
[frames] | no frames]

Class Common

source code

Class encapsulating common actions for the PamFax API

Instance Methods [hide private]
 
__init__(self, api_credentials, http)
Instantiates the Common class
source code
 
get_current_settings(self)
Returns the current settings for timezone and currency.
source code
 
get_file(self, file_uuid)
Returns file content.
source code
 
get_geo_ip_information(self, ip)
Returns Geo information based on the given IP address (IPV4)
source code
 
get_page_preview(self, uuid, page_no, max_width=None, max_height=None)
Returns a preview page for a fax.
source code
 
list_constants(self)
DEPRECATED
source code
 
list_countries(self)
Returns all countries with their translated names and the default zone
source code
 
list_countries_for_zone(self, zone)
Returns all countries in the given zone
source code
 
list_currencies(self, code=None)
Returns the list of supported currencies.
source code
 
list_languages(self, min_percent_translated=None)
List all available languages.
source code
 
list_strings(self, ids, culture=None)
Returns a list of strings translated into the given language.
source code
 
list_supported_file_types(self)
Returns the supported file types for documents that can be faxed.
source code
 
list_timezones(self)
List all supported timezones
source code
 
list_versions(self)
Lists the current Versions.
source code
 
list_zones(self)
Returns price and price_pro for a given zone
source code
Method Details [hide private]

get_current_settings(self)

source code 

Returns the current settings for timezone and currency. This is the format/timezone ALL return values of the API are in. These are taken from the user (if logged in, the api user's settings or the current ip address)

get_file(self, file_uuid)

source code 

Returns file content.

Will return binary data and headers that give the filename and mimetype. Note: User identified by usertoken must be owner of the file or the owner must have shared this file to the requesting user. Share dependencies are resolved (dependend on the type) via the fax_inbox, fax_history_files or user_covers table.

Arguments: file_uuid -- The uuid of the file to get

get_geo_ip_information(self, ip)

source code 

Returns Geo information based on the given IP address (IPV4)

Arguments: ip -- the ip to get geo information off

get_page_preview(self, uuid, page_no, max_width=None, max_height=None)

source code 

Returns a preview page for a fax.

May be in progress, sent or from inbox.

Arguments: uuid -- The uuid of the fax to get preview for page_no -- Page number to get (1,2,...) max_width -- Maximum width in Pixel max_height -- Maximum height in Pixel

list_countries_for_zone(self, zone)

source code 

Returns all countries in the given zone

Result includes their translated names, countrycode and country-prefix.

Arguments: zone -- Zone of the country which is wanted (1-7)

list_currencies(self, code=None)

source code 

Returns the list of supported currencies.

Result contains convertion rates too. If code is given will only return the specified currency's information.

Keyword arguments: code -- CurrencyCode

list_languages(self, min_percent_translated=None)

source code 

List all available languages.

Result may be filtered tso that only languages are returned that are at least translated $min_percent_translated %

Keyward arguments: min_percent_translated -- the percentage value the languages have to be translated

list_strings(self, ids, culture=None)

source code 

Returns a list of strings translated into the given language.

Arguments: ids -- array of String identifiers. You may also pass a comma separated list as $ids[0] (ids[0]=BTN_YES,BTN_NO).

Keyword arguments: culture -- culture identifier, defaults to users culture. Accepts full culture-codes like en-US, de-DE and just a language code like en, de, ...

list_versions(self)

source code 

Lists the current Versions. Result contains versions for the PamFax Gadget, Client etc and returns the version and update url