fix: fixed some typo (#1373)

This commit is contained in:
Zhizhen He
2023-03-26 06:01:46 +08:00
committed by GitHub
parent d70b424211
commit 001f787e41
6 changed files with 14 additions and 14 deletions

View File

@@ -165,8 +165,8 @@ public class BarChart: WidgetWrapper {
var y = offset
for a in 0..<self.value[i].count {
let partitionValue = self.value[i][a]
let partitonHeight = maxPartitionHeight * CGFloat(partitionValue.value)
let partition = NSBezierPath(rect: NSRect(x: x, y: y, width: partitionWidth, height: partitonHeight))
let partitionHeight = maxPartitionHeight * CGFloat(partitionValue.value)
let partition = NSBezierPath(rect: NSRect(x: x, y: y, width: partitionWidth, height: partitionHeight))
if partitionValue.color == nil {
switch self.colorState {
@@ -189,7 +189,7 @@ public class BarChart: WidgetWrapper {
partition.fill()
partition.close()
y += partitonHeight
y += partitionHeight
}
x += partitionWidth + partitionMargin

View File

@@ -531,7 +531,7 @@ public class MenuBarView: NSView {
if let view = self.subviews.first(where: { $0.identifier == NSUserInterfaceItemIdentifier(type.rawValue) }) {
view.removeFromSuperview()
} else {
error("\(type) cound not be removed from the one view bacause not found!")
error("\(type) could not be removed from the one view because not found!")
}
}

View File

@@ -216,17 +216,17 @@ public class Updater {
var toPath = to
let fileName = (URL(fileURLWithPath: to.absoluteString)).lastPathComponent
let fileExt = (URL(fileURLWithPath: to.absoluteString)).pathExtension
var fileNameWithotSuffix: String!
var fileNameWithoutSuffix: String!
var newFileName: String!
var counter = 0
if fileName.hasSuffix(fileExt) {
fileNameWithotSuffix = String(fileName.prefix(fileName.count - (fileExt.count+1)))
fileNameWithoutSuffix = String(fileName.prefix(fileName.count - (fileExt.count+1)))
}
while toPath.checkFileExist() {
counter += 1
newFileName = "\(fileNameWithotSuffix!)-\(counter).\(fileExt)"
newFileName = "\(fileNameWithoutSuffix!)-\(counter).\(fileExt)"
toPath = to.deletingLastPathComponent().appendingPathComponent(newFileName)
}

View File

@@ -61,7 +61,7 @@ import platform
class UsageException (Exception):
"""
Raised when the progam detects a usage issue; the top-level code catches this
Raised when the program detects a usage issue; the top-level code catches this
and prints a usage message.
"""
pass