PyBugReporter 1.0.10__tar.gz → 1.0.11__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PyBugReporter
3
- Version: 1.0.10
3
+ Version: 1.0.11
4
4
  Summary: A python library for catching thrown exceptions and automatically creating issues on a GitHub repo.
5
5
  Home-page: https://github.com/byuawsfhtl/PyBugReporter.git
6
6
  Author: Record Linking Lab
@@ -0,0 +1 @@
1
+ __version__ = '1.0.11'
@@ -366,6 +366,17 @@ class BugReporter:
366
366
  def manualBugReport(cls, repoName: str, errorTitle: str, errorMessage: str) -> None:
367
367
  """Manually sends a bug report to the Github repository.
368
368
 
369
+ Args:
370
+ repoName (str): the name of the repo to report to
371
+ errorTitle (str): the title of the error
372
+ errorMessage (str): the error message
373
+ """
374
+ asyncio.run(cls.manualBugReportAsync(repoName,errorTitle,errorMessage))
375
+
376
+ @classmethod
377
+ async def manualBugReportAsync(cls, repoName: str, errorTitle: str, errorMessage: str) -> None:
378
+ """Manually sends a bug report to the Github repository.
379
+
369
380
  Args:
370
381
  repoName (str): the name of the repo to report to
371
382
  errorTitle (str): the title of the error
@@ -381,7 +392,7 @@ class BugReporter:
381
392
  headers = {"Authorization": f"Bearer {handler.githubKey}"}
382
393
 
383
394
  # query variables
384
- repoId = cls._getRepoId(cls, handler)
395
+ repoId = await cls._getRepoId_async(cls, handler)
385
396
  bugLabel = "LA_kwDOJ3JPj88AAAABU1q15w"
386
397
  autoLabel = "LA_kwDOJ3JPj88AAAABU1q2DA"
387
398
 
@@ -414,10 +425,15 @@ class BugReporter:
414
425
  }
415
426
  }
416
427
 
417
- issueExists = cls._checkIfIssueExists(cls, handler, errorTitle)
428
+ issueExists = await cls._checkIfIssueExists_async(cls, handler, errorTitle)
429
+
430
+ # Send to Discord if applicable
431
+ if cls.handlers[repoName].useDiscord:
432
+ discordBot = DiscordBot(cls.handlers[repoName].botToken, cls.handlers[repoName].channelId)
433
+ await discordBot.send_message(f"## {repoName}: {errorTitle}\n{errorMessage}", issueExists)
418
434
 
419
435
  if (issueExists == False):
420
- result = asyncio.run(client.execute_async(query=createIssue, variables=variables, headers=headers))
436
+ result = await client.execute_async(query=createIssue, variables=variables, headers=headers)
421
437
  print('\nThis error has been reported to the Tree Growth team.\n')
422
438
  else:
423
439
  print('\nOur team is already aware of this issue.\n')
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PyBugReporter
3
- Version: 1.0.10
3
+ Version: 1.0.11
4
4
  Summary: A python library for catching thrown exceptions and automatically creating issues on a GitHub repo.
5
5
  Home-page: https://github.com/byuawsfhtl/PyBugReporter.git
6
6
  Author: Record Linking Lab
@@ -1 +0,0 @@
1
- __version__ = '1.0.10'
File without changes
File without changes
File without changes
File without changes