Skip to content

Commit

Permalink
touch up
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcouffin committed Oct 22, 2023
1 parent 159f2d7 commit a71cade
Show file tree
Hide file tree
Showing 18 changed files with 48 additions and 48 deletions.
4 changes: 2 additions & 2 deletions pyrevitlib/pyrevit/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""pyRevit root level config for all pyrevit sub-modules.
Examples:
'''
'''python
from pyrevit import DB, UI
from pyrevit import PyRevitException, PyRevitIOError
Expand Down Expand Up @@ -182,7 +182,7 @@ class _HostApplication(object):
postable commands, and other functionality.
Examples:
'''
'''python
hostapp = _HostApplication()
hostapp.is_newer_than(2017)
'''
Expand Down
2 changes: 1 addition & 1 deletion pyrevitlib/pyrevit/api.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Provide access to Revit API.
Examples:
'''
'''python
from pyrevit.api import AdWindows
'''
"""
Expand Down
2 changes: 1 addition & 1 deletion pyrevitlib/pyrevit/compat.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""python engine compatibility module.
Examples:
'''
'''python
from pyrevit.compat import IRONPY277
from pyrevit.compat import safe_strtype
'''
Expand Down
2 changes: 1 addition & 1 deletion pyrevitlib/pyrevit/framework.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Provide access to DotNet Framework.
Examples:
'''
'''python
from pyrevit.framework import Assembly, Windows
'''
"""
Expand Down
2 changes: 1 addition & 1 deletion pyrevitlib/pyrevit/loader/sessioninfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def get_runtime_info():
(RuntimeInfo): runtime info tuple
Examples:
'''
'''python
sessioninfo.get_runtime_info()
'''
"""
Expand Down
4 changes: 2 additions & 2 deletions pyrevitlib/pyrevit/loader/sessionmgr.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ def load_session():
through interactions with .extensions, .loader.asmmaker, and .loader.uimaker.
Examples:
'''
'''python
from pyrevit.loader.sessionmgr import load_session
load_session() # start loading a new pyRevit session
'''
Expand Down Expand Up @@ -472,7 +472,7 @@ def find_pyrevitcmd(pyrevitcmd_unique_id):
instantiated before use.
Examples:
'''
'''python
cmd = find_pyrevitcmd('pyRevitCorepyRevitpyRevittoolsReload')
command_instance = cmd()
command_instance.Execute() # Provide commandData, message, elements
Expand Down
26 changes: 13 additions & 13 deletions pyrevitlib/pyrevit/output/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
uses the `pyrevit.output` module to get access to the output wrapper.
Examples:
'''
'''python
from pyrevit import script
output = script.get_output()
'''
Expand Down Expand Up @@ -180,7 +180,7 @@ def inject_to_head(self, element_tag, element_contents, attribs=None):
attribs (:obj:`dict`): dictionary of attribute names and value
Examples:
'''
'''python
output = pyrevit.output.get_output()
output.inject_to_head('script',
'', # no script since it's a link
Expand Down Expand Up @@ -210,7 +210,7 @@ def inject_to_body(self, element_tag, element_contents, attribs=None):
attribs (:obj:`dict`): dictionary of attribute names and value
Examples:
'''
'''python
output = pyrevit.output.get_output()
output.inject_to_body('script',
'', # no script since it's a link
Expand Down Expand Up @@ -240,7 +240,7 @@ def inject_script(self, script_code, attribs=None, body=False):
body (bool, optional): injects script into body instead of head
Examples:
'''
'''python
output = pyrevit.output.get_output()
output.inject_script('', # no script since it's a link
{'src': js_script_file_path})
Expand All @@ -259,7 +259,7 @@ def add_style(self, style_code, attribs=None):
attribs (:obj:`dict`): dictionary of attribute names and value
Examples:
'''
'''python
output = pyrevit.output.get_output()
output.add_style('body { color: blue; }')
'''
Expand Down Expand Up @@ -417,7 +417,7 @@ def update_progress(self, cur_value, max_value):
max_value (float): total value e.g. 100
Examples:
'''
'''python
output = pyrevit.output.get_output()
for i in range(100):
output.update_progress(i, 100)
Expand Down Expand Up @@ -502,7 +502,7 @@ def print_html(html_str):
"""Add the html code to the output window.
Examples:
'''
'''python
output = pyrevit.output.get_output()
output.print_html('<strong>Title</strong>')
'''
Expand All @@ -515,7 +515,7 @@ def print_code(code_str):
"""Print code to the output window with special formatting.
Examples:
'''
'''python
output = pyrevit.output.get_output()
output.print_code('value = 12')
'''
Expand All @@ -535,7 +535,7 @@ def print_md(md_str):
"""Process markdown code and print to output window.
Examples:
'''
'''python
output = pyrevit.output.get_output()
output.print_md('### Title')
'''
Expand All @@ -558,7 +558,7 @@ def print_table(self, table_data, columns=None, formats=None,
last_line_style (str): css style of last row
Examples:
'''
'''python
data = [
['row1', 'data', 'data', 80 ],
['row2', 'data', 'data', 45 ],
Expand Down Expand Up @@ -624,7 +624,7 @@ def print_image(self, image_path):
r"""Prints given image to the output.
Examples:
'''
'''python
output = pyrevit.output.get_output()
output.print_image(r'C:\image.gif')
'''
Expand Down Expand Up @@ -662,11 +662,11 @@ def linkify(element_ids, title=None):
(str): clickable link
Examples:
'''
'''python
output = pyrevit.output.get_output()
for idx, elid in enumerate(element_ids):
print('{}: {}'.format(idx+1, output.linkify(elid)))
'''00
'''
"""
return coreutils.prepare_html_str(
linkmaker.make_link(element_ids, contents=title)
Expand Down
2 changes: 1 addition & 1 deletion pyrevitlib/pyrevit/output/linkmaker.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def make_link(element_ids, contents=None):
method.
Examples:
'''
'''python
output = pyrevit.output.get_output()
for idx, elid in enumerate(element_ids):
print('{}: {}'.format(idx+1, output.linkify(elid)))
Expand Down
2 changes: 1 addition & 1 deletion pyrevitlib/pyrevit/routes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class API(object):
name (str): URL-safe unique root name of the API
Examples:
'''
'''python
from pyrevit import routes
api = routes.API("pyrevit-core")
@api.route('/sessions/', methods=['POST'])
Expand Down
2 changes: 1 addition & 1 deletion pyrevitlib/pyrevit/routes/server/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def extract_route_params(route_pattern, request_path):
"""Extracts route params from request path based on pattern.
Examples:
'''
'''python
extract_route_params('api/v1/posts/<int:id>', 'api/v1/posts/12')
'''
[<RouteParam key:id value=12>]
Expand Down
2 changes: 1 addition & 1 deletion pyrevitlib/pyrevit/runtime/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ def create_type(modulebuilder, type_class, class_name, custom_attr_list, *args):
(type): returns created dotnet type
Examples:
'''
'''python
asm_builder = AppDomain.CurrentDomain.DefineDynamicAssembly(
win_asm_name, AssemblyBuilderAccess.RunAndSave, filepath
)
Expand Down
26 changes: 13 additions & 13 deletions pyrevitlib/pyrevit/script.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Provide basic utilities for pyRevit scripts.
Examples:
'''
'''python
from pyrevit import script
script.clipboard_copy('some text')
data = script.journal_read('data-key')
Expand Down Expand Up @@ -205,11 +205,11 @@ def get_universal_data_file(file_id, file_ext, add_cmd_name=False):
``pyRevit_{file_id}.{file_ext}``
Examples:
'''
'''python
script.get_universal_data_file('mydata', 'data')
'''
'/pyRevit_mydata.data'
'''
'''python
script.get_universal_data_file('mydata', 'data', add_cmd_name=True)
'''
'/pyRevit_Command Name_mydata.data'
Expand Down Expand Up @@ -240,11 +240,11 @@ def get_data_file(file_id, file_ext, add_cmd_name=False):
``pyRevit_{Revit Version}_{file_id}.{file_ext}``
Examples:
'''
'''python
script.get_data_file('mydata', 'data')
'''
'/pyRevit_2018_mydata.data'
'''
'''python
script.get_data_file('mydata', 'data', add_cmd_name=True)
'''
'/pyRevit_2018_Command Name_mydata.data'
Expand Down Expand Up @@ -276,11 +276,11 @@ def get_instance_data_file(file_id, add_cmd_name=False):
``pyRevit_{Revit Version}_{Process Id}_{file_id}.{file_ext}``
Examples:
'''
'''python
script.get_instance_data_file('mydata')
'''
'/pyRevit_2018_6684_mydata.tmp'
'''
'''python
script.get_instance_data_file('mydata', add_cmd_name=True)
'''
'/pyRevit_2018_6684_Command Name_mydata.tmp'
Expand Down Expand Up @@ -309,11 +309,11 @@ def get_document_data_file(file_id, file_ext, add_cmd_name=False):
``pyRevit_{Revit Version}_{file_id}_{Project Name}.{file_ext}``
Examples:
'''
'''python
script.get_document_data_file('mydata', 'data')
'''
'/pyRevit_2018_mydata_Project1.data'
'''
'''python
script.get_document_data_file('mydata', 'data', add_cmd_name=True)
'''
'/pyRevit_2018_Command Name_mydata_Project1.data'
Expand Down Expand Up @@ -569,7 +569,7 @@ def get_envvar(envvar):
(Any): object stored in environment variable
Examples:
'''
'''python
script.get_envvar('ToolActiveState')
'''
True
Expand All @@ -590,7 +590,7 @@ def set_envvar(envvar, value):
value (any): value of environment variable
Examples:
'''
'''python
script.set_envvar('ToolActiveState', False)
script.get_envvar('ToolActiveState')
'''
Expand Down Expand Up @@ -660,7 +660,7 @@ def store_data(slot_name, data, this_project=True):
this_project (bool): data belongs to this project only
Examples:
'''
'''python
from pyrevit import revit
from pyrevit import script
Expand Down Expand Up @@ -721,7 +721,7 @@ def load_data(slot_name, this_project=True):
(object): stored data
Examples:
'''
'''python
from pyrevit import revit
from pyrevit import script
Expand Down
6 changes: 3 additions & 3 deletions pyrevitlib/pyrevit/telemetry/__init__.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
"""This module manages the telemetry system.
This function is used to setup the telemetry system on pyRevit startup:
'''
'''python
setup_telemetry()
'''
These functions are used to query information about the logging system:
'''
'''python
get_telemetry_state()
'''
'''
'''python
get_apptelemetry_state()
'''
Expand Down
2 changes: 1 addition & 1 deletion pyrevitlib/pyrevit/telemetry/record.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class CommandCustomResults(object):
to use wrapper around it.
Examples:
'''
'''python
CommandCustomResults().returnparam = 'some return value'
'''
Expand Down
2 changes: 1 addition & 1 deletion pyrevitlib/pyrevit/unittests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
suite to test the full functionality of that module, although only a subset of
functions are used during startup and normal operations of pyRevit.
'''
'''python
from unittest import TestCase
class TestWithIndependentOutput(TestCase):
def setUp(self):
Expand Down
6 changes: 3 additions & 3 deletions pyrevitlib/pyrevit/userconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
All other modules use this module to query user config.
Examples:
'''
'''python
from pyrevit.userconfig import user_config
user_config.add_section('newsection')
user_config.newsection.property = value
Expand All @@ -25,7 +25,7 @@
:pyobject: get_config
Examples:
'''
'''python
from pyrevit import script
cfg = script.get_config()
cfg.property = value
Expand Down Expand Up @@ -69,7 +69,7 @@ class PyRevitConfig(configparser.PyRevitConfigParser):
config_type (str): type of config file
Examples:
'''
'''python
cfg = PyRevitConfig(cfg_file_path)
cfg.add_section('sectionname')
cfg.sectionname.property = value
Expand Down
2 changes: 1 addition & 1 deletion pyrevitlib/pyrevit/versionmgr/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Utility functions for managing pyRevit versions.
Examples:
'''
'''python
from pyrevit import versionmgr
v = versionmgr.get_pyrevit_version()
v.get_formatted()
Expand Down
Loading

0 comments on commit a71cade

Please sign in to comment.