Module: Yast::HttpServerRoutinesInclude

Defined in:
../../src/include/http-server/routines.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) Abort

Abort function

Returns:

  • blah blah lahjk



25
26
27
28
# File '../../src/include/http-server/routines.rb', line 25

def Abort
  return @AbortFunction.call == true if @AbortFunction != nil
  false
end

- (Object) initialize_http_server_routines(include_target)



14
15
16
17
18
19
20
21
# File '../../src/include/http-server/routines.rb', line 14

def initialize_http_server_routines(include_target)
  textdomain "http-server"

  Yast.import "Directory"
  Yast.import "Progress"
  Yast.import "String"
  Yast.import "Popup"
end

- (Yast::Term) listen2item(arg, id)

Convert a Listen string to an item for table. Splits by the colon.

Parameters:

  • arg (String)

    the Listen string

  • id (Fixnum)

    the id of this item

Returns:

  • (Yast::Term)

    term for the table



56
57
58
59
60
61
62
63
64
65
66
67
68
# File '../../src/include/http-server/routines.rb', line 56

def listen2item(arg, id)
  colon = Builtins.search(arg, ":")

  address = _("All Addresses")
  port = arg

  if colon != nil
    # address is present
    address = Builtins.substring(arg, 0, colon)
    port = Builtins.substring(arg, Ops.add(colon, 1))
  end
  Item(Id(id), address, port)
end

- (Hash) listen2map(arg)

Convert a Listen string to a pair: $[ “port”: port, “address”: network ]

Parameters:

  • arg (String)

    the Listen string

Returns:

  • (Hash)

    map with the result



74
75
76
77
78
79
80
81
82
83
84
85
86
# File '../../src/include/http-server/routines.rb', line 74

def listen2map(arg)
  colon = Builtins.search(arg, ":")

  address = "all"
  port = arg

  if colon != nil
    # address is present
    address = Builtins.substring(arg, 0, colon)
    port = Builtins.substring(arg, Ops.add(colon, 1))
  end
  { "port" => port, "address" => address }
end

- (Object) PollAbort

Check for pending Abort press

Returns:

  • true if pending abort



32
33
34
# File '../../src/include/http-server/routines.rb', line 32

def PollAbort
  UI.PollInput == :abort
end

- (Object) ProgressNextStage(title)

Progress::NextStage and Progress::Title combined into one function

Parameters:

  • title (String)

    progressbar title



44
45
46
47
48
49
# File '../../src/include/http-server/routines.rb', line 44

def ProgressNextStage(title)
  Progress.NextStage
  Progress.Title(title)

  nil
end

- (Object) ReallyAbort

If modified, ask for confirmation

Returns:

  • true if abort is confirmed



38
39
40
# File '../../src/include/http-server/routines.rb', line 38

def ReallyAbort
  !Modified() || Popup.ReallyAbort(true)
end