diff --git a/paramecio2/libraries/check_i18n.py b/paramecio2/libraries/check_i18n.py index c093112..c384d90 100644 --- a/paramecio2/libraries/check_i18n.py +++ b/paramecio2/libraries/check_i18n.py @@ -16,6 +16,9 @@ except: #sys.exit(1) pass +"""Command line utility for extract I18n.lang strings from html templates and .py files +""" + pattern=re.compile('^\w+\.(py|html|phtml|js)$') ignored=re.compile('^[__|\.].*$') @@ -26,6 +29,8 @@ lang_t=re.compile("\${lang\('(.*?)',\s+'(.*?)',\s+'(.*?)'\)\}") tmp_lang={} def start(): + """Function for extract I18n.lang strings from html templates and .py files using regular expressions + """ global lang_p global lang_t diff --git a/paramecio2/libraries/config_admin.py b/paramecio2/libraries/config_admin.py index 9474e80..b022c53 100644 --- a/paramecio2/libraries/config_admin.py +++ b/paramecio2/libraries/config_admin.py @@ -1,4 +1,9 @@ # Variable base for admin modules +"""Variables for control admin modules for admin module +""" + config_admin=[] +"""list: List for save the differente admin configurations from paramecio2 modules +""" diff --git a/paramecio2/libraries/datetime.py b/paramecio2/libraries/datetime.py index e1d6d6f..c33d451 100644 --- a/paramecio2/libraries/datetime.py +++ b/paramecio2/libraries/datetime.py @@ -81,7 +81,7 @@ def format_timedata(time): time (str): A YYYYMMDDHHmmss string for get datetime components from there. Returns: - list: A dict with datetime components (year, month, day, hour, minute, second). + list (list): A dict with datetime components (year, month, day, hour, minute, second). """ @@ -131,7 +131,7 @@ def checkdatetime(y, m, d, h, mi, s): s (int): seconds Returns: - bool: If values are correct, return True, otherwise return False + bool (bool): If values are correct, return True, otherwise return False """ @@ -153,7 +153,7 @@ def now(utc=False, tz=''): tz (str, optional): Timezone name, example: Europe/Madrid. If set the datetime is returned in the timezone selected Returns: - str: Return actual datetime + datetime (str): Return actual datetime """ @@ -180,7 +180,7 @@ def today(utc=False,tz=''): tz (str, optional): Timezone name, example: Europe/Madrid. If set the date is returned in the timezone selected Returns: - str: Return actual date with 00:00:00 how time + datetime (str): Return actual date with 00:00:00 how time """ @@ -197,7 +197,7 @@ def obtain_timestamp(timeform): Returns: - int: datetime in timestamp format + Timestamp (int): datetime in timestamp format """ @@ -225,7 +225,7 @@ def timestamp_to_datetime(timestamp, sql_format_time=sql_format_time): timestamp (int): The timestamp for convert Returns: - str: Datetime in YYYYMMDDHHmmss format + datetime (str): Datetime in YYYYMMDDHHmmss format """ @@ -242,7 +242,7 @@ def timestamp_to_datetime_local(timestamp, tz='', sql_format_time=sql_format_tim Returns: - str: Datetime in YYYYMMDDHHmmss format in selected timezone datetime + datetime (str): Datetime in YYYYMMDDHHmmss format in selected timezone datetime """ @@ -264,7 +264,7 @@ def format_datetime(format_time, timeform, func_utc_return): func_utc_return (function): A function used for get the datetime. Returns: - If timestamp is False, return False, if timestamp is valid, return the datetime formatted + datetime (str): If timestamp is False, return False, if timestamp is valid, return the datetime formatted """ @@ -293,7 +293,7 @@ def local_to_gmt(timeform, sql_format_time=sql_format_time): sql_format_time (str, optional): by default, the format is YYYYMMDDHHmmss, you can put other formatted str formats for date, here. Returns: - If timeform is False, return False, if timeform is valid, return the datetime formatted + datetime (str): If timeform is False, return False, if timeform is valid, return the datetime formatted """ @@ -312,7 +312,7 @@ def gmt_to_local(timeform, sql_format_time=sql_format_time): sql_format_time (str, optional): by default, the format is YYYYMMDDHHmmss, you can put other formatted str formats for date, here. Returns: - If timeform is False, return False, if timeform is valid, return the datetime formatted + datetime (str): If timeform is False, return False, if timeform is valid, return the datetime formatted """ @@ -326,7 +326,7 @@ def format_time(timeform): timeform (str): datetime in YYYYMMDDHHmmss format to convert to new format Returns: - If timeform is False, return False, if timeform is valid, return the datetime formatted in UTC + datetime (str): If timeform is False, return False, if timeform is valid, return the datetime formatted in UTC """ @@ -340,7 +340,7 @@ def format_date(timeform): timeform (str): datetime in YYYYMMDDHHmmss format to convert to new format Returns: - If timeform is False, return False, if timeform is valid, return the datetime formatted in UTC + datetime (str): If timeform is False, return False, if timeform is valid, return the datetime formatted in UTC """ return format_datetime(format_date_txt, timeform, sum_utc) @@ -353,7 +353,7 @@ def format_fulldate(timeform): timeform (str): datetime in YYYYMMDDHHmmss format to convert to new format Returns: - If timeform is False, return False, if timeform is valid, return the datetime formatted in UTC + datetime (str): If timeform is False, return False, if timeform is valid, return the datetime formatted in UTC """ return format_datetime(format_date_txt+' '+format_time_txt, timeform, sum_utc) @@ -366,7 +366,7 @@ def format_local_time(timeform): timeform (str): datetime in YYYYMMDDHHmmss format to convert to new format Returns: - If timeform is False, return False, if timeform is valid, return the datetime formatted + datetime (str): If timeform is False, return False, if timeform is valid, return the datetime formatted """ return format_datetime(format_time_txt, timeform, no_utc) @@ -379,7 +379,7 @@ def format_local_date(timeform): timeform (str): datetime in YYYYMMDDHHmmss format to convert to new format Returns: - If timeform is False, return False, if timeform is valid, return the datetime formatted + datetime (str): If timeform is False, return False, if timeform is valid, return the datetime formatted """ return format_datetime(format_date_txt, timeform, no_utc) @@ -392,7 +392,7 @@ def format_local_fulldate(timeform): timeform (str): datetime in YYYYMMDDHHmmss format to convert to new format Returns: - If timeform is False, return False, if timeform is valid, return the datetime formatted + datetime (str): If timeform is False, return False, if timeform is valid, return the datetime formatted """ return format_datetime(format_date_txt+' '+format_time_txt, timeform, no_utc) @@ -405,7 +405,7 @@ def format_strtime(strtime, timeform): timeform (str): datetime in YYYYMMDDHHmmss format to convert to new format Returns: - If timeform is False, return False, if timeform is valid, return the datetime formatted in UTC + datetime (str): If timeform is False, return False, if timeform is valid, return the datetime formatted in UTC """ return format_datetime(strtime, timeform, sum_utc) @@ -418,7 +418,7 @@ def format_local_strtime(strtime, timeform): timeform (str): datetime in YYYYMMDDHHmmss format to convert to new format Returns: - If timeform is False, return False, if timeform is valid, return the datetime formatted + datetime (str): If timeform is False, return False, if timeform is valid, return the datetime formatted """ return format_datetime(strtime, timeform, no_utc) @@ -434,7 +434,7 @@ def sum_utc(timestamp, tz=''): tz (str): Timezone of timestamp Returns: - Return arrow object with new timezone selected + datetime (str): Return arrow object with new timezone selected """ #offset=time.altzone @@ -459,7 +459,7 @@ def substract_utc(timestamp, tz=''): tz (str): Timezone of timestamp Returns: - Return arrow object with UTC timezone selected + datetime (str): Return arrow object with UTC timezone selected """ #offset=time.altzone @@ -487,7 +487,7 @@ def no_utc(timestamp): timestamp (int): The timestamp for convert in UTC timezone Returns: - Return arrow object based in timestamp value + datetime (str): Return arrow object based in timestamp value """ @@ -550,7 +550,7 @@ class TimeClass: num_months (int): Number of months to add Returns: - New added datetime + datetime (str): New added datetime """ m=self.t.shift(months=+num_months) @@ -564,7 +564,7 @@ class TimeClass: num_months (int): Number of months to substract Returns: - New substracted datetime + datetime (str): New substracted datetime """ m=self.t.shift(months=-num_months) @@ -578,7 +578,7 @@ class TimeClass: num_days (int): Number of days to add Returns: - New added datetime + datetime (str): New added datetime """ m=self.t.shift(days=+num_days) @@ -592,7 +592,7 @@ class TimeClass: num_days (int): Number of days to substract Returns: - New substracted datetime + datetime (str): New substracted datetime """ @@ -607,7 +607,7 @@ class TimeClass: num_years (int): Number of years to add Returns: - New added datetime + datetime (str): New added datetime """ m=self.t.shift(years=+num_years) @@ -621,7 +621,7 @@ class TimeClass: num_years (int): Number of years to substract Returns: - New substracted datetime + datetime (str): New substracted datetime """ m=self.t.shift(years=-num_years) @@ -635,7 +635,7 @@ class TimeClass: num_hours (int): Number of hours to add Returns: - New added datetime + datetime (str): New added datetime """ m=self.t.shift(hours=+num_hours) @@ -649,7 +649,7 @@ class TimeClass: num_hours (int): Number of hours to substract Returns: - New substracted datetime + datetime (str): New substracted datetime """ m=self.t.shift(hours=-num_hours) @@ -660,7 +660,7 @@ class TimeClass: """Method for get datetime formatted using format_date_full attribute Returns: - Datetime formatted with format_date_full attribute + datetime (str): Datetime formatted with format_date_full attribute """ return self.t.format(self.format_date_full) @@ -669,7 +669,7 @@ class TimeClass: """Method for get datetime formatted using format_time attribute Returns: - Datetime formatted with format_time attribute + datetime (str): Datetime formatted with format_time attribute """ return self.t.format(self.format_time) @@ -699,7 +699,7 @@ class TimeClass: Returns: - Actual datetime formatted in YYYYMMDDHHmmss format. + datetime (str): Actual datetime formatted in YYYYMMDDHHmmss format. """ if not utc: @@ -719,7 +719,7 @@ class TimeClass: Returns: - Actual datetime formatted in YYYYMMDD000000 format. + datetime (str): Actual datetime formatted in YYYYMMDD000000 format. """ if utc: @@ -738,7 +738,7 @@ class TimeClass: Returns: - Datetime in YYYYMMDDHHmmss format. + datetime (str): Datetime in YYYYMMDDHHmmss format. """ return arrow.get(timestamp).format(sql_format_time) @@ -752,7 +752,7 @@ class TimeClass: Returns: - Datetime in YYYYMMDDHHmmss format.If timeform is incorrect, return False + datetime (str): Datetime in YYYYMMDDHHmmss format.If timeform is incorrect, return False """ y, m, d, h, mi, s=format_timedata(timeform) @@ -776,7 +776,7 @@ class TimeClass: Returns: - Datetime in strtime format.If timeform is incorrect, return False + datetime (str): Datetime in strtime format.If timeform is incorrect, return False """ diff --git a/paramecio2/libraries/db/corefields.py b/paramecio2/libraries/db/corefields.py index 16db01f..5d41e55 100644 --- a/paramecio2/libraries/db/corefields.py +++ b/paramecio2/libraries/db/corefields.py @@ -139,7 +139,7 @@ class DoubleField(FloatField): return 'DOUBLE NOT NULL DEFAULT "0"' class CharField(PhangoField): - """Simple alias for PhangoField for clarify that """ + """Simple alias for PhangoField""" pass @@ -238,12 +238,12 @@ class ForeignKeyField(IntegerField): """ Args: name (str): Name of field - related_table(WebModel): The table-model related with this foreign key + related_table (WebModel): The table-model related with this foreign key size (int): The size of the new field in database. By default 11. required (bool): Boolean for define if field is required or not identifier_field (str): The Id field name from related table named_field (str): The field from related table used for identify the row seleted from related table - select_field (list): A series of fields names from related + select_fields (list): A series of fields names from related """ super(ForeignKeyField, self).__init__(name, size, required) @@ -292,7 +292,6 @@ class BooleanField(IntegerField): """ Args: name (str): Name of field - related_table(str): The table related with this foreign key size (int): The size of the new field in database. By default 11. """ diff --git a/paramecio2/libraries/db/coreforms.py b/paramecio2/libraries/db/coreforms.py index caed634..6a37dd8 100644 --- a/paramecio2/libraries/db/coreforms.py +++ b/paramecio2/libraries/db/coreforms.py @@ -141,7 +141,7 @@ class SelectForm(BaseForm): def __init__(self, name, value, elements=OrderedDict()): """ Args: - ame (str): The html name for this form + name (str): The html name for this form value (str): The default value of this html form elements (OrderedDict): An ordered dict with the keys(the form value) and text label. Example, if you have a OrderedDict how {'0': 'Value selected'} in a html select form you have the next result: