Skip to content

Commit 1c3fbce

Browse files
committed
Merge branch 'develop'
2 parents 4bdb321 + 42feb04 commit 1c3fbce

File tree

103 files changed

+3854
-1207
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+3854
-1207
lines changed

bin/pyRevitLabs.Common.dll

-2 KB
Binary file not shown.

bin/pyRevitLabs.CommonCLI.dll

0 Bytes
Binary file not shown.

bin/pyRevitLabs.CommonWPF.dll

0 Bytes
Binary file not shown.

bin/pyRevitLabs.DeffrelDB.dll

0 Bytes
Binary file not shown.

bin/pyRevitLabs.Language.dll

0 Bytes
Binary file not shown.

bin/pyRevitLabs.PyRevit.dll

1.5 KB
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

bin/pyRevitLabs.TargetApps.Revit.dll

0 Bytes
Binary file not shown.

bin/pyrevit-hosts.json

+11
Original file line numberDiff line numberDiff line change
@@ -1083,4 +1083,15 @@
10831083
"build": "20190808_0900",
10841084
"target": "x64",
10851085
"notes": "https://up.autodesk.com/2019/RVT/Autodesk_Revit_2019_2_2_Readme.html"
1086+
}, {
1087+
"meta": {
1088+
"schema": "1.0",
1089+
"source": "https://help.autodesk.com/view/RVT/2021/ENU/?guid=RevitReleaseNotes_2021release_html"
1090+
},
1091+
"product": "Autodesk Revit",
1092+
"release": "2021 First Customer Ship",
1093+
"version": "21.0.0.383",
1094+
"build": "20200220_1100",
1095+
"target": "x64",
1096+
"notes": "https://help.autodesk.com/view/RVT/2021/ENU/?guid=RevitReleaseNotes_2021release_html"
10861097
}]

bin/pyrevit-products.json

+15
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
[{
2+
"product": "pyRevit",
3+
"release": "4.7.6",
4+
"version": "4.7.6",
5+
"key": "{57D90459-1106-444E-A9DC-DC68435BBAEE}"
6+
},{
27
"product": "pyRevit",
38
"release": "4.7.5",
49
"version": "4.7.5",
@@ -149,6 +154,16 @@
149154
"version": "4.6.1",
150155
"key": "{EF91A585-DC0C-43B8-B88B-4C130F430E84}"
151156
}, {
157+
"product": "pyRevit CLI",
158+
"release": "0.25.0",
159+
"version": "0.25.0",
160+
"key": "{27F44ADD-E91B-4733-B4FC-51473A2FAC3D}"
161+
},{
162+
"product": "pyRevit CLI",
163+
"release": "0.24.0",
164+
"version": "0.24.0",
165+
"key": "{21E2B6B9-B39B-4482-99C0-C83B93181870}"
166+
},{
152167
"product": "pyRevit CLI",
153168
"release": "0.21.0",
154169
"version": "0.21.0",

bin/pyrevit.exe

512 Bytes
Binary file not shown.

dev/pyRevitLabs/pyRevitCLI/Properties/AssemblyShared.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
using System.Runtime.InteropServices;
33
using System.Runtime.CompilerServices;
44

5-
[assembly: AssemblyCopyright("Copyright © 2014-2019")]
5+
[assembly: AssemblyCopyright("Copyright © 2014-2020")]
66
[assembly: AssemblyCompany("pyRevitLabs.io")]
77

88
// Version information for an assembly consists of the following four values:
@@ -15,5 +15,5 @@
1515
// You can specify all the values or you can default the Build and Revision Numbers
1616
// by using the '*' as shown below:
1717
// [assembly: AssemblyVersion("1.0.*")]
18-
[assembly: AssemblyVersion("0.21.0.0")]
19-
[assembly: AssemblyFileVersion("0.21.0.0")]
18+
[assembly: AssemblyVersion("0.25.0.0")]
19+
[assembly: AssemblyFileVersion("0.25.0.0")]

dev/pyRevitLabs/pyRevitCLI/PyRevitCLI.cs

+33-12
Original file line numberDiff line numberDiff line change
@@ -83,16 +83,9 @@ internal static class PyRevitCLI {
8383

8484
// cli entry point:
8585
static void Main(string[] args) {
86-
8786
// process arguments for logging level
8887
var argsList = new List<string>(args);
8988

90-
// check for testing and set the global test flag
91-
if (argsList.Contains("--test")) {
92-
argsList.Remove("--test");
93-
GlobalConfigs.UnderTest = true;
94-
}
95-
9689
// setup logger
9790
// process arguments for hidden debug mode switch
9891
PyRevitCLILogLevel logLevel = PyRevitCLILogLevel.InfoMessages;
@@ -167,10 +160,6 @@ static void Main(string[] args) {
167160
}
168161
}
169162

170-
// configure env
171-
private static void PrepareEnv() {
172-
}
173-
174163
// cli argument processor
175164
private static void ProcessArguments() {
176165
if (IsHelpUsagePatternMode) Console.WriteLine(UsagePatterns.Replace("\t", " "));
@@ -200,7 +189,7 @@ private static void ProcessArguments() {
200189
if (IsHelpMode)
201190
PyRevitCLIAppHelps.PrintHelp(PyRevitCLICommandType.Update);
202191
else
203-
PyRevitCLIAppCmds.UpdateRemoteDateSources();
192+
PyRevitCLIAppCmds.UpdateRemoteDataSources();
204193
}
205194

206195
else if (all("clone")) {
@@ -676,6 +665,38 @@ private static void ProcessArguments() {
676665
PyRevitConfigs.GetAppendTooltipEx() ? "Enabled" : "Disabled"));
677666
}
678667

668+
else if (all("routes")) {
669+
if (all("port")) {
670+
var portNumber = TryGetValue("<port_number>");
671+
if (portNumber is null) {
672+
Console.WriteLine(string.Format("Routes Port: {0}", PyRevitConfigs.GetRoutesServerPort()));
673+
}
674+
else
675+
PyRevitConfigs.SetRoutesServerPort(int.Parse(portNumber));
676+
}
677+
678+
else if (all("coreapi")) {
679+
if (all("enable"))
680+
PyRevitConfigs.SetRoutesLoadCoreAPIStatus(true);
681+
else if (all("disable"))
682+
PyRevitConfigs.SetRoutesLoadCoreAPIStatus(false);
683+
else
684+
Console.WriteLine(string.Format("Routes Core API is {0}",
685+
PyRevitConfigs.GetRoutesLoadCoreAPIStatus() ? "Enabled" : "Disabled"));
686+
}
687+
688+
else if (all("enable"))
689+
PyRevitConfigs.EnableRoutesServer();
690+
691+
else if (all("disable"))
692+
PyRevitConfigs.DisableRoutesServer();
693+
694+
else {
695+
Console.WriteLine(string.Format("Routes Server is {0}",
696+
PyRevitConfigs.GetRoutesServerStatus() ? "Enabled" : "Disabled"));
697+
}
698+
}
699+
679700
else if (all("telemetry")) {
680701
if (all("utc")) {
681702
if (any("yes", "no"))

dev/pyRevitLabs/pyRevitCLI/PyRevitCLIAppCmds.cs

+1-3
Original file line numberDiff line numberDiff line change
@@ -206,12 +206,10 @@ internal static void
206206
}
207207

208208
internal static void
209-
UpdateRemoteDateSources() {
209+
UpdateRemoteDataSources() {
210210
// update and show progress
211-
GlobalConfigs.ReportProgress = true;
212211
RevitProductData.Update();
213212
PyRevitProductData.Update();
214-
GlobalConfigs.ReportProgress = false;
215213
}
216214
}
217215
}

dev/pyRevitLabs/pyRevitCLI/PyRevitCLIAppHelps.cs

+1
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,7 @@ internal static void
342342
{ "usercanconfig", "Enable/Disable Settings button in pyRevit" },
343343
{ "colordocs", "Enable/Disable Document Colorizer" },
344344
{ "tooltipdebuginfo", "Enable/Disable showing tool debug info in extended tooltips" },
345+
{ "routes", "Routes" },
345346
{ "telemetry", "Telemetry" },
346347
{ "apptelemetry", "Application Telemetry" },
347348
{ "outputcss", "Output window styling" },

dev/pyRevitLabs/pyRevitCLI/PyRevitCLICloneCmds.cs

-7
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,6 @@ internal static void
5151
CreateClone(string cloneName, string deployName, string branchName, string repoUrl, string imagePath, string destPath, string username, string password) {
5252
// FIXME: implement image
5353
if (cloneName != null) {
54-
// report progress
55-
GlobalConfigs.ReportProgress = true;
56-
Console.CursorVisible = false;
57-
5854
// if deployment requested or image path is provided
5955
if (imagePath != null || deployName != null)
6056
PyRevitClones.DeployFromImage(
@@ -75,9 +71,6 @@ internal static void
7571
username: username,
7672
password: password
7773
);
78-
79-
GlobalConfigs.ReportProgress = false;
80-
Console.CursorVisible = true;
8174
}
8275
}
8376

dev/pyRevitLabs/pyRevitCLI/Resources/UsagePatterns.txt

+5
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,11 @@ Usage:
8585
pyrevit configs usercanconfig [(yes | no)] [--log=<log_file>]
8686
pyrevit configs colordocs [(enable | disable)] [--log=<log_file>]
8787
pyrevit configs tooltipdebuginfo [(enable | disable)] [--log=<log_file>]
88+
pyrevit configs routes [--help]
89+
pyrevit configs routes [(enable | disable)] [--log=<log_file>]
90+
pyrevit configs routes port [<port_number>] [--log=<log_file>]
91+
pyrevit configs routes coreapi [(enable | disable)] [--log=<log_file>]
92+
pyrevit configs telemetry [--help]
8893
pyrevit configs telemetry [(enable | disable)] [--log=<log_file>]
8994
pyrevit configs telemetry utc [(yes | no)] [--log=<log_file>]
9095
pyrevit configs telemetry (file | server) [<dest_path>] [--log=<log_file>]

dev/pyRevitLabs/pyRevitLabs.Common/CommonUtils.cs

+41-41
Original file line numberDiff line numberDiff line change
@@ -145,21 +145,21 @@ public static string DownloadFile(string url, string destPath, string progressTo
145145
try {
146146
using (var client = GetWebClient()) {
147147
client.Headers.Add("User-Agent", "pyrevit-cli");
148-
if (GlobalConfigs.ReportProgress) {
149-
logger.Debug("Downloading (async) \"{0}\"", url);
148+
//if (GlobalConfigs.ReportProgress) {
149+
// logger.Debug("Downloading (async) \"{0}\"", url);
150150

151-
client.DownloadProgressChanged += Client_DownloadProgressChanged;
151+
// client.DownloadProgressChanged += Client_DownloadProgressChanged;
152152

153-
lastReport = 0;
154-
client.DownloadFileAsync(new Uri(url), destPath, progressToken);
153+
// lastReport = 0;
154+
// client.DownloadFileAsync(new Uri(url), destPath, progressToken);
155155

156-
// wait until download is complete
157-
while (client.IsBusy) ;
158-
}
159-
else {
156+
// // wait until download is complete
157+
// while (client.IsBusy) ;
158+
//}
159+
//else {
160160
logger.Debug("Downloading \"{0}\"", url);
161161
client.DownloadFile(url, destPath);
162-
}
162+
//}
163163
}
164164
}
165165
catch (Exception dlEx) {
@@ -170,36 +170,36 @@ public static string DownloadFile(string url, string destPath, string progressTo
170170
return destPath;
171171
}
172172

173-
private static void Client_DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e) {
174-
lock (ProgressLock) {
175-
if (e.ProgressPercentage > lastReport) {
176-
lastReport = e.ProgressPercentage;
177-
178-
// build progress bar and print
179-
// =====>
180-
var pbar = string.Concat(Enumerable.Repeat("=", (int)((lastReport / 100.0) * 50.0))) + ">";
181-
// 4.57 KB/27.56 KB
182-
var sizePbar = string.Format("{0}/{1}", e.BytesReceived.CleanupSize(), e.TotalBytesToReceive.CleanupSize());
183-
184-
// Downloading [==========================================> ] 23.26 KB/27.56 KB
185-
string message = "";
186-
if (lastReport == 100) {
187-
if (e.UserState != null)
188-
message = string.Format("\r{1}: Download complete ({0})", e.TotalBytesToReceive.CleanupSize(), (string)e.UserState);
189-
else
190-
message = string.Format("\rDownload complete ({0})", e.TotalBytesToReceive.CleanupSize());
191-
Console.WriteLine("{0,-120}", message);
192-
}
193-
else {
194-
if (e.UserState != null)
195-
message = string.Format("\r{2}: Downloading [{0,-50}] {1}", pbar, sizePbar, (string)e.UserState);
196-
else
197-
message = string.Format("\rDownloading [{0,-50}] {1}", pbar, sizePbar);
198-
Console.Write("{0,-120}", message);
199-
}
200-
}
201-
}
202-
}
173+
//private static void Client_DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e) {
174+
// lock (ProgressLock) {
175+
// if (e.ProgressPercentage > lastReport) {
176+
// lastReport = e.ProgressPercentage;
177+
178+
// // build progress bar and print
179+
// // =====>
180+
// var pbar = string.Concat(Enumerable.Repeat("=", (int)((lastReport / 100.0) * 50.0))) + ">";
181+
// // 4.57 KB/27.56 KB
182+
// var sizePbar = string.Format("{0}/{1}", e.BytesReceived.CleanupSize(), e.TotalBytesToReceive.CleanupSize());
183+
184+
// // Downloading [==========================================> ] 23.26 KB/27.56 KB
185+
// string message = "";
186+
// if (lastReport == 100) {
187+
// if (e.UserState != null)
188+
// message = string.Format("\r{1}: Download complete ({0})", e.TotalBytesToReceive.CleanupSize(), (string)e.UserState);
189+
// else
190+
// message = string.Format("\rDownload complete ({0})", e.TotalBytesToReceive.CleanupSize());
191+
// Console.WriteLine("{0,-120}", message);
192+
// }
193+
// else {
194+
// if (e.UserState != null)
195+
// message = string.Format("\r{2}: Downloading [{0,-50}] {1}", pbar, sizePbar, (string)e.UserState);
196+
// else
197+
// message = string.Format("\rDownloading [{0,-50}] {1}", pbar, sizePbar);
198+
// Console.Write("{0,-120}", message);
199+
// }
200+
// }
201+
// }
202+
//}
203203

204204
public static bool CheckInternetConnection() {
205205
try {
@@ -395,7 +395,7 @@ public static string GenerateRandomName(int len = 16) {
395395
string[] consonants = { "b", "c", "d", "f", "g", "h", "j", "k", "l", "m", "l", "n", "p", "q", "r", "s", "sh", "zh", "t", "v", "w", "x" };
396396
string[] vowels = { "a", "e", "i", "o", "u", "ae", "y" };
397397
string Name = "";
398-
Name += consonants[r.Next(consonants.Length)].ToUpper();
398+
Name += consonants[r.Next(consonants.Length)].ToUpperInvariant();
399399
Name += vowels[r.Next(vowels.Length)];
400400
int b = 2; //b tells how many times a new letter has been added. It's 2 right now because the first two letters are already in the name.
401401
while (b < len) {

dev/pyRevitLabs/pyRevitLabs.Common/Extensions/Extensions.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ public static string NormalizeAsPath(this string path) {
127127
var match = DriveLetterFinder.Match(normedPath);
128128
if (match.Success) {
129129
var driveLetter = match.Groups["drive"].Value + ":";
130-
normedPath = normedPath.Replace(driveLetter, driveLetter.ToUpper());
130+
normedPath = normedPath.Replace(driveLetter, driveLetter.ToUpperInvariant());
131131
}
132132

133133
logger.Debug("Normalized as \"{0}\"", normedPath);

dev/pyRevitLabs/pyRevitLabs.Common/GlobalConfigs.cs

-72
This file was deleted.

dev/pyRevitLabs/pyRevitLabs.Common/pyRevitLabs.Common.csproj

-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@
7373
<Compile Include="OSVersionInfo.cs" />
7474
<Compile Include="Unmanaged.cs" />
7575
<Compile Include="UserEnv.cs" />
76-
<Compile Include="GlobalConfigs.cs" />
7776
<Compile Include="Errors.cs" />
7877
<Compile Include="Extensions\Extensions.cs" />
7978
<Compile Include="GitInstaller.cs" />

dev/pyRevitLabs/pyRevitLabs.DeffrelDB/DefaultDataFormatter.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public EntryChangeRequest BuildDataStoreEntry(List<string> dstoreEntries,
2020
lineParts.Add(buildMdataString(mdataDStore, dstoreType.TypeName));
2121
lineParts.Add(buildMdataString(mdataDStoreSource, dstoreType.Path));
2222
lineParts.Add(buildMdataString(mdataDStoreVersion, dstoreType.DataFormatVersion));
23-
lineParts.Add(buildMdataString(mdataDStoreEncoding, dstoreType.DataFormatEncoding.WebName.ToUpper()));
23+
lineParts.Add(buildMdataString(mdataDStoreEncoding, dstoreType.DataFormatEncoding.WebName.ToUpperInvariant()));
2424

2525
return new EntryChangeRequest(EntryChangeType.Insert, 0, string.Join(mdataSeparator, lineParts));
2626
}

0 commit comments

Comments
 (0)