Skip to content

Commit

Permalink
Revert "DYN-7753: simplify file size string (#15629)"
Browse files Browse the repository at this point in the history
This reverts commit 09aa203.
  • Loading branch information
QilongTang committed Nov 12, 2024
1 parent 9ad38ee commit 15ad269
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 68 deletions.
1 change: 0 additions & 1 deletion src/DynamoUtilities/PublicAPI.Unshipped.txt
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,6 @@ static DynamoUtilities.PathHelper.IsValidPath(string filePath) -> bool
static DynamoUtilities.PathHelper.isValidXML(string path, out System.Xml.XmlDocument xmlDoc, out System.Exception ex) -> bool
static DynamoUtilities.PathHelper.LoadEmbeddedResourceAsString(string resourcePath, System.Reflection.Assembly assembly) -> string
static DynamoUtilities.StringUtilities.CapitalizeFirstLetter(string word) -> string
static DynamoUtilities.StringUtilities.SimplifyFileSizeUnit(string size) -> string
static DynamoUtilities.TypeSwitch.Case<T>(System.Action action) -> DynamoUtilities.TypeSwitch.CaseInfo
static DynamoUtilities.TypeSwitch.Case<T>(System.Action<T> action) -> DynamoUtilities.TypeSwitch.CaseInfo
static DynamoUtilities.TypeSwitch.Default(System.Action action) -> DynamoUtilities.TypeSwitch.CaseInfo
Expand Down
21 changes: 6 additions & 15 deletions src/DynamoUtilities/StringUtilities.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DynamoUtilities
{
/// <summary>
Expand All @@ -17,20 +23,5 @@ public static string CapitalizeFirstLetter(string word)

return char.ToUpper(word[0]) + word.Substring(1);
}

/// <summary>
/// Replaces 'i' in a file size string
/// </summary>
/// <param name="size">The file size string</param>
/// <returns></returns>
public static string SimplifyFileSizeUnit(string size)
{
if (string.IsNullOrEmpty(size))
{
return size;
}

return size.Replace("i", "");
}
}
}
5 changes: 2 additions & 3 deletions src/PackageDetailsViewExtension/PackageDetailItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using Dynamo.Core;
using Dynamo.PackageManager;
using Dynamo.PythonServices;
using DynamoUtilities;
using Greg.Responses;

namespace Dynamo.PackageDetails
Expand Down Expand Up @@ -284,7 +283,7 @@ public PackageDetailItem(string packageName, PackageVersion packageVersion, bool
this.CopyRightYear = PackageVersion.copyright_year;
this.CanInstall = canInstall;
this.IsEnabledForInstall = isEnabledForInstall && canInstall;
this.PackageSize = string.IsNullOrEmpty(PackageVersion.size) ? "--" : StringUtilities.SimplifyFileSizeUnit (PackageVersion.size);
this.PackageSize = string.IsNullOrEmpty(PackageVersion.size) ? "--" : PackageVersion.size;
this.Created = GetFormattedDate(PackageVersion.created);
this.VersionInformation = GetFlattenedCompatibilityInformation(packageVersion.compatibility_matrix);
this.ReleaseNotes = PackageVersion.release_notes_url;
Expand Down Expand Up @@ -316,7 +315,7 @@ public PackageDetailItem(List<VersionInformation> versionDetails, string package
this.CopyRightYear = PackageVersion.copyright_year;
this.CanInstall = canInstall;
this.IsEnabledForInstall = isEnabledForInstall && canInstall;
this.PackageSize = string.IsNullOrEmpty(PackageVersion.size) ? "--" : StringUtilities.SimplifyFileSizeUnit (PackageVersion.size);
this.PackageSize = string.IsNullOrEmpty(PackageVersion.size) ? "--" : PackageVersion.size;
this.Created = GetFormattedDate(PackageVersion.created);
this.VersionInformation = GetFlattenedCompatibilityInformation(packageVersion.compatibility_matrix);
this.IsCompatible = PackageManager.VersionInformation.GetVersionCompatibility(versionDetails, PackageVersionNumber);
Expand Down
49 changes: 0 additions & 49 deletions test/DynamoCoreTests/StringUtilitiesTest.cs

This file was deleted.

0 comments on commit 15ad269

Please sign in to comment.