class CustomizedPageStatus
An enumeration class that defines constants representing the customization (ghost) status of SharePoint files (SPFile).
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/pages/customized_page_status.py
1 - 11
simple
Purpose
This class serves as an enumeration to represent the three possible customization states of a SharePoint file: never cached (None_), cached but not customized (Uncustomized), and cached and customized (Customized). It provides a type-safe way to check and compare file customization statuses in SharePoint operations.
Source Code
class CustomizedPageStatus:
"""Specifies the customization (ghost) status of the SPFile."""
None_ = 0
"""The page was never cached."""
Uncustomized = 1
"""The page is cached and has not been customized"""
Customized = 2
"""The page was cached but has been customized"""
Parameters
| Name | Type | Default | Kind |
|---|---|---|---|
bases |
- | - |
Parameter Details
bases: This refers to the base classes from which CustomizedPageStatus inherits. In this case, it implicitly inherits from 'object' (the default base class in Python 3). No explicit base classes are defined.
Return Value
Instantiating this class returns a CustomizedPageStatus object, though this class is typically used by accessing its class-level integer constants (None_, Uncustomized, Customized) rather than creating instances. The constants return integer values: 0, 1, and 2 respectively.
Class Interface
Attributes
| Name | Type | Description | Scope |
|---|---|---|---|
None_ |
int | Represents that the page was never cached. Value is 0. | class |
Uncustomized |
int | Represents that the page is cached and has not been customized. Value is 1. | class |
Customized |
int | Represents that the page was cached but has been customized. Value is 2. | class |
Usage Example
# Access the status constants directly from the class
status = CustomizedPageStatus.Uncustomized
print(status) # Output: 1
# Use in conditional logic
if file_status == CustomizedPageStatus.Customized:
print("File has been customized")
elif file_status == CustomizedPageStatus.Uncustomized:
print("File is cached but not customized")
else:
print("File was never cached")
# Compare status values
is_customized = (current_status == CustomizedPageStatus.Customized)
# Use in function parameters
def process_file(status: int):
if status == CustomizedPageStatus.None_:
return "Never cached"
return "Cached"
Best Practices
- This class should not be instantiated; instead, access its class-level constants directly (e.g., CustomizedPageStatus.Customized).
- Use these constants for type-safe comparisons rather than hardcoding integer values (0, 1, 2) throughout your code.
- Consider using Python's enum.IntEnum for a more robust enumeration implementation if extending this functionality.
- The 'None_' constant uses an underscore suffix to avoid conflict with Python's None keyword.
- This is a simple constant container class; no state management or lifecycle considerations are needed.
- When comparing file statuses, always use the class constants rather than raw integers for better code readability and maintainability.
Similar Components
AI-powered semantic similarity - components with related functionality:
-
class DenyAddAndCustomizePagesStatus 75.0% similar
-
class SiteStatus 69.5% similar
-
class TemplateFileType 63.8% similar
-
class PageType 61.1% similar
-
class SharingOperationStatusCode 59.8% similar