Skip to content

Commit 4ea2597

Browse files
committed
fix typos in the code
1 parent 39c56d9 commit 4ea2597

8 files changed

Lines changed: 21 additions & 22 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,10 @@ opensipscli = cli.OpenSIPSCLI(args)
7575
...
7676
```
7777

78-
Custom settings can be provided thourgh the arguments, i.e.:
78+
Custom settings can be provided through the arguments, i.e.:
7979
```
8080
# run commands over http
81-
args = OpenSIPSCLIArgs(communcation_type = "http",
81+
args = OpenSIPSCLIArgs(communication_type = "http",
8282
url="http://127.0.0.1:8080/mi")
8383
...
8484
```

docs/modules/trap.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,4 @@ OpenSIPS, since it needs direct access to OpenSIPS processes.
3535
* This module requires to have the `gdb` command in system's `PATH`. At
3636
startup, it checks if `gdb` can be located (using `which`), and if it cannot,
3737
the module becomes unavailable.
38-
* You need administrative priviledges to run the `trap`.
38+
* You need administrative privileges to run the `trap`.

opensipscli/cli.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class OpenSIPSCLI(cmd.Cmd, object):
4141

4242
def __init__(self, options = None):
4343
"""
44-
contructor for OpenSIPS-Cli
44+
constructor for OpenSIPS-Cli
4545
"""
4646

4747
if not options:
@@ -125,7 +125,7 @@ def update_instance(self, instance):
125125
self.intro = cfg.get('prompt_intro')
126126
self.prompt = '(%s): ' % cfg.get('prompt_name')
127127

128-
# initialize communcation handler
128+
# initialize communication handler
129129
self.handler = comm.initialize()
130130

131131
# remove all loaded modules

opensipscli/db.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ class osdbError(Exception):
9090

9191
class osdbConnectError(osdbError):
9292
"""
93-
OSDB: connecton error handler
93+
OSDB: connection error handler
9494
"""
9595
pass
9696

@@ -215,7 +215,7 @@ def __init__(self, db_url, db_name):
215215
execution_options(autocommit=True)
216216
# connect the Session object to our engine
217217
self.Session.configure(bind=self.__engine)
218-
# instanciate the Session object
218+
# instantiate the Session object
219219
self.__session = self.Session()
220220
except sqlalchemy.exc.OperationalError as se:
221221
if self.dialect == "mysql":
@@ -268,7 +268,7 @@ def alter_role(self, role_name, role_options=None, role_password=None):
268268
try:
269269
result = self.__conn.execute(sqlcmd)
270270
if result:
271-
logger.info( "{} was successfull".format(msg))
271+
logger.info( "{} was successful".format(msg))
272272
except:
273273
logger.error("%s failed", msg)
274274
return False
@@ -292,7 +292,7 @@ def connect(self, db_name=None):
292292
self.__conn = engine.connect()
293293
# connect the Session object to our engine
294294
self.Session.configure(bind=self.__engine)
295-
# instanciate the Session object
295+
# instantiate the Session object
296296
self.session = self.Session()
297297
logger.debug("connected to database URL '%s'", self.db_url)
298298
elif self.dialect != "sqlite":
@@ -440,7 +440,7 @@ def ensure_user(self, db_url):
440440
def create_role(self, role_name, role_password, update=False,
441441
role_options="NOCREATEDB NOCREATEROLE LOGIN"):
442442
"""
443-
create a role object (PostgreSQL secific)
443+
create a role object (PostgreSQL specific)
444444
"""
445445
# TODO: is any other dialect using the "role" concept?
446446
if self.dialect != "postgresql":
@@ -490,7 +490,7 @@ def delete(self, table, filter_keys=None):
490490

491491
def destroy(self):
492492
"""
493-
decontructor of a database object
493+
destructor of a database object
494494
"""
495495
# TODO: do this only for SQLAlchemy
496496
if not self.__conn:
@@ -699,7 +699,7 @@ def get_where(self, filter_keys):
699699

700700
def get_role(self, role_name="opensips"):
701701
"""
702-
get attibutes of a role object (PostgreSQL specific)
702+
get attributes of a role object (PostgreSQL specific)
703703
"""
704704
# TODO: is any other dialect using the "role" concept?
705705
if self.dialect != "postgresql":
@@ -724,7 +724,7 @@ def get_role(self, role_name="opensips"):
724724

725725
def grant_db_options(self, role_name, on_statement, privs="ALL PRIVILEGES"):
726726
"""
727-
assign attibutes to a role object (PostgreSQL specific)
727+
assign attributes to a role object (PostgreSQL specific)
728728
"""
729729
# TODO: is any other dialect using the "role" concept?
730730
if self.dialect != "postgresql":

opensipscli/logger.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
import logging
2525

26-
#These are the sequences need to get colored ouput
26+
#These are the sequences needed to get colored output
2727
RESET_SEQ = "\033[0m"
2828
COLOR_SEQ = "\033[1;%dm"
2929
BOLD_SEQ = "\033[1m"

opensipscli/modules/database.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,7 @@ def __complete__(self, command, text, line, begidx, endidx):
607607

608608
def __exclude__(self):
609609
"""
610-
method exlusion list
610+
method exclusion list
611611
"""
612612
if cfg.exists("database_url"):
613613
db_url = cfg.get("database_url")
@@ -719,7 +719,7 @@ def do_add(self, params, modifiers=None):
719719

720720
def do_create(self, params=None, modifiers=None):
721721
"""
722-
create database with role-assigment and tables
722+
create database with role-assignment and tables
723723
"""
724724
if len(params) >= 1:
725725
db_name = params[0]
@@ -811,7 +811,7 @@ def create_tables(self, db_name, db_url, admin_db, tables=[],
811811
if create_std:
812812
standard_file_path = os.path.join(schema_path, "standard-create.sql")
813813
if not os.path.isfile(standard_file_path):
814-
logger.error("cannot find stardard OpenSIPS DB file: '{}'!".
814+
logger.error("cannot find standard OpenSIPS DB file: '{}'!".
815815
format(standard_file_path))
816816
return -1
817817
table_files['standard'] = standard_file_path
@@ -820,7 +820,7 @@ def create_tables(self, db_name, db_url, admin_db, tables=[],
820820
if tables:
821821
pass
822822
elif cfg.exists("database_modules"):
823-
# we know exactly what modules we want to instsall
823+
# we know exactly what modules we want to install
824824
tables_line = cfg.get("database_modules").strip().lower()
825825
if tables_line == "all":
826826
logger.debug("Creating all tables")

opensipscli/modules/diagnose.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -816,7 +816,7 @@ def get_opensips_pgroups(self):
816816
for proc in ps['Processes']:
817817
if have_psutil:
818818
proc['cpumon'] = psutil.Process(proc['PID'])
819-
proc['cpumon'].cpu_percent(interval=None) # begin cyle count
819+
proc['cpumon'].cpu_percent(interval=None) # begin cycle count
820820

821821
if proc['Type'].startswith("TCP "):
822822
""" OpenSIPS TCP is simplified, but normalize the format"""
@@ -1084,6 +1084,6 @@ def desc_sip_msg(sip_msg):
10841084
return "{}{}{}".format(desc, ", " if desc and callid else "", callid)
10851085

10861086
def human_size(bytes, units=[' bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB']):
1087-
""" Returns a human readable string reprentation of bytes"""
1087+
""" Returns a human readable string representation of bytes"""
10881088
return "{:.1f}".format(bytes) + units[0] \
10891089
if bytes < 1024 else human_size(bytes / 1024, units[1:])

opensipscli/modules/user.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ def do_password(self, params=None, modifiers=None):
219219
password = self.user_get_password()
220220
if password is None:
221221
logger.error("Password not specified: " +
222-
"cannot change passowrd for user {}@{}".
222+
"cannot change password for user {}@{}".
223223
format(user, domain))
224224
return -1
225225
plain_text_pw = cfg.getBool("plain_text_passwords")
@@ -278,4 +278,3 @@ def __exclude__(self):
278278
else:
279279
return (not osdb.has_sqlalchemy(), None)
280280
return (not osdb.has_dialect(osdb.get_dialect(db_url)), None)
281-

0 commit comments

Comments
 (0)