Skip to content

Commit

Permalink
Use describe to get git version
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre GIRAUD committed Feb 13, 2017
1 parent a331245 commit 35c2aa6
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
10 changes: 10 additions & 0 deletions osmtm/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import bleach
import subprocess
import os
from pyramid.config import Configurator
from pyramid.authentication import AuthTktAuthenticationPolicy
from pyramid.authorization import ACLAuthorizationPolicy
Expand Down Expand Up @@ -27,11 +29,19 @@
scheduler.start()


try:
version = subprocess.check_output(['git', 'describe', '--always'],
cwd=os.path.dirname(__file__))
except Exception as e:
version = 'N/A'


def main(global_config, **settings):
""" This function returns a Pyramid WSGI application.
"""
settings['mako.directories'] = 'osmtm:templates'
load_local_settings(settings)
settings.update({'version': version})

engine = engine_from_config(settings, 'sqlalchemy.')
DBSession.configure(bind=engine)
Expand Down
16 changes: 4 additions & 12 deletions osmtm/templates/about.mako
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,10 @@
${_('Lead developer: Pierre GIRAUD (<a href="//www.camptocamp.com">Camptocamp</a>)')|n}
${_('with the help of <a href="https://github.com/hotosm/osm-tasking-manager2/graphs/contributors">other contributors</a>.') |n}
</p>
<%
from gitversion import determine_git_version
try:
ver = determine_git_version('.')
url = 'https://github.com/hotosm/osm-tasking-manager2/commit/' + ver.rsplit('.',1)[1]
txt = '<a href="%s">%s</a>' % (url, ver)
vertxt = '<h3>' + _('Version') + '</h3><p>' + txt + '</p>'
except:
vertxt = ''
%>
${vertxt |n}
<h3>${_('Version')}</h3>
<p>
${request.registry.settings['version']}
</p>
</div>
</div>
</div>
Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
'pyramid-exclog==0.7',
'httpretty',
'pygments',
'gitversion',
'APScheduler==3.0.3',
'python-oembed == 0.2.1',
'colour==0.1.2',
Expand Down

1 comment on commit 35c2aa6

@f123gh
Copy link

@f123gh f123gh commented on 35c2aa6 Sep 30, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hye! I want some help related to MATLAB ,
From the point cloud 3D data I have to extract specific square area for which i know only 2 corner information i.e upper left x,y,z coordinate and bottom right x,y,z coordinates.
For this i've to apply some codes in MATLAB through which i get my area of interest(AOI) i.e specific square area which i mentioned above.
Thanks.

Please sign in to comment.