Skip to content
This repository has been archived by the owner on Jan 5, 2019. It is now read-only.

Commit

Permalink
* set version to v0.4.2
Browse files Browse the repository at this point in the history
* update README
  • Loading branch information
jedie committed Jul 27, 2012
1 parent 4dacd47 commit cb8fec5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 51 deletions.
3 changes: 3 additions & 0 deletions README.creole
Expand Up @@ -51,6 +51,9 @@ Note: After South install, you must insert "south" in INSTALLED_APPS list in our

= history

* v0.4.2 - 27.07.2012
** Bugfix in info_page() page: Use RequestContext(), so that inherit template can use variables from context processors
** remove git timestamp from version string
* v0.4.1
** Bugfix to support sync with Firefox v3.6 - v5 (see: [[https://github.com/jedie/django-sync-server/issues/11]] )
* v0.4.0
Expand Down
53 changes: 2 additions & 51 deletions weave/__init__.py
Expand Up @@ -5,7 +5,7 @@
-build version string
@license: GNU GPL v3 or above, see LICENSE for more details.
@copyleft: 2010-2011 by the django-sync-server team, see AUTHORS for more details.
@copyleft: 2010-2012 by the django-sync-server team, see AUTHORS for more details.
"""


Expand All @@ -16,18 +16,14 @@
import warnings


__version__ = (0, 4, 1)
__version__ = (0, 4, 2)
__api__ = (1, 1)


VERSION_STRING = '.'.join(str(part) for part in __version__)
API_STRING = '.'.join(str(integer) for integer in __api__)


# Display get_git_hash() errors as warnings?
#VERBOSE = True
VERBOSE = False


class Logging(object):
"""
Expand All @@ -52,50 +48,5 @@ def emit(self, record):
get_logger = classmethod(get_logger)



def _error(msg):
if VERBOSE:
warnings.warn(msg)
return ""

def get_commit_timestamp(path=None):
if path is None:
path = os.path.abspath(os.path.dirname(__file__))

try:
process = subprocess.Popen(
# %ct: committer date, UNIX timestamp
["/usr/bin/git", "log", "--pretty=format:%ct", "-1", "HEAD"],
shell=False, cwd=path,
stdout=subprocess.PIPE, stderr=subprocess.PIPE,
)
except Exception, err:
return _error("Can't get git hash: %s" % err)

process.wait()
returncode = process.returncode
if returncode != 0:
return _error(
"Can't get git hash, returncode was: %r"
" - git stdout: %r"
" - git stderr: %r"
% (returncode, process.stdout.readline(), process.stderr.readline())
)

output = process.stdout.readline().strip()
try:
timestamp = int(output)
except Exception, err:
return _error("git log output is not a number, output was: %r" % output)

try:
return time.strftime(".%m%d", time.gmtime(timestamp))
except Exception, err:
return _error("can't convert %r to time string: %s" % (timestamp, err))


VERSION_STRING += get_commit_timestamp()


if __name__ == "__main__":
print VERSION_STRING

0 comments on commit cb8fec5

Please sign in to comment.