Skip to content

Commit

Permalink
Merge branch 'master' into 11094_eradicate_coverity_issues_in_appwindow
Browse files Browse the repository at this point in the history
Refs #11094
  • Loading branch information
Harry Jeffery committed Feb 17, 2015
2 parents 0cb4e3d + 4a3df67 commit ce2d241
Show file tree
Hide file tree
Showing 29 changed files with 406 additions and 2,595 deletions.
Expand Up @@ -3,7 +3,7 @@ Version: 1.2.3
Section: main
Priority: optional
Architecture: all
Depends: git, clang, cmake-qt-gui(>=2.8.12), qt4-qmake, qt4-dev-tools, libqt4-dbg, libpoco-dev(>=1.4.2), libboost-all-dev, libboost-dbg, libnexus0-dev, libgoogle-perftools-dev, libqwt5-qt4-dev, libqwtplot3d-qt4-dev, python-qt4-dev, libgsl0-dev, liboce-visualization-dev, libmuparser-dev, python-numpy, libssl-dev, libqscintilla2-dev, texlive,texlive-latex-extra, dvipng, libhdf4-dev, doxygen, python-sphinx, python-scipy, ipython-qtconsole (>=1.2.0), libhdf5-dev, libhdf4-dev, libpococrypto11-dbg, libpocodata11-dbg, libpocofoundation11-dbg, libpocomysql11-dbg, libpoconet11-dbg, libpoconetssl11-dbg, libpocoodbc11-dbg, libpocosqlite11-dbg, libpocoutil11-dbg, libpocoxml11-dbg, libpocozip11-dbg, python-qt4-dbg, qt4-default, ninja-build, libjsoncpp-dev, python-dateutil
Depends: git, clang, cmake-qt-gui(>=2.8.12), qt4-qmake, qt4-dev-tools, libqt4-dbg, libpoco-dev(>=1.4.2), libboost-all-dev, libboost-dbg, libnexus0-dev, libgoogle-perftools-dev, libqwt5-qt4-dev, libqwtplot3d-qt4-dev, python-qt4-dev, libgsl0-dev, liboce-visualization-dev, libmuparser-dev, python-numpy, libssl-dev, libqscintilla2-dev, texlive, texlive-latex-extra, dvipng, libhdf4-dev, doxygen, python-sphinx, python-scipy, ipython-qtconsole (>=1.2.0), libhdf5-dev, libhdf4-dev, libpococrypto11-dbg, libpocodata11-dbg, libpocofoundation11-dbg, libpocomysql11-dbg, libpoconet11-dbg, libpoconetssl11-dbg, libpocoodbc11-dbg, libpocosqlite11-dbg, libpocoutil11-dbg, libpocoxml11-dbg, libpocozip11-dbg, python-qt4-dbg, qt4-default, ninja-build, libjsoncpp-dev, python-dateutil, python-sphinx-bootstrap-theme
Installed-Size: 0
Maintainer: Mantid Project <mantid-help@mantidproject.org>
Description: Installs all packages required for a Mantid developer
Expand Down
10 changes: 5 additions & 5 deletions Code/Mantid/CMakeLists.txt
Expand Up @@ -197,8 +197,8 @@ if ( ENABLE_CPACK )

set ( CPACK_RPM_PACKAGE_REQUIRES "${CPACK_RPM_PACKAGE_REQUIRES},poco-crypto,poco-data,poco-mysql,poco-sqlite,poco-odbc,poco-util,poco-xml,poco-zip,poco-net,poco-netssl,poco-foundation,PyQt4,sip" )
set ( CPACK_RPM_PACKAGE_REQUIRES "${CPACK_RPM_PACKAGE_REQUIRES},python-ipython >= 1.1.0" )
# scipy, matplotlib, psutil
set ( CPACK_RPM_PACKAGE_REQUIRES "${CPACK_RPM_PACKAGE_REQUIRES},scipy,python-matplotlib,python-psutil" )
# scipy & matplotlib
set ( CPACK_RPM_PACKAGE_REQUIRES "${CPACK_RPM_PACKAGE_REQUIRES},scipy,python-matplotlib" )
set ( CPACK_RPM_PACKAGE_REQUIRES "${CPACK_RPM_PACKAGE_REQUIRES},mxml,hdf,hdf5,jsoncpp" )

if( "${UNIX_CODENAME}" MATCHES "Santiago" )
Expand Down Expand Up @@ -226,19 +226,19 @@ if ( ENABLE_CPACK )
set ( PERFTOOLS_DEB_PACKAGE "libgoogle-perftools0 (>= 1.7)" )
if( "${UNIX_CODENAME}" MATCHES "lucid" )
list ( APPEND DEPENDS_LIST ",libqscintilla2-5,"
"libopencascade-foundation-6.3.0 (>= 6.3.0),libopencascade-modeling-6.3.0 (>= 6.3.0),python-psutil,"
"libopencascade-foundation-6.3.0 (>= 6.3.0),libopencascade-modeling-6.3.0 (>= 6.3.0),"
"libmuparser0,libpocofoundation9,libpocoutil9,libpoconet9,libpoconetssl9,libpococrypto9,libpocoxml9" )
elseif( "${UNIX_CODENAME}" MATCHES "precise" )
list ( APPEND DEPENDS_LIST ",libqscintilla2-8,"
"libopencascade-foundation-6.5.0 (>= 6.5.0),libopencascade-modeling-6.5.0 (>= 6.5.0),"
"libmuparser0debian1,"
"ipython-qtconsole (>= 1.1),python-matplotlib,python-scipy,python-psutil,"
"ipython-qtconsole (>= 1.1),python-matplotlib,python-scipy,"
"libpocofoundation9,libpocoutil9,libpoconet9,libpoconetssl9,libpococrypto9,libpocoxml9")
elseif( "${UNIX_CODENAME}" STREQUAL "trusty" )
list ( APPEND DEPENDS_LIST ",libqscintilla2-11,"
"liboce-foundation8,liboce-modeling8,"
"libmuparser2,"
"ipython-qtconsole (>= 1.1),python-matplotlib,python-scipy,python-psutil,"
"ipython-qtconsole (>= 1.1),python-matplotlib,python-scipy,"
"libpocofoundation11,libpocoutil11,libpoconet11,libpoconetssl11,libpococrypto11,libpocoxml11")
set ( PERFTOOLS_DEB_PACKAGE "libgoogle-perftools4 (>= 1.7)" )
else()
Expand Down
Expand Up @@ -349,7 +349,8 @@ int DownloadInstrument::doDownloadFile(const std::string &urlFile,
const StringToStringMap &headers) {
int retStatus = 0;
InternetHelper inetHelper;
retStatus = inetHelper.downloadFile(urlFile, localFilePath, headers);
inetHelper.headers() = headers;
retStatus = inetHelper.downloadFile(urlFile, localFilePath);
return retStatus;
}

Expand Down
51 changes: 40 additions & 11 deletions Code/Mantid/Framework/Kernel/inc/MantidKernel/InternetHelper.h
Expand Up @@ -6,6 +6,8 @@
#include "MantidKernel/ProxyInfo.h"

#include <map>
#include <iostream>
#include <sstream>

namespace Poco {
// forward declaration
Expand All @@ -18,6 +20,8 @@ class HTTPClientSession;
class HTTPResponse;
// forward declaration
class HTTPRequest;
// forward declaration
class HTMLForm;
}
}

Expand Down Expand Up @@ -59,21 +63,44 @@ class MANTID_KERNEL_DLL InternetHelper {
// Convenience typedef
typedef std::map<std::string, std::string> StringToStringMap;

virtual int
downloadFile(const std::string &urlFile,
const std::string &localFilePath = "",
const StringToStringMap &headers = StringToStringMap());
virtual int
sendRequest(const std::string &url, std::ostream &responseStream,
const StringToStringMap &headers = StringToStringMap(),
const std::string &method = std::string(),
const std::string &body = std::string());
//getters and setters
void setTimeout(int seconds);
int getTimeout();

void setMethod(const std::string& method);
const std::string& getMethod();

void setContentType(const std::string& contentType);
const std::string& getContentType();

void setContentLength(std::streamsize length);
std::streamsize getContentLength();

void setBody(const std::string& body);
void setBody(const std::ostringstream& body);
void setBody(Poco::Net::HTMLForm& form);
const std::string getBody();


void addHeader(const std::string& key, const std::string& value);
void removeHeader (const std::string& key);
const std::string& getHeader (const std::string& key);
void clearHeaders();
StringToStringMap& headers();
void reset();


//Proxy methods
Kernel::ProxyInfo &getProxy(const std::string &url);
void clearProxy();
void setProxy(const Kernel::ProxyInfo &proxy);

void setTimeout(int seconds);
//Execute call methods
virtual int
downloadFile(const std::string &urlFile,
const std::string &localFilePath = "");
virtual int
sendRequest(const std::string &url, std::ostream &responseStream);

protected:
virtual int sendHTTPSRequest(const std::string &url,
Expand All @@ -91,12 +118,14 @@ class MANTID_KERNEL_DLL InternetHelper {
Poco::URI &uri, std::ostream &responseStream);
int processRelocation(const Poco::Net::HTTPResponse &response,
std::ostream &responseStream);

Kernel::ProxyInfo m_proxyInfo;
bool m_isProxySet;
int m_timeout;
std::streamsize m_contentLength;
std::string m_method;
std::string m_contentType;
std::string m_body;
std::ostringstream m_body;
StringToStringMap m_headers;
Poco::Net::HTTPRequest *m_request;
};
Expand Down

0 comments on commit ce2d241

Please sign in to comment.