[asterisk-dev] [Code Review] Remove development header dependency for asterisk version

wdoekes reviewboard at asterisk.org
Fri Jan 27 02:24:28 CST 2012


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/1695/#review5325
-----------------------------------------------------------



asterisk/trunk/lib/python/asterisk/version.py
<https://reviewboard.asterisk.org/r/1695/#comment9872>

    I'd replace this large block in __init__ with:
    
      self.version_str = version or AsteriskVersion.get_version_from_binary()
    
    And move the ast_binary= (no need for self. there) ... stuff to a @classmethod get_version_from_binary:
    
      if not hasattr(cls, '_cached_version'):
        # popen stuff
      return cls._cached_version
    
    That way you won't have this long if and the ugly intermixing of class vars with object vars.


- wdoekes


On Jan. 26, 2012, 4:27 p.m., Paul Belanger wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/1695/
> -----------------------------------------------------------
> 
> (Updated Jan. 26, 2012, 4:27 p.m.)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Summary
> -------
> 
> Like the title says, we'll now use the asterisk binary over the development headers to figure out which version of asterisk is installed.
> 
> 
> Diffs
> -----
> 
>   asterisk/trunk/lib/python/asterisk/version.py 3019 
> 
> Diff: https://reviewboard.asterisk.org/r/1695/diff
> 
> 
> Testing
> -------
> 
> local development box
> 
> 
> Thanks,
> 
> Paul
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20120127/3a255c6e/attachment-0001.htm>


More information about the asterisk-dev mailing list