Skip to content

Commit d7f578f

Browse files
fix : error messages updated
1 parent a4a872b commit d7f578f

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

orangetool/orangetool_params.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@
55
UPDATE_URL = "http://www.orangetool.ir/version"
66
IP_PATTERN = r"(?:[0-9]{1,3}\.){3}[0-9]{1,3}"
77
GLOBAL_IP_API_1 = "http://ipinfo.io/ip"
8-
GENERAL_ERROR_MESSAGE = "Error"
8+
GENERAL_ERROR_MESSAGE = "Error"
9+
ROOT_ERROR_MESSAGE = "Root Error"

orangetool/orangetool_storage.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import os
55
import string
66
import random
7-
from .orangetool_params import GENERAL_ERROR_MESSAGE
7+
from .orangetool_params import GENERAL_ERROR_MESSAGE, ROOT_ERROR_MESSAGE
88

99
def mount_status(device_name, debug=False):
1010
"""
@@ -171,7 +171,7 @@ def usb_control(code, debug=False):
171171
stdin=sub.PIPE)
172172
response = list(command.communicate())
173173
if len(response[1]) > 0:
174-
raise Exception('Root Error')
174+
raise Exception(ROOT_ERROR_MESSAGE)
175175
except Exception as e:
176176
if debug:
177177
print(str(e))

orangetool/orangetool_system.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# -*- coding: utf-8 -*-
22
"""Orangetool system functions."""
33
import subprocess as sub
4-
from .orangetool_params import ORANGETOOL_VERSION, UPDATE_URL, GENERAL_ERROR_MESSAGE
4+
from .orangetool_params import ORANGETOOL_VERSION, UPDATE_URL, GENERAL_ERROR_MESSAGE, ROOT_ERROR_MESSAGE
55
import time
66
import requests
77
from art import tprint
@@ -180,7 +180,7 @@ def power_control(command, debug=False):
180180
stdin=sub.PIPE)
181181
response = list(command.communicate())
182182
if len(response[1]) > 0:
183-
raise Exception('Root Error')
183+
raise Exception(ROOT_ERROR_MESSAGE)
184184
except Exception as e:
185185
if debug:
186186
print(str(e))

0 commit comments

Comments
 (0)