Merge pull request #301 from kiwix/remove-trailing-spaces

Remove trailing spaces
This commit is contained in:
Kelson 2019-12-08 12:07:21 +01:00 committed by GitHub
commit bb55527508
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 22 additions and 22 deletions

View File

@ -77,7 +77,7 @@ modification follow.
"Copyright" also means copyright-like laws that apply to other kinds of "Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks. works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this "The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations. "recipients" may be individuals or organizations.
@ -510,7 +510,7 @@ actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid. country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties covered work, and grant a patent license to some of the parties

View File

@ -64,14 +64,14 @@ class Entry
* @return the path of the entry. * @return the path of the entry.
*/ */
std::string getPath() const; std::string getPath() const;
/** /**
* Get the title of the entry. * Get the title of the entry.
* *
* @return the title of the entry. * @return the title of the entry.
*/ */
std::string getTitle() const; std::string getTitle() const;
/** /**
* Get the content of the entry. * Get the content of the entry.
* *
@ -81,7 +81,7 @@ class Entry
* @return the content of the entry. * @return the content of the entry.
*/ */
std::string getContent() const; std::string getContent() const;
/** /**
* Get the blob of the entry. * Get the blob of the entry.
* *
@ -91,7 +91,7 @@ class Entry
* @return the blob of the entry. * @return the blob of the entry.
*/ */
zim::Blob getBlob(offset_type offset = 0) const; zim::Blob getBlob(offset_type offset = 0) const;
/** /**
* Get the blob of the entry. * Get the blob of the entry.
* *
@ -102,7 +102,7 @@ class Entry
* @return the blob of the entry. * @return the blob of the entry.
*/ */
zim::Blob getBlob(offset_type offset, size_type size) const; zim::Blob getBlob(offset_type offset, size_type size) const;
/** /**
* Get the info for direct access to the content of the entry. * Get the info for direct access to the content of the entry.
* *
@ -118,7 +118,7 @@ class Entry
* Return <"",0> if is not possible to read directly. * Return <"",0> if is not possible to read directly.
*/ */
std::pair<std::string, offset_type> getDirectAccessInfo() const; std::pair<std::string, offset_type> getDirectAccessInfo() const;
/** /**
* Get the size of the entry. * Get the size of the entry.
* *
@ -132,8 +132,8 @@ class Entry
* @return the mime_type of the entry. * @return the mime_type of the entry.
*/ */
std::string getMimetype() const; std::string getMimetype() const;
/** /**
* Get if the entry is a redirect entry. * Get if the entry is a redirect entry.
* *

View File

@ -81,12 +81,12 @@ class Resource:
data_identifier="_".join([""]+self.identifier), data_identifier="_".join([""]+self.identifier),
resource_content=",\n ".join(", ".join("{:#04x}".format(i) for i in r) for r in sliced), resource_content=",\n ".join(", ".join("{:#04x}".format(i) for i in r) for r in sliced),
resource_len=len(self.data), resource_len=len(self.data),
namespaces_open=" ".join("namespace {} {{".format(id) for id in self.identifier[:-1]), namespaces_open=" ".join("namespace {} {{".format(id) for id in self.identifier[:-1]),
namespaces_close=" ".join(["}"]*(len(self.identifier)-1)), namespaces_close=" ".join(["}"]*(len(self.identifier)-1)),
identifier=self.identifier[-1], identifier=self.identifier[-1],
env_identifier="RES_"+"_".join(self.identifier)+"_PATH" env_identifier="RES_"+"_".join(self.identifier)+"_PATH"
) )
def dump_getter(self): def dump_getter(self):
return resource_getter_template.format( return resource_getter_template.format(
common_name=self.filename, common_name=self.filename,
@ -95,11 +95,11 @@ class Resource:
def dump_decl(self): def dump_decl(self):
return resource_decl_template.format( return resource_decl_template.format(
namespaces_open=" ".join("namespace {} {{".format(id) for id in self.identifier[:-1]), namespaces_open=" ".join("namespace {} {{".format(id) for id in self.identifier[:-1]),
namespaces_close=" ".join(["}"]*(len(self.identifier)-1)), namespaces_close=" ".join(["}"]*(len(self.identifier)-1)),
identifier=self.identifier[-1] identifier=self.identifier[-1]
) )
master_c_template = """//This file is automaically generated. Do not modify it. master_c_template = """//This file is automaically generated. Do not modify it.
@ -113,7 +113,7 @@ static std::string init_resource(const char* name, const unsigned char* content,
char * resPath = getenv(name); char * resPath = getenv(name);
if (NULL == resPath) if (NULL == resPath)
return std::string(reinterpret_cast<const char*>(content), len); return std::string(reinterpret_cast<const char*>(content), len);
std::ifstream ifs(resPath); std::ifstream ifs(resPath);
if (!ifs.good()) if (!ifs.good())
return std::string(reinterpret_cast<const char*>(content), len); return std::string(reinterpret_cast<const char*>(content), len);
@ -137,7 +137,7 @@ def gen_c_file(resources, basename):
include_file=basename, include_file=basename,
basename=to_identifier(basename) basename=to_identifier(basename)
) )
master_h_template = """//This file is automaically generated. Do not modify it. master_h_template = """//This file is automaically generated. Do not modify it.

View File

@ -140,7 +140,7 @@ int Response::send(const RequestContext& request, MHD_Connection* connection)
bool shouldCompress = m_compress && request.can_compress(); bool shouldCompress = m_compress && request.can_compress();
shouldCompress &= m_mimeType.find("text/") != string::npos shouldCompress &= m_mimeType.find("text/") != string::npos
|| m_mimeType.find("application/javascript") != string::npos || m_mimeType.find("application/javascript") != string::npos
|| m_mimeType.find("application/json") != string::npos; || m_mimeType.find("application/json") != string::npos;
shouldCompress &= (m_content.size() > KIWIX_MIN_CONTENT_SIZE_TO_DEFLATE); shouldCompress &= (m_content.size() > KIWIX_MIN_CONTENT_SIZE_TO_DEFLATE);

View File

@ -1,4 +1,4 @@
/* /*
base64.cpp and base64.h base64.cpp and base64.h
Copyright (C) 2004-2008 René Nyffenegger Copyright (C) 2004-2008 René Nyffenegger
@ -27,7 +27,7 @@
#include <tools/base64.h> #include <tools/base64.h>
#include <iostream> #include <iostream>
static const std::string base64_chars = static const std::string base64_chars =
"ABCDEFGHIJKLMNOPQRSTUVWXYZ" "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"abcdefghijklmnopqrstuvwxyz" "abcdefghijklmnopqrstuvwxyz"
"0123456789+/"; "0123456789+/";

View File

@ -2,7 +2,7 @@
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"> <OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
<ShortName>Zim catalog search</ShortName> <ShortName>Zim catalog search</ShortName>
<Description>Search zim files in the catalog.</Description> <Description>Search zim files in the catalog.</Description>
<Url type="application/atom+xml;profile=opds-catalog" <Url type="application/atom+xml;profile=opds-catalog"
xmlns:atom="http://www.w3.org/2005/Atom" xmlns:atom="http://www.w3.org/2005/Atom"
indexOffset="0" indexOffset="0"
template="/{{root}}/catalog/search?q={searchTerms}&lang={language}&count={count}&start={startIndex}"/> template="/{{root}}/catalog/search?q={searchTerms}&lang={language}&count={count}&start={startIndex}"/>

View File

@ -8,7 +8,7 @@ TEST(KiwixServeTest, PortTest)
kiwixServe.setPort(8484); kiwixServe.setPort(8484);
EXPECT_EQ(kiwixServe.getPort(), 8484); EXPECT_EQ(kiwixServe.getPort(), 8484);
EXPECT_EQ(kiwixServe.setPort(0), -1); EXPECT_EQ(kiwixServe.setPort(0), -1);
EXPECT_EQ(kiwixServe.setPort(3456789), -1); EXPECT_EQ(kiwixServe.setPort(3456789), -1);
} }
int main(int argc, char** argv) int main(int argc, char** argv)

View File

@ -202,7 +202,7 @@ class LibraryTest : public ::testing::Test {
}; };
TEST_F(LibraryTest, getBookMarksTest) TEST_F(LibraryTest, getBookMarksTest)
{ {
auto bookId1 = lib.getBooksIds()[0]; auto bookId1 = lib.getBooksIds()[0];
auto bookId2 = lib.getBooksIds()[1]; auto bookId2 = lib.getBooksIds()[1];