From 0bcbfc2a3c634bb676cb22129aa292ca098fe702 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Aur=C3=A9lien=20Dunand?= <aurelien.dunand@smartjog.com>
Date: Fri, 29 Jul 2011 14:40:25 +0200
Subject: [PATCH] Fix typos and docstring bad format

---
 installsystems/database.py   |  3 ++-
 installsystems/image.py      |  2 +-
 installsystems/printer.py    |  8 ++++++--
 installsystems/repository.py | 14 +++++++-------
 installsystems/tarball.py    | 12 +++++++++---
 installsystems/tools.py      |  2 +-
 6 files changed, 26 insertions(+), 15 deletions(-)

diff --git a/installsystems/database.py b/installsystems/database.py
index 0d45a10..df02b95 100644
--- a/installsystems/database.py
+++ b/installsystems/database.py
@@ -16,7 +16,8 @@ from installsystems.tarball import Tarball
 from installsystems.printer import *
 
 class Database(object):
-    '''  Abstract repo database stuff
+    '''
+    Abstract repo database stuff
     It needs to be local cause of sqlite3 which need to open a file
     '''
 
diff --git a/installsystems/image.py b/installsystems/image.py
index b07f04e..494a8e8 100644
--- a/installsystems/image.py
+++ b/installsystems/image.py
@@ -615,7 +615,7 @@ class Payload(object):
     @property
     def info(self):
         '''
-        return a dict of info about current payload
+        Return a dict of info about current payload
         '''
         return {"md5": self.md5,
                 "size": self.size,
diff --git a/installsystems/printer.py b/installsystems/printer.py
index 90cee4b..fe05891 100644
--- a/installsystems/printer.py
+++ b/installsystems/printer.py
@@ -32,7 +32,9 @@ color = {
 _arrow_level = 1
 
 def out(message="", fd=sys.stdout, endl=os.linesep, flush=True):
-    '''Print message colorised in fd ended by endl'''
+    '''
+    Print message colorised in fd ended by endl
+    '''
     # color subsitution
     for c in color:
         message = message.replace("#%s#" % c, color[c])
@@ -42,7 +44,9 @@ def out(message="", fd=sys.stdout, endl=os.linesep, flush=True):
         fd.flush()
 
 def err(message, fd=sys.stderr, endl=os.linesep):
-    '''Print a message on stderr'''
+    '''
+    Print a message on stderr
+    '''
     out(message, fd, endl)
 
 def fatal(message, quit=True, fd=sys.stderr, endl=os.linesep):
diff --git a/installsystems/repository.py b/installsystems/repository.py
index 7fb0e71..5b90cd3 100644
--- a/installsystems/repository.py
+++ b/installsystems/repository.py
@@ -227,7 +227,7 @@ class Repository(object):
 
     def get(self, name, version):
         '''
-        return a image from a name and version
+        Return an image from a name and version
         '''
         # get file md5 from db
         r = self.db.ask("select md5 from image where name = ? and version = ? limit 1",
@@ -242,8 +242,8 @@ class Repository(object):
 
     def getmd5(self, name, version):
         '''
-        return a image md5 and payload md5 from name and version. Order matter !
-        image md5 will still be the first
+        Return an image md5 and payload md5 from name and version. Order matter !
+        Image md5 will still be the first
         '''
         # get file md5 from db
         a = self.db.ask("SELECT md5 FROM image WHERE name = ? AND version = ? LIMIT 1",
@@ -305,7 +305,7 @@ class RepositoryConfig(object):
     @property
     def lastpath(self):
         '''
-        return the last file complete path
+        Return the last file complete path
         '''
         if self._lastpath is None:
             return os.path.join(self.path, self.lastname)
@@ -321,7 +321,7 @@ class RepositoryConfig(object):
     @property
     def dbpath(self):
         '''
-        return the db complete path
+        Return the db complete path
         '''
         if self._dbpath is None:
             return os.path.join(self.path, self.dbname)
@@ -452,7 +452,7 @@ class RepositoryManager(object):
         # delete temporary files (used by db)
         for f in self.tempfiles:
             try:
-                debug("Removing temporaty db file %s" % f)
+                debug("Removing temporary db file %s" % f)
                 os.unlink(f)
             except OSError:
                 pass
@@ -466,7 +466,7 @@ class RepositoryManager(object):
 
     def __getitem__(self, key):
         '''
-        Return a repostiory by its possition in list
+        Return a repostiory by its position in list
         '''
         return self.repos[key]
 
diff --git a/installsystems/tarball.py b/installsystems/tarball.py
index cf8d52c..9b41f0c 100644
--- a/installsystems/tarball.py
+++ b/installsystems/tarball.py
@@ -14,7 +14,9 @@ import re
 
 class Tarball(tarfile.TarFile):
     def add_str(self, name, content, ftype, mode):
-        '''Add a string in memory as a file in tarball'''
+        '''
+        Add a string in memory as a file in tarball
+        '''
         ti = tarfile.TarInfo(name)
         ti.type = ftype
         ti.mode = mode
@@ -25,7 +27,9 @@ class Tarball(tarfile.TarFile):
         self.addfile(ti, StringIO.StringIO(content))
 
     def get_str(self, name):
-        '''Return a string from a filename in a tarball'''
+        '''
+        Return a string from a filename in a tarball
+        '''
         ti = self.getmember(name)
         return self.extractfile(ti).read()
 
@@ -38,7 +42,9 @@ class Tarball(tarfile.TarFile):
                      if re.match(reg_pattern, tpname) ]
 
     def size(self):
-        '''Return real (uncompressed) size of the tarball'''
+        '''
+        Return real (uncompressed) size of the tarball
+        '''
         total_sz = 0
         for ti in self.getmembers():
             total_sz += ti.size
diff --git a/installsystems/tools.py b/installsystems/tools.py
index 9f4575d..ec03eab 100644
--- a/installsystems/tools.py
+++ b/installsystems/tools.py
@@ -30,7 +30,7 @@ def md5sum(path=None, fileobj=None):
 
 def copyfileobj(sfile, dfile):
     '''
-    Copy data from sfile to dfile coputing length and md5 on the fly
+    Copy data from sfile to dfile computing length and md5 on the fly
     '''
     f_sum = hashlib.md5()
     f_len = 0
-- 
GitLab