Compare Pastes

Differences between the pastes #133411 (03.04.2020 17:36) and #232258 (06.11.2021 00:23).
1
#!/usr/bin/python2.7
2
# -*- coding: utf-8 -*-
3
4
# Copyright 2012-2016 Mir Calculate. http://www.calculate-linux.org
5
#
6
#  Licensed under the Apache License, Version 2.0 (the "License");
7
#  you may not use this file except in compliance with the License.
8
#  You may obtain a copy of the License at
9
#
10
#      http://www.apache.org/licenses/LICENSE-2.0
11
#
12
#  Unless required by applicable law or agreed to in writing, software
13
#  distributed under the License is distributed on an "AS IS" BASIS,
14
#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
#  See the License for the specific language governing permissions and
16
#  limitations under the License.
17
18
19
import os
20
import calculate.core.core_main as core_main
21
import sys
22
import re
23
24
25
if __name__ == '__main__':
26
    # direct run for root user, cl-passwd, cl-core-patch for portage user
27
    if (os.getuid() == 0 or sys.argv[0].endswith("/cl-passwd") or
28
        os.getuid() == 250 and sys.argv[0].endswith("/cl-core-patch")):
29
        core_main.core_main()
30
    else:
31
        try:
32
            import calculate.console.console_main as console_main
33
            console_main.console_main()
34
        except ImportError as e:
35
            print str(e)