Mailinglist Archive: yast-devel (85 mails)

< Previous Next >
Re: [yast-devel] Next hackweek project done ... ycp-to-ruby-translator
  • From: Klaus Kaempf <kkaempf@xxxxxxx>
  • Date: Wed, 18 Jul 2007 17:50:54 +0200
  • Message-id: <20070718155054.GA12149@xxxxxxxxxxxxx>
* Duncan Mac-Vicar Prett <dmacvicar@xxxxxxx> [Jul 18. 2007 15:32]:
> 
> really cool.

Thanks.
> 
> Do you have examples of converted code?

/usr/share/YaST2/modules/Arch.ycp for example (shortened):

 {

  module "Arch";

  string _architecture = nil

  global string architecture () {
    if (_architecture == nil)
        _architecture = (string)SCR::Read(.probe.architecture);
    return _architecture;
  }

  }

translates to

  module Arch
  require 'ycp/SCR'
  _architecture = nil

  def architecture(  )
    if ( _architecture == nil ) then
      _architecture = Ycp::Builtin::Read( ".probe.architecture" )
    end
    return _architecture
  end

  end


>, how does it handle modules and other stuff?

It can convert all of /usr/share/YaST2/clients and /usr/share/YaST2/modules.

The README file lists current limitations. Biggest problem is YCP terms
which don't have a direct representation in Ruby.

Klaus
---
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG N├╝rnberg)

-- 
To unsubscribe, e-mail: yast-devel+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-devel+help@xxxxxxxxxxxx

< Previous Next >