Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,10 @@ repos:
hooks:
- id: check-hooks-apply
- id: check-useless-excludes
- repo: https://github.com/crate-ci/typos
rev: v1.43.0
hooks:
- id: typos
args: []
require_serial: true
pass_filenames: false
2 changes: 1 addition & 1 deletion NEWS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
3.2.3
=====

* Fixed uninitalized memory usage in DeleteSMS.
* Fixed uninitialized memory usage in DeleteSMS.

3.2.2
=====
Expand Down
4 changes: 2 additions & 2 deletions examples/async.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
"""
python-gammu - Phone communication libary
python-gammu - Phone communication library
Gammu asynchronous wrapper example with asyncio. This allows your application to care
only about handling received data and not about phone communication
details.
Expand Down Expand Up @@ -68,7 +68,7 @@ async def get_network_info(worker):


async def get_info(worker):
print("Phone infomation:")
print("Phone information:")
manufacturer = await worker.get_manufacturer_async()
print("{:<15}: {}".format("Manufacturer", manufacturer))
model = await worker.get_model_async()
Expand Down
2 changes: 1 addition & 1 deletion examples/debugging.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def main():
model = state_machine.GetModel()
imei = state_machine.GetIMEI()
firmware = state_machine.GetFirmware()
print("Phone infomation:")
print("Phone information:")
print("{:<15}: {}".format("Manufacturer", manufacturer))
print("{:<15}: {} ({})".format("Model", model[0], model[1]))
print("{:<15}: {}".format("IMEI", imei))
Expand Down
32 changes: 16 additions & 16 deletions examples/filesystem_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
"""
This file should provide me with a test frame for the filesystem
functions. It can't be run automatically, but you should be able
to decide, wheather the output looks sensible
to decide, whether the output looks sensible

BEWARE - the test WILL TOUCH AND WRITE FILESYSTEM!!

I asume you call the script from the directory were it lays and
have the grafic there and you have write permission there and that
I assume you call the script from the directory were it lays and
have the graphic there and you have write permission there and that
there is a file called cgi.jpg to be used as test file

READY:
Expand Down Expand Up @@ -100,7 +100,7 @@ def main():
state_machine.Init()

# Check GetFileSystemStatus
print("Expection: Info about filesystem usage")
print("Expectation: Info about filesystem usage")
try:
fs_info = state_machine.GetFileSystemStatus()
fs_info["Total"] = fs_info["Free"] + fs_info["Used"]
Expand All @@ -109,14 +109,14 @@ def main():
print("You will have to live without this knowledge")

# Check DeleteFile
print("\n\nExpection: Deleting cgi.jpg from memorycard")
print("\n\nExpectation: Deleting cgi.jpg from memorycard")
try:
state_machine.DeleteFile(unicode(args.folder + "/cgi.jpg"))
except gammu.ERR_FILENOTEXIST:
print("Oh well - we copy it now ;-) (You SHOULD read this)")

# Check AddFilePart
print("\n\nExpection: Put cgi.jpg onto Memorycard on phone")
print("\n\nExpectation: Put cgi.jpg onto Memorycard on phone")
file_handle = open(args.testfile, "rb")
file_stat = os.stat(args.testfile)
ttime = datetime.datetime.fromtimestamp(file_stat[8])
Expand All @@ -141,7 +141,7 @@ def main():
file_f = state_machine.AddFilePart(file_f)

# Check GetFilePart
print("\n\nExpection: Get cgi.jpg from memorycard and write it as test.jpg")
print("\n\nExpectation: Get cgi.jpg from memorycard and write it as test.jpg")
with open("./test.jpg", "wb") as handle:
file_f = {"ID_FullName": args.folder + "/cgi.jpg", "Finished": 0}
while not file_f["Finished"]:
Expand All @@ -150,7 +150,7 @@ def main():
handle.flush()

# Check correct transfer
print("\n\nExpection: test.jpg and cgi.jpg to be the same")
print("\n\nExpectation: test.jpg and cgi.jpg to be the same")
f1 = open(args.testfile, "rb")
f2 = open("./test.jpg", "rb")
if f1.read() == f2.read():
Expand All @@ -161,7 +161,7 @@ def main():
os.remove("./test.jpg")

# Check GetNextRootFolder
print("\n\nExpection: Root Folder List")
print("\n\nExpectation: Root Folder List")
try:
file_obj = state_machine.GetNextRootFolder("")
while 1:
Expand All @@ -174,7 +174,7 @@ def main():
print("Not supported...")

# Check GetNextFileFolder
print("\n\nExpection: Info for a file of the phone (cgi.jpg)")
print("\n\nExpectation: Info for a file of the phone (cgi.jpg)")
file_f = state_machine.GetNextFileFolder(1)
while 1:
if file_f["Name"] != "cgi.jpg":
Expand Down Expand Up @@ -220,13 +220,13 @@ def main():
# Check SetFileAttributes
# Protected is spared, as my mobile nokia 6230i says it's unsupported
print(
"\n\nExpection: Modifying attributes "
"\n\nExpectation: Modifying attributes "
"(readonly=1, protected=0, system=1, hidden=1)"
)
state_machine.SetFileAttributes(unicode(args.folder + "/cgi.jpg"), 1, 0, 1, 1)

# Check GetFolderListing
print("\n\nExpection: Listing of cgi.jpg's properties")
print("\n\nExpectation: Listing of cgi.jpg's properties")
file_f = state_machine.GetFolderListing(unicode(args.folder), 1)
while 1:
if file_f["Name"] != "cgi.jpg":
Expand Down Expand Up @@ -270,19 +270,19 @@ def main():
break

# Check DeleteFile
print("\n\nExpection: Deletion of cgi.jpg from memorycard")
print("\n\nExpectation: Deletion of cgi.jpg from memorycard")
try:
state_machine.DeleteFile(unicode(args.folder + "cgi.jpg"))
print("Deleted")
except gammu.ERR_FILENOTEXIST:
print("Something is wrong ...")

# Check AddFolder
print('\n\nExpection: Creation of a folder on the memorycard "42alpha"')
print('\n\nExpectation: Creation of a folder on the memorycard "42alpha"')
state_machine.AddFolder(unicode(args.folder), "42alpha")

# Check GetFolderListing again *wired*
print("\n\nExpection: Print properties of newly created folder")
print("\n\nExpectation: Print properties of newly created folder")
file_f = state_machine.GetFolderListing(unicode(args.folder), 1)
while 1:
if file_f["Name"] != "42alpha":
Expand Down Expand Up @@ -326,7 +326,7 @@ def main():
break

# Check DeleteFolder
print('\n\nExpection: Deletion of previously created folder "42alpha"')
print('\n\nExpectation: Deletion of previously created folder "42alpha"')
state_machine.DeleteFolder(unicode(args.folder + "/42alpha"))


Expand Down
2 changes: 1 addition & 1 deletion examples/listfilesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
state_machine.ReadConfig()
state_machine.Init()

# Get wished listing from commandline (if provided - else asume level)
# Get wished listing from commandline (if provided - else assume level)
# On commandline level or flat can be provided as parameters
if args.flat:
mode = "flat"
Expand Down
2 changes: 1 addition & 1 deletion examples/savesmspercontact.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def main():
state_machine.Terminate()

# Get all sms
# why in two steps? ERR_TIMOUT is raised without closing the connection
# why in two steps? ERR_TIMEOUT is raised without closing the connection
state_machine = gammu.StateMachine()
state_machine.ReadConfig()
state_machine.Init()
Expand Down
2 changes: 1 addition & 1 deletion examples/service_numbers.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def callback(state_machine, callback_type, data):

def init():
"""
Intializes gammu and callbacks.
Initializes gammu and callbacks.
"""
state_machine = gammu.StateMachine()
if len(sys.argv) >= 2:
Expand Down
2 changes: 1 addition & 1 deletion examples/vcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
"""
Example for reading data from phone and convering it to and from
Example for reading data from phone and converting it to and from
vCard, vTodo, vCalendar
"""

Expand Down
2 changes: 1 addition & 1 deletion examples/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
"""
python-gammu - Phone communication libary
python-gammu - Phone communication library

Gammu asynchronous wrapper example. This allows your application to care
only about handling received data and not about phone communication
Expand Down
2 changes: 1 addition & 1 deletion gammu/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
"""
Phone communication libary - python wrapper for Gammu library.
Phone communication library - python wrapper for Gammu library.
"""

from gammu._gammu import *
Expand Down
1 change: 0 additions & 1 deletion gammu/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@
"END_DATETIME",
"TONE_ALARM_DATETIME",
"SILENT_ALARM_DATETIME",
"RECURRANCE",
"TEXT",
"DESCRIPTION",
"LOCATION",
Expand Down
2 changes: 1 addition & 1 deletion gammu/src/convertors/backup.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* python-gammu - Phone communication libary
* python-gammu - Phone communication library
* Copyright (C) 2003 - 2018 Michal Čihař
*
* This program is free software; you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion gammu/src/convertors/base.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* python-gammu - Phone communication libary
* python-gammu - Phone communication library
* Copyright (C) 2003 - 2018 Michal Čihař
*
* This program is free software; you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion gammu/src/convertors/bitmap.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* python-gammu - Phone communication libary
* python-gammu - Phone communication library
* Copyright (C) 2003 - 2018 Michal Čihař
*
* This program is free software; you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion gammu/src/convertors/calendar.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* python-gammu - Phone communication libary
* python-gammu - Phone communication library
* Copyright (C) 2003 - 2018 Michal Čihař
*
* This program is free software; you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion gammu/src/convertors/call.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* python-gammu - Phone communication libary
* python-gammu - Phone communication library
* Copyright (C) 2003 - 2018 Michal Čihař
*
* This program is free software; you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion gammu/src/convertors/diverts.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* python-gammu - Phone communication libary
* python-gammu - Phone communication library
* Copyright (C) 2003 - 2018 Michal Čihař
*
* This program is free software; you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion gammu/src/convertors/file.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* python-gammu - Phone communication libary
* python-gammu - Phone communication library
* Copyright (C) 2003 - 2018 Michal Čihař
*
* This program is free software; you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion gammu/src/convertors/memory.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* python-gammu - Phone communication libary
* python-gammu - Phone communication library
* Copyright (C) 2003 - 2018 Michal Čihař
*
* This program is free software; you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion gammu/src/convertors/misc.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* python-gammu - Phone communication libary
* python-gammu - Phone communication library
* Copyright (C) 2003 - 2018 Michal Čihař
*
* This program is free software; you can redistribute it and/or modify
Expand Down
10 changes: 5 additions & 5 deletions gammu/src/convertors/ringtone.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* python-gammu - Phone communication libary
* python-gammu - Phone communication library
* Copyright (C) 2003 - 2018 Michal Čihař
*
* This program is free software; you can redistribute it and/or modify
Expand Down Expand Up @@ -400,7 +400,7 @@ int RingNoteScaleToInt(GSM_RingNoteScale type)
return v;
}

PyObject *RingCommadToPython(GSM_RingCommand * cmd)
PyObject *RingCommandToPython(GSM_RingCommand * cmd)
{
PyObject *result;
char *type, *style, *note, *durspec, *duration;
Expand Down Expand Up @@ -464,7 +464,7 @@ PyObject *RingCommadToPython(GSM_RingCommand * cmd)
return result;
}

int RingCommadFromPython(PyObject * dict, GSM_RingCommand * cmd)
int RingCommandFromPython(PyObject * dict, GSM_RingCommand * cmd)
{
int i;
char *s;
Expand Down Expand Up @@ -554,7 +554,7 @@ PyObject *RingtoneToPython(GSM_Ringtone * inring)
return NULL;

for (i = 0; i < ring.NoteTone.NrCommands; i++) {
f = RingCommadToPython(&(ring.NoteTone.Commands[i]));
f = RingCommandToPython(&(ring.NoteTone.Commands[i]));
if (f == NULL) {
Py_DECREF(v);
return NULL;
Expand Down Expand Up @@ -629,7 +629,7 @@ int RingtoneFromPython(PyObject * dict, GSM_Ringtone * ring)
"d in Notes is not a dictionary", i);
return 0;
}
if (!RingCommadFromPython(item, &(ring->NoteTone.Commands[i])))
if (!RingCommandFromPython(item, &(ring->NoteTone.Commands[i])))
return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion gammu/src/convertors/sms.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* python-gammu - Phone communication libary
* python-gammu - Phone communication library
* Copyright (C) 2003 - 2018 Michal Čihař
*
* This program is free software; you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion gammu/src/convertors/string.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* python-gammu - Phone communication libary
* python-gammu - Phone communication library
* Copyright (C) 2003 - 2018 Michal Čihař
*
* This program is free software; you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion gammu/src/convertors/time.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* python-gammu - Phone communication libary
* python-gammu - Phone communication library
* Copyright (C) 2003 - 2018 Michal Čihař
*
* This program is free software; you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion gammu/src/convertors/todo.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* python-gammu - Phone communication libary
* python-gammu - Phone communication library
* Copyright (C) 2003 - 2018 Michal Čihař
*
* This program is free software; you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion gammu/src/convertors/wap.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* python-gammu - Phone communication libary
* python-gammu - Phone communication library
* Copyright (C) 2003 - 2018 Michal Čihař
*
* This program is free software; you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion gammu/src/data.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* python-gammu - Phone communication libary
* python-gammu - Phone communication library
* Copyright (C) 2003 - 2018 Michal Čihař
*
* This program is free software; you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion gammu/src/errors.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* python-gammu - Phone communication libary
* python-gammu - Phone communication library
* Copyright (C) 2003 - 2018 Michal Čihař
*
* This program is free software; you can redistribute it and/or modify
Expand Down
Loading